[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sw/qa sw/source writerfilter/source

2022-08-22 Thread Samuel Mehrbrodt (via logerrit)
 sw/qa/extras/rtfexport/data/tdf150267.rtf |  209 ++
 sw/qa/extras/rtfexport/rtfexport5.cxx |   21 +
 sw/source/filter/ww8/rtfexport.cxx|   54 
 sw/source/filter/ww8/rtfexport.hxx|2 
 writerfilter/source/rtftok/rtfcontrolwords.hxx|1 
 writerfilter/source/rtftok/rtfdispatchdestination.cxx |3 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|   26 ++
 writerfilter/source/rtftok/rtfdocumentimpl.hxx|9 
 8 files changed, 325 insertions(+)

New commits:
commit 8d36537cea6d976e3fc2a8471d7f52660603839d
Author: Samuel Mehrbrodt 
AuthorDate: Thu Aug 18 11:13:31 2022 +0200
Commit: Michael Stahl 
CommitDate: Mon Aug 22 11:38:24 2022 +0200

tdf#150267 RTF: Import/Export unused document variables

Previously document variables were only imported when there was
a field in the document using them.

This adds import/export for the RTF `docvar` group.

Change-Id: I25099e037594f4b4c5530ba3a28c64aaa2927918
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138482
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
(cherry picked from commit 634bb0db617d02f1aeea89f4555a5e34baaa4e91)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138539

diff --git a/sw/qa/extras/rtfexport/data/tdf150267.rtf 
b/sw/qa/extras/rtfexport/data/tdf150267.rtf
new file mode 100644
index ..704afa39a3f8
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf150267.rtf
@@ -0,0 +1,209 @@
+{\rtf1\adeflang1025\ansi\ansicpg1250\uc1\adeff31507\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1038\deflangfe1038\themelang1038\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi
 \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New 
Roman;}{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times 
New Roman;}
+{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 
020f0502020204030204}Calibri;}{\flomajor\f31500\fbidi 
\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
+{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 
02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi 
\fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;}
+{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 
02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi 
\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
+{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 
02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi 
\fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
+{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 
02020603050405020304}Times New Roman;}{\f40\fbidi \froman\fcharset238\fprq2 
Times New Roman CE;}{\f41\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\f43\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f44\fbidi 
\froman\fcharset162\fprq2 Times New Roman Tur;}{\f45\fbidi 
\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f46\fbidi 
\froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\f47\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f48\fbidi 
\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f40\fbidi 
\froman\fcharset238\fprq2 Times New Roman CE;}{\f41\fbidi 
\froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\f43\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f44\fbidi 
\froman\fcharset162\fprq2 Times New Roman Tur;}{\f45\fbidi 
\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f46\fbidi 
\froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\f47\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f48\fbidi 
\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f430\fbidi 
\fswiss\fcharset238\fprq2 Calibri CE;}{\f431\fbidi \fswiss\fcharset204\fprq2 
Calibri Cyr;}
+{\f433\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f434\fbidi 
\fswiss\fcharset162\fprq2 Calibri Tur;}{\f435\fbidi \fswiss\fcharset177\fprq2 
Calibri (Hebrew);}{\f436\fbidi \fswiss\fcharset178\fprq2 Calibri (Arabic);}
+{\f437\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f438\fbidi 
\fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\flomajor\f31508\fbidi 
\froman\fcharset238\fprq2 Times New Roman CE;}
+{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman 
Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman 
Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
+{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman 
(Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman 
(Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman 
Baltic;}
+{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman 
(Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman 
CE;}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}

[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sw/qa sw/source writerfilter/source

2022-08-09 Thread Michael Stahl (via logerrit)
 sw/qa/extras/rtfexport/data/FORMDROPDOWN.rtf  |   33 
 sw/qa/extras/rtfexport/rtfexport4.cxx |   21 +++
 sw/source/filter/ww8/rtfexport.cxx|   58 +-
 writerfilter/source/dmapper/FormControlHelper.cxx |5 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|4 +
 5 files changed, 117 insertions(+), 4 deletions(-)

New commits:
commit 07e20e619919114def34ddc4d6241b1f891c443b
Author: Michael Stahl 
AuthorDate: Fri Aug 5 12:57:57 2022 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Aug 9 09:47:09 2022 +0200

tdf#148518 writerfilter,sw: RTF import/export of FORMDROPDOWN field

On import, the values overwrote each other; export of the form data
was missing completely.

Change-Id: I918b3cfced39dc2602c6de03cdaf5848a9825dd2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137861
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 47b08551a77918e4d35a98197ac99c1c3d5dec73)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137970
Reviewed-by: Thorsten Behrens 

diff --git a/sw/qa/extras/rtfexport/data/FORMDROPDOWN.rtf 
b/sw/qa/extras/rtfexport/data/FORMDROPDOWN.rtf
new file mode 100644
index ..ef1d3af744db
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/FORMDROPDOWN.rtf
@@ -0,0 +1,33 @@
+{\rtf1\adeflang1025\ansi\ansicpg1250\uc1\adeff0\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1038\deflangfe1038\themelang1031\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi
 \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New 
Roman;}{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times 
New Roman;}
+}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;
+\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;
+\red192\green192\blue192;}{\*\defchp \fs22 }{\*\defpap \ql 
\li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
 }\noqfpromote {\stylesheet{
+\ql 
\li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 
\fs24\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \snext0 \sqformat 
\spriority0 Normal;}{\*\cs10 \additive 
+\ssemihidden Default Paragraph 
Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
 
+\ql 
\li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 
\fs22\lang1038\langfe1038\cgrid\langnp1038\langfenp1038 \snext11 \ssemihidden 
\sunhideused 
+Normal Table;}{\*\ts15\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 
\trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 
\trbrdrv\brdrs\brdrw10 
+\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
 
+\ql 
\li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 
\fs20\lang1031\langfe1031\cgrid\langnp1031\langfenp1031 \sbasedon11 \snext15 
\styrsid6366418 Table Grid;}{
+\s16\ql 
\li0\ri0\widctlpar\tqc\tx4513\tqr\tx9026\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 
\fs24\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 
+\sbasedon0 \snext16 \slink17 \styrsid14450383 header;}{\*\cs17 \additive 
\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 
\fs24\lang3079\langfe3079\langnp3079\langfenp3079 \sbasedon10 \slink16 \slocked 
\styrsid14450383 Header Char;}{\s18\ql \li0\ri0\widctlpar
+\tqc\tx4513\tqr\tx9026\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 
\fs24\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \sbasedon0 \snext18 
\slink19 \styrsid14450383 footer;}{\*\cs19 
+\additive \rtlch\fcs1 \af0\afs24 \ltrch\fcs0 
\fs24\lang3079\langfe3079\langnp3079\langfenp3079 \sbasedon10 \slink18 \slocked 
\styrsid14450383 Footer Char;}}{\*\rsidtbl 
\rsid1922796\rsid2437734\rsid4346699\rsid4392934\rsid5467240\rsid5720824\rsid6366418
+\rsid6843717\rsid7742502\rsid7807608\rsid7872863\rsid7957046\rsid8722154\rsid8811273\rsid9708480\rsid9904672\rsid10167906\rsid11299441\rsid12799272\rsid13922319\rsid14183170\rsid14450383\rsid14632381\rsid14900426\rsid15207980\rsid15864162\rsid16002556

[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sw/qa sw/source writerfilter/source

2022-08-04 Thread Vasily Melenchuk (via logerrit)
 sw/qa/extras/odfexport/odfexport.cxx  |6 +-
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx|4 -
 sw/source/core/doc/doclay.cxx |   11 +++-
 sw/source/core/doc/textboxhelper.cxx  |6 +-
 sw/source/core/unocore/unotext.cxx|   21 +++--
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   49 +++---
 writerfilter/source/dmapper/GraphicImport.cxx |   11 ++--
 7 files changed, 63 insertions(+), 45 deletions(-)

New commits:
commit d0a8f6857e93f1f4a26f05615618ff733bfb4851
Author: Vasily Melenchuk 
AuthorDate: Mon Dec 27 13:54:23 2021 +0300
Commit: Thorsten Behrens 
CommitDate: Fri Aug 5 01:26:20 2022 +0200

tdf#143703 sw: always assign name for fly section

Previously generated name was assigned only if not in doc
reading mode. But there is no guarantee that it will be assigned
later. Better to insert any name in SwDoc::MakeFlySection_() and
later it can be overwritten, but fly will definitely have
any unique name.

* Some test failed because GraphicImport_Impl::applyName() overwrote the
  name with a different generated one.

* This breaks chaining of VML shapes, see test testTDF87348.

  The code introduced in commit 091fe76b6329b4bb974987554369cbfadd8f2401
  in DomainMapper_Impl::ChainTextFrames() breaks if the text frame
  already has a name; it's a bit confusing which names there come from
  the file and which come from the API, and it also mixes 2 different
  cases of VML chaining and DrawingML chaining that look like they
  should be using different data.

* This also breaks moving flys anchored at-char in flys into them in
  SwXText::convertToTextFrame(), see ooxmlexport13 testFlyInFly.

  This kind of worked by accident before: the fly is copied and then the
  original deleted, keeping the same name (with help of
  SwDoc::mbCopyIsMove); with no name it would compare the SdrObject
  pointer, which is different for the new copy, now the name is the
  same.

  Fix this by only moving flys anchored at the edge of the selection
  back inoto the body; it turns out that Word actually supports at-char
  anchors in text frames, but only if it's a VML shape or Compatibility
  Mode or whatever; i wasn't able to do it in a document created from
  scratch.

  This is a bit tricky to ignore the nodes added for floating tables as
  seen in ooxmlexport10 testFloatingTablesAnchor.

* Another change is required in SwDoc::SetFlyName() because of
  testTdf127732, as it would rename a frame named "Frame1" to "Frame2"
  when called to rename it to "Frame1".

* Some tests failed because after MakeFlySection_() assigns a name it is
  immediately unconditionally overwritten; replace that with asserts

Change-Id: I46752a4413ba3a9e981eccd1e153b3aaf8053781
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127556
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 4d6243693c228703394c00164276f8326447beb9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137762
Reviewed-by: Thorsten Behrens 

diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index e58b772b8cdf..3fb14b220c69 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -936,7 +936,7 @@ DECLARE_ODFEXPORT_TEST(testTdf134987, "tdf134987.docx")
 OUString aMediaType;
 // checking first object (formula)
 {
-uno::Reference 
xEOSupplier(xAccess->getByName("1"), uno::UNO_QUERY);
+uno::Reference 
xEOSupplier(xAccess->getByName("Object1"), uno::UNO_QUERY);
 uno::Reference 
xObj(xEOSupplier->getEmbeddedObject());
 CPPUNIT_ASSERT(xObj.is());
 
@@ -950,7 +950,7 @@ DECLARE_ODFEXPORT_TEST(testTdf134987, "tdf134987.docx")
 }
 // checking second object (chart)
 {
-uno::Reference 
xEOSupplier(xAccess->getByName("2"), uno::UNO_QUERY);
+uno::Reference 
xEOSupplier(xAccess->getByName("Object2"), uno::UNO_QUERY);
 uno::Reference 
xObj(xEOSupplier->getEmbeddedObject());
 CPPUNIT_ASSERT(xObj.is());
 
@@ -964,7 +964,7 @@ DECLARE_ODFEXPORT_TEST(testTdf134987, "tdf134987.docx")
 }
 // checking third object (chart)
 {
-uno::Reference 
xEOSupplier(xAccess->getByName("3"), uno::UNO_QUERY);
+uno::Reference 
xEOSupplier(xAccess->getByName("Object3"), uno::UNO_QUERY);
 uno::Reference 
xObj(xEOSupplier->getEmbeddedObject());
 CPPUNIT_ASSERT(xObj.is());
 
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index b97b6c241093..51634dcd8a00 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -41,11 +41,11 @@ DECLARE_SW_EXPORT_TEST(testFlyInFly,