diff options
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/rtfexport/data/math-escaping.rtf | 12 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 16 |
2 files changed, 25 insertions, 3 deletions
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 000000000000..fc7dadbb0517 --- /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 2a9c7a17ee99..f09de2b8789f 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(); |