[Libreoffice-commits] core.git: sw/qa

Serge Krot Serge.Krot at cib.de
Wed Nov 1 08:43:55 UTC 2017


 sw/qa/extras/rtfexport/rtfexport2.cxx |   60 +++++++++++++++++-----------------
 1 file changed, 30 insertions(+), 30 deletions(-)

New commits:
commit 508797b6734d0798f5ea903bf6fb516b58780e4e
Author: Serge Krot <Serge.Krot at cib.de>
Date:   Tue Oct 31 23:23:37 2017 +0100

    sw: enable rtf export tests also for Win32
    
    * seems they work fine
    * also one unit test was enhanced
    
    Change-Id: Id5de81460c1bff9afb648a6c7a940f2bdec938b1
    Reviewed-on: https://gerrit.libreoffice.org/44141
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx
index d9a4e9995bd2..7746cec31862 100644
--- a/sw/qa/extras/rtfexport/rtfexport2.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport2.cxx
@@ -111,8 +111,6 @@ protected:
     AllSettings m_aSavedSettings;
 };
 
-#if !defined(_WIN32)
-
 DECLARE_RTFEXPORT_TEST(testFdo45553, "fdo45553.rtf")
 {
     uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
@@ -604,6 +602,8 @@ DECLARE_RTFEXPORT_TEST(testCopyPastePageStyle, "copypaste-pagestyle.rtf")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(21001), getProperty<sal_Int32>(xPropertySet, "Width")); // Was letter, i.e. 21590
 }
 
+#if !defined(_WIN32)
+
 DECLARE_RTFEXPORT_TEST(testCopyPasteFootnote, "copypaste-footnote.rtf")
 {
     // The RTF import did not handle the case when the position wasn't the main document XText, but something different, e.g. a footnote.
@@ -615,6 +615,33 @@ DECLARE_RTFEXPORT_TEST(testCopyPasteFootnote, "copypaste-footnote.rtf")
     CPPUNIT_ASSERT_EQUAL(OUString("bbb"), xTextRange->getString());
 }
 
+DECLARE_RTFEXPORT_TEST(testFdo63428, "hello.rtf")
+{
+    // Pasting content that contained an annotation caused a crash.
+    uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+    uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY);
+    uno::Reference<text::XTextRange> xEnd = xText->getEnd();
+    paste("fdo63428.rtf", xEnd);
+
+    // Additionally, commented range was imported as a normal comment.
+    CPPUNIT_ASSERT_EQUAL(OUString("Annotation"), getProperty<OUString>(getRun(getParagraph(1), 2), "TextPortionType"));
+    CPPUNIT_ASSERT_EQUAL(OUString("AnnotationEnd"), getProperty<OUString>(getRun(getParagraph(1), 4), "TextPortionType"));
+}
+
+DECLARE_RTFEXPORT_TEST(testFdo69384, "hello.rtf")
+{
+    uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+    uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY);
+    uno::Reference<text::XTextRange> xEnd = xText->getEnd();
+    paste("fdo69384-paste.rtf", xEnd);
+
+    // Import got interrupted in the middle of style sheet table import,
+    // resulting in missing styles and text.
+    getStyles("ParagraphStyles")->getByName("Text body justified");
+}
+
+#endif
+
 DECLARE_RTFEXPORT_TEST(testFdo61193, "hello.rtf")
 {
     // Pasting content that contained a footnote caused a crash.
@@ -1087,19 +1114,6 @@ DECLARE_RTFEXPORT_TEST(testFdo67498, "fdo67498.rtf")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(5954)), getProperty<sal_Int32>(getStyles("PageStyles")->getByName("Standard"), "LeftMargin"));
 }
 
-DECLARE_RTFEXPORT_TEST(testFdo63428, "hello.rtf")
-{
-    // Pasting content that contained an annotation caused a crash.
-    uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
-    uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY);
-    uno::Reference<text::XTextRange> xEnd = xText->getEnd();
-    paste("fdo63428.rtf", xEnd);
-
-    // Additionally, commented range was imported as a normal comment.
-    CPPUNIT_ASSERT_EQUAL(OUString("Annotation"), getProperty<OUString>(getRun(getParagraph(1), 2), "TextPortionType"));
-    CPPUNIT_ASSERT_EQUAL(OUString("AnnotationEnd"), getProperty<OUString>(getRun(getParagraph(1), 4), "TextPortionType"));
-}
-
 DECLARE_RTFEXPORT_TEST(testFdo44715, "fdo44715.rtf")
 {
     uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY);
@@ -1115,18 +1129,6 @@ DECLARE_RTFEXPORT_TEST(testFdo68076, "fdo68076.rtf")
     getParagraph(1, aExpected);
 }
 
-DECLARE_RTFEXPORT_TEST(testFdo69384, "hello.rtf")
-{
-    uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
-    uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY);
-    uno::Reference<text::XTextRange> xEnd = xText->getEnd();
-    paste("fdo69384-paste.rtf", xEnd);
-
-    // Import got interrupted in the middle of style sheet table import,
-    // resulting in missing styles and text.
-    getStyles("ParagraphStyles")->getByName("Text body justified");
-}
-
 DECLARE_RTFEXPORT_TEST(testFdo70221, "fdo70221.rtf")
 {
     uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
@@ -1142,10 +1144,8 @@ DECLARE_RTFEXPORT_TEST(testCp1000018, "cp1000018.rtf")
     uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY);
     uno::Reference<container::XIndexAccess> xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY);
     uno::Reference<text::XTextRange> xTextRange(xFootnotes->getByIndex(0), uno::UNO_QUERY);
-    OUString const aExpected("Footnote first line.\n");
-    CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString());
+    CPPUNIT_ASSERT(xTextRange->getString().startsWithIgnoreAsciiCase("Footnote first line"));
 }
-#endif
 
 DECLARE_RTFEXPORT_TEST(testFdo94835, "fdo94835.rtf")
 {


More information about the Libreoffice-commits mailing list