[Libreoffice-commits] .: sw/qa

Miklos Vajna vmiklos at kemper.freedesktop.org
Thu Jul 26 07:16:59 PDT 2012


 sw/qa/extras/rtfexport/data/math-escaping.rtf |   12 ++++++++++++
 sw/qa/extras/rtfexport/rtfexport.cxx          |   16 +++++++++++++---
 2 files changed, 25 insertions(+), 3 deletions(-)

New commits:
commit e5e85f2987a27db7efb2b24039b5c1ddf3f5d90e
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu Jul 26 16:16:38 2012 +0200

    test RTF math export escaping
    
    Change-Id: Ib1303ddc8ea31cfea2d438eaf5986ea71aa32f15

diff --git a/sw/qa/extras/rtfexport/data/math-escaping.rtf b/sw/qa/extras/rtfexport/data/math-escaping.rtf
new file mode 100644
index 0000000..fc7dadb
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/math-escaping.rtf
@@ -0,0 +1,12 @@
+{\rtf1
+{\mmath
+{\*\moMathPara 
+{\*\moMath 
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid15614577 \loch\af34\dbch\af42\hich\f34 
+{\mr\mscr0\msty2 \'e1\{}
+}
+}
+}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 2a9c7a1..f09de2b 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -51,12 +51,10 @@ public:
     void testFdo50831();
     void testFdo48335();
     void testFdo38244();
-    // No idea why does this fail with gcc-4.4, probably independent.
-#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || defined(__clang__))
     void testMathAccents();
     void testMathEqarray();
     void testMathD();
-#endif
+    void testMathEscaping();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -68,9 +66,13 @@ public:
     CPPUNIT_TEST(testFdo50831);
     CPPUNIT_TEST(testFdo48335);
     CPPUNIT_TEST(testFdo38244);
+    // No idea why does this fail with gcc-4.4, probably independent.
+#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || defined(__clang__))
     CPPUNIT_TEST(testMathAccents);
     CPPUNIT_TEST(testMathEqarray);
     CPPUNIT_TEST(testMathD);
+    CPPUNIT_TEST(testMathEscaping);
+#endif
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -235,6 +237,14 @@ void Test::testMathD()
     CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
 }
 
+void Test::testMathEscaping()
+{
+    roundtrip("math-escaping.rtf");
+    OUString aActual = getFormula(getRun(getParagraph(1), 1));
+    OUString aExpected("á \\{", 5, RTL_TEXTENCODING_UTF8);
+    CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list