diff options
Diffstat (limited to 'sw/qa/extras/rtfexport')
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf136445-1-min.rtf | 17 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf158409.rtf | 12 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf158586_pageBreak1_header.rtf | 17 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport3.cxx | 9 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport8.cxx | 56 |
5 files changed, 101 insertions, 10 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf136445-1-min.rtf b/sw/qa/extras/rtfexport/data/tdf136445-1-min.rtf new file mode 100644 index 0000000000..c0abd0d293 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf136445-1-min.rtf @@ -0,0 +1,17 @@ +{\rtf1 +{\*\listtable +{\list\listtemplateid8 +{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02E\'00;}{\levelnumbers\'02;}\fi-720\li720}\listid8} +} +{\listoverridetable{\listoverride\listid8\listoverridecount0\ls8}} + +\ltrpar \sectd +\pard\plain \ltrpar{\rtlch\hich \ltrch\loch +I ax xoixx xuxixx xxe xixxx. (Xaxxexx 1989 x.x. xaxax a)}{\rtlch\hich \ltrch\loch +{\*\atnid CL}{\*\atnauthor Christian}\chatn{\*\annotation{\*\atndate -947463118}\rtlch \ltrch\ltrpar\aspalpha\li0\ri0\lin0\rin0\fi0\sb0\sa0\sl240\slmult1\ql\loch{\rtlch\langfe2052\alang1081\dbch\dbch\ab0\ai0 \ltrch\loch\charscalex100\b0\ulnone\ulc0\strike0\i0\outl0\shad0\kerning1\expnd0\expndtw0\lang1033\accnone\scaps0\caps0\loch +sic!}}} +\par \pard\plain {\listtext\pard\plain E119\tab}\ilvl0\ls8 \li720\ri0\lin720\rin0\fi-720\ql\ltrpar{{\*\bkmkstart __RefNumPara__395941_134077278}{\*\bkmkend __RefNumPara__395941_134077278}\rtlch\hich \ltrch\loch +Xix\tab xaxa\tab x-a\tab \tab \tab xix\tab }{\rtlch\hich \ltrch\langfe0\dbch\loch\lang255\loch +x xi = xa.} +\par +} diff --git a/sw/qa/extras/rtfexport/data/tdf158409.rtf b/sw/qa/extras/rtfexport/data/tdf158409.rtf new file mode 100644 index 0000000000..a89a5ba95d --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf158409.rtf @@ -0,0 +1,12 @@ +{\rtf1
+{\info
+{\title DocTitle}
+}
+{\stylesheet
+{\ql\fs72 Normal;}
+}
+
+\pard\fs16 {\field{\*\fldinst TITLE}}\par
+\pard\fs72 {\rtfch\fs16{\field{\*\fldinst TITLE}}}\par
+
+}
diff --git a/sw/qa/extras/rtfexport/data/tdf158586_pageBreak1_header.rtf b/sw/qa/extras/rtfexport/data/tdf158586_pageBreak1_header.rtf new file mode 100644 index 0000000000..cd8eefabb2 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf158586_pageBreak1_header.rtf @@ -0,0 +1,17 @@ +{\rtf1
+
+\paperw8419\paperh5953
+
+\spltpgpar
+
+\ltrpar \sectd
+
+{\headerl \pard\plain \par}
+
+\pard\plain \wrapdefault\pvmrg\posxl\absw0\absh0\phcol \posyil\abslock\dxfrtext10
+
+\page \sect \sectd \sbknone
+
+\pard\plain Second page
+\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 435242308a..fd25e7e575 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -707,6 +707,15 @@ CPPUNIT_TEST_FIXTURE(Test, testFloattableOverlapNeverRTFExport) CPPUNIT_ASSERT(!pFly->GetAttrSet().GetWrapInfluenceOnObjPos().GetAllowOverlap()); } +DECLARE_RTFEXPORT_TEST(testTdf158409, "tdf158409.rtf") +{ + uno::Reference<text::XTextRange> xRun = getRun(getParagraph(1), 1, "DocTitle"); + CPPUNIT_ASSERT_EQUAL(8.0, getProperty<double>(xRun, "CharHeight")); + + xRun = getRun(getParagraph(2), 1, "DocTitle"); + CPPUNIT_ASSERT_EQUAL(8.0, getProperty<double>(xRun, "CharHeight")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/rtfexport/rtfexport8.cxx b/sw/qa/extras/rtfexport/rtfexport8.cxx index 67d48a27dc..08ca8452f9 100644 --- a/sw/qa/extras/rtfexport/rtfexport8.cxx +++ b/sw/qa/extras/rtfexport/rtfexport8.cxx @@ -52,28 +52,50 @@ DECLARE_RTFEXPORT_TEST(testTdf158586_0, "tdf158586_pageBreak0.rtf") { // The specified page break must be lost because it is in a text frame CPPUNIT_ASSERT_EQUAL(1, getPages()); - // CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); + CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); - // There should be no empty carriage return at the start of the second page - // const auto& pLayout = parseLayoutDump(); - // assertXPathContent(pLayout, "//page[1]/body/txt"_ostr, "First page");} + // There should be no empty paragraph at the start + const auto& pLayout = parseLayoutDump(); + assertXPath(pLayout, "//anchored"_ostr, 1); + assertXPathContent(pLayout, "/root/page[1]/body//txt"_ostr, "First page"); } DECLARE_RTFEXPORT_TEST(testTdf158586_0B, "tdf158586_pageBreak0B.rtf") { // The specified page break must be lost because it is in a text frame CPPUNIT_ASSERT_EQUAL(1, getPages()); + CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); + + // There should be no empty paragraph at the start + const auto& pLayout = parseLayoutDump(); + assertXPath(pLayout, "//anchored"_ostr, 1); + assertXPathContent(pLayout, "/root/page[1]/body//txt"_ostr, "First page"); } DECLARE_RTFEXPORT_TEST(testTdf158586_1, "tdf158586_pageBreak1.rtf") { // None of the specified text frame settings initiates a real text frame - page break not lost - // CPPUNIT_ASSERT_EQUAL(2, getPages()); - // CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); + CPPUNIT_ASSERT_EQUAL(2, getPages()); + CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); + + // There should be no empty carriage return at the start of the second page + const auto& pLayout = parseLayoutDump(); + // on import there is a section on page 2; on reimport there is no section + // (probably not an important difference?) + assertXPathContent(pLayout, "/root/page[2]/body//txt"_ostr, "Second page"); +} + +DECLARE_RTFEXPORT_TEST(testTdf158586_1header, "tdf158586_pageBreak1_header.rtf") +{ + // None of the specified text frame settings initiates a real text frame - page break not lost + CPPUNIT_ASSERT_EQUAL(2, getPages()); + CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); // There should be no empty carriage return at the start of the second page - // const auto& pLayout = parseLayoutDump(); - // assertXPathContent(pLayout, "//page[2]/body/txt"_ostr, "Second page"); + const auto& pLayout = parseLayoutDump(); + // on import there is a section on page 2; on reimport there is no section + // (probably not an important difference?) + assertXPathContent(pLayout, "/root/page[2]/body//txt"_ostr, "Second page"); } DECLARE_RTFEXPORT_TEST(testTdf158586_lostFrame, "tdf158586_lostFrame.rtf") @@ -82,9 +104,23 @@ DECLARE_RTFEXPORT_TEST(testTdf158586_lostFrame, "tdf158586_lostFrame.rtf") const auto& pLayout = parseLayoutDump(); assertXPath(pLayout, "//anchored"_ostr, 1); assertXPathContent(pLayout, "//page[1]/body//txt"_ostr, "1st page"); - // assertXPathContent(pLayout, "//page[2]/body//txt"_ostr, "2nd page"); + assertXPathContent(pLayout, "//page[2]/body//txt"_ostr, "2nd page"); - // CPPUNIT_ASSERT_EQUAL(2, getPages()); + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_RTFEXPORT_TEST(testAnnotationPar, "tdf136445-1-min.rtf") +{ + // the problem was that the paragraph break following annotation was missing + CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); + CPPUNIT_ASSERT_EQUAL( + OUString("Annotation"), + getProperty<OUString>( + getRun(getParagraph(1, "I ax xoixx xuxixx xxe xixxx. (Xaxxexx 1989 x.x. xaxax a)"), 2), + "TextPortionType")); + CPPUNIT_ASSERT( + !getProperty<OUString>(getParagraph(2, "Xix\txaxa\tx-a\t\t\txix\tx xi = xa."), "ListId") + .isEmpty()); } DECLARE_RTFEXPORT_TEST(testTdf158826_extraCR, "tdf158826_extraCR.rtf") |