[Libreoffice-commits] .: sw/qa

Miklos Vajna vmiklos at kemper.freedesktop.org
Thu Jul 26 07:09:40 PDT 2012


 sw/qa/extras/rtfexport/data/math-d.rtf |  170 +++++++++++++++++++++++++++++++++
 sw/qa/extras/rtfexport/rtfexport.cxx   |   13 ++
 2 files changed, 183 insertions(+)

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

    test RTF_MD
    
    Change-Id: Ib41b2599d843a5a0840f05e79a310afab42cd7cd

diff --git a/sw/qa/extras/rtfexport/data/math-d.rtf b/sw/qa/extras/rtfexport/data/math-d.rtf
new file mode 100644
index 0000000..e1e67f4
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/math-d.rtf
@@ -0,0 +1,170 @@
+{\rtf1
+{\mmath
+{\*\moMathPara 
+{\*\moMath 
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+{\md
+{\mdPr
+{\mctrlPr\f34 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 
+\i\f34\insrsid1140831 \hich\af34\dbch\af42\loch\f34 
+{\mr\mscr0\msty2 x}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid1140831 \hich\af34\dbch\af42\loch\f34 
+{\mr\mscr0\msty2 y}
+}
+{\rtlch\fcs1 \af1 
+\ltrch\fcs0 \f34\insrsid1140831 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid1140831 \hich\af34\dbch\af42\loch\f34 
+{\mr\mscr0\msty2 z}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+{\md
+{\mdPr
+{\mctrlPr\f34 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid1140831 \hich\af34\dbch\af42\loch\f34 
+{\mr\mscr0\msty2 1}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+{\md
+{\mdPr
+{\mbegChr [}
+{\mendChr ]}
+{\mctrlPr\f34 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid1140831 \hich\af34\dbch\af42\loch\f34 
+{\mr\mscr0\msty2 2}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+{\md
+{\mdPr
+{\mbegChr \u10214 ?}
+{\mendChr \u10215 ?}
+{\mctrlPr\f34 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid1140831 \hich\af34\dbch\af42\loch\f34 
+{\mr\mscr0\msty2 3}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 
+\f34\insrsid1140831 }
+{\md
+{\mdPr
+{\mbegChr |}
+{\mendChr |}
+{\mctrlPr\f34 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid1140831 \hich\af34\dbch\af42\loch\f34 
+{\mr\mscr0\msty2 4}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+}
+}
+{\rtlch\fcs1 \af1 
+\ltrch\fcs0 \f34\insrsid1140831 }
+{\md
+{\mdPr
+{\mbegChr \u8741 ?}
+{\mendChr \u8741 ?}
+{\mctrlPr\f34 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid1140831 \hich\af34\dbch\af42\loch\f34 
+{\mr\mscr0\msty2 5}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+{\md
+{\mdPr
+{\mbegChr \u9001 <}
+{\mendChr \u9002 >}
+{\mctrlPr\f34 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid1140831 \hich\af34\dbch\af42\loch\f34 
+{\mr\mscr0\msty2 6}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 
+\f34\insrsid1140831 }
+}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+{\md
+{\mdPr
+{\mbegChr \u9001 <}
+{\mendChr \u9002 >}
+{\mctrlPr\f34 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid1140831 \hich\af34\dbch\af42\loch\f34 
+{\mr\mscr0\msty2 a}
+}
+{
+\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid1140831 \hich\af34\dbch\af42\loch\f34 
+{\mr\mscr0\msty2 b}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 
+\f34\insrsid1140831 }
+{\md
+{\mdPr
+{\mctrlPr\f34 }
+}
+{\me
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+{\mf
+{\mfPr
+{\mctrlPr\f34 }
+}
+{\mnum
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid1140831 \hich\af34\dbch\af42\loch\f34 
+{\mr\mscr0\msty2 x}
+}
+{\rtlch\fcs1 \af1 
+\ltrch\fcs0 \f34\insrsid1140831 }
+}
+{\mden
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \i\f34\insrsid1140831 \hich\af34\dbch\af42\loch\f34 
+{\mr\mscr0\msty2 y}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+}
+}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f34\insrsid1140831 }
+}
+}
+}
+}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 64950a6..2a9c7a1 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -51,8 +51,12 @@ 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
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -66,6 +70,7 @@ public:
     CPPUNIT_TEST(testFdo38244);
     CPPUNIT_TEST(testMathAccents);
     CPPUNIT_TEST(testMathEqarray);
+    CPPUNIT_TEST(testMathD);
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -222,6 +227,14 @@ void Test::testMathEqarray()
     CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
 }
 
+void Test::testMathD()
+{
+    roundtrip("math-d.rtf");
+    OUString aActual = getFormula(getRun(getParagraph(1), 1));
+    OUString aExpected("left (x mline y mline z right ) left (1 right ) left [2 right ] left ldbracket 3 right rdbracket left lline 4 right rline left ldline 5 right rdline left langle 6 right rangle left langle a mline b right rangle left ({x} over {y} right )");
+    CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list