diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-07-27 10:00:30 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-07-27 11:54:56 +0200 |
commit | 8182f7d393bc60c693a1c509b3e8edcc87484968 (patch) | |
tree | e050b12c837142307f49337c6d23066bf86a057e | |
parent | Improved check for winegcc. (diff) | |
download | core-8182f7d393bc60c693a1c509b3e8edcc87484968.tar.gz core-8182f7d393bc60c693a1c509b3e8edcc87484968.zip |
test RTF_M{NARY,LIMUPP,STRIKEH}
Change-Id: I612fbc2064dead58786fbe77597ca677f6703eb7
-rw-r--r-- | sw/qa/extras/rtfexport/data/math-limupp.rtf | 77 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/math-nary.rtf | 87 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/math-strikeh.rtf | 26 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 31 |
4 files changed, 221 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/math-limupp.rtf b/sw/qa/extras/rtfexport/data/math-limupp.rtf new file mode 100644 index 000000000000..30ebe1c820bc --- /dev/null +++ b/sw/qa/extras/rtfexport/data/math-limupp.rtf @@ -0,0 +1,77 @@ +{\rtf1
+{\mmath
+{\*\moMathPara
+{\*\moMath
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid7036055 }
+{\mlimUpp
+{\mlimUppPr
+{\mctrlPr\f34 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0
+\f34\insrsid7036055 }
+{\mgroupChr
+{\mgroupChrPr
+{\mchr \u9182 ?}
+{\mpos top}
+{\mvertJc bot}
+{\mctrlPr\f34 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid7036055 \hich\af34\dbch\af42\loch\f34
+{\mr\mscr0\msty2 abcd}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0
+\f34\insrsid7036055 }
+}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid7036055 }
+}
+{\mlim
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid7036055 \hich\af34\dbch\af42\loch\f34
+{\mr\mscr0\msty2 4}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid7036055 }
+}
+}
+}
+}
+}
+\par
+{\mmath
+{\*\moMathPara
+{\*\moMath
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid7036055 }
+{\mlimLow
+{\mlimLowPr
+{\mctrlPr\f34 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid7036055 }
+{\mgroupChr
+{\mgroupChrPr
+{\mctrlPr\f34 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0
+\i\f34\insrsid7036055 \hich\af34\dbch\af42\loch\f34
+{\mr\mscr0\msty2 xyz}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid7036055 }
+}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid7036055 }
+}
+{\mlim
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid7036055
+\hich\af34\dbch\af42\loch\f34
+{\mr\mscr0\msty2 3}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid7036055 }
+}
+}
+}
+}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfexport/data/math-nary.rtf b/sw/qa/extras/rtfexport/data/math-nary.rtf new file mode 100644 index 000000000000..e428e540db7c --- /dev/null +++ b/sw/qa/extras/rtfexport/data/math-nary.rtf @@ -0,0 +1,87 @@ +{\rtf1
+{\mmath
+{\*\moMathPara
+{\*\moMath
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid8470899 }
+{\mnary
+{\mnaryPr
+{\mchr \u8752 ?}
+{\mctrlPr\f34 }
+}
+{\msub
+{\rtlch\fcs1 \af1
+\ltrch\fcs0 \i\f34\insrsid8470899 \hich\af34\dbch\af42\loch\f34
+{\mr\mscr0\msty2 1}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid8470899 }
+}
+{\msup
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid8470899 \hich\af34\dbch\af42\loch\f34
+{\mr\mscr0\msty2 2}
+}
+{
+\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid8470899 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid8470899 \hich\af34\dbch\af42\loch\f34
+{\mr\mscr0\msty2 x}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid8470899 \hich\af34\dbch\af42\loch\f34
+{\mr\mscr0\msty2 +1}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid8470899 }
+}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid8470899 }
+{\mnary
+{\mnaryPr
+{\mchr \u8719 ?}
+{\msupHide on}
+{\mctrlPr\f34 }
+}
+{\msub
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid8470899
+\hich\af34\dbch\af42\loch\f34
+{\mr\mscr0\msty2 a}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid8470899 }
+}
+{\msup
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid8470899 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid8470899 \hich\af34\dbch\af42\loch\f34
+{\mr\mscr0\msty2 b}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid8470899 }
+}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid8470899 }
+{\mnary
+{\mnaryPr
+{\mchr \u8721 ?}
+{\msubHide on}
+{\mctrlPr\f34 }
+}
+{\msub
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid8470899 }
+}
+{\msup
+{
+\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid8470899 \hich\af34\dbch\af42\loch\f34
+{\mr\mscr0\msty2 2}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid8470899 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid8470899 \hich\af34\dbch\af42\loch\f34
+{\mr\mscr0\msty2 x}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid8470899 }
+}
+}
+}
+}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfexport/data/math-strikeh.rtf b/sw/qa/extras/rtfexport/data/math-strikeh.rtf new file mode 100644 index 000000000000..b09e1fdd01e3 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/math-strikeh.rtf @@ -0,0 +1,26 @@ +{\rtf1
+{\mmath
+{\*\moMathPara
+{\*\moMath
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid15277751 }
+{\mborderBox
+{\mborderBoxPr
+{\mhideTop on}
+{\mhideBot on}
+{\mhideLeft on}
+{\mhideRight on}
+{\mstrikeH on}
+{\mctrlPr\f34 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid15277751 \hich\af34\dbch\af42\loch\f34
+{\mr\mscr0\msty2 abc}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid15277751 }
+}
+}
+}
+}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 5e119fd461a6..443b5866e8f4 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -59,6 +59,9 @@ public: void testMathMatrix(); void testMathBox(); void testMathMso2007(); + void testMathNary(); + void testMathLimupp(); + void testMathStrikeh(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -80,6 +83,9 @@ public: CPPUNIT_TEST(testMathMatrix); CPPUNIT_TEST(testMathBox); CPPUNIT_TEST(testMathMso2007); + CPPUNIT_TEST(testMathNary); + CPPUNIT_TEST(testMathLimupp); + CPPUNIT_TEST(testMathStrikeh); #endif #endif CPPUNIT_TEST_SUITE_END(); @@ -318,6 +324,31 @@ void Test::testMathMso2007() CPPUNIT_ASSERT_EQUAL(aExpected, aActual); } +void Test::testMathNary() +{ + roundtrip("math-nary.rtf"); + OUString aActual = getFormula(getRun(getParagraph(1), 1)); + OUString aExpected("lllint from {1} to {2} {x + 1} prod from {a} {b} sum to {2} {x}"); + CPPUNIT_ASSERT_EQUAL(aExpected, aActual); +} + +void Test::testMathLimupp() +{ + roundtrip("math-limupp.rtf"); + OUString aActual = getFormula(getRun(getParagraph(1), 1)); + CPPUNIT_ASSERT_EQUAL(OUString("{abcd} overbrace {4}"), aActual); + + aActual = getFormula(getRun(getParagraph(2), 1)); + CPPUNIT_ASSERT_EQUAL(OUString("{xyz} underbrace {3}"), aActual); +} + +void Test::testMathStrikeh() +{ + roundtrip("math-strikeh.rtf"); + OUString aActual = getFormula(getRun(getParagraph(1), 1)); + CPPUNIT_ASSERT_EQUAL(OUString("overstrike {abc}"), aActual); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |