summaryrefslogtreecommitdiffstats
path: root/starmath/qa
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2016-11-27 02:55:15 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2016-11-29 01:04:08 +0000
commit2bad9f1cd8da0cd3d8ff33e875eaf10c1fd9d0bf (patch)
tree2183236d12fdf71d43cc98dfee404450c06289c9 /starmath/qa
parenttdf#101870 - Template manager thumbnail view control needs a border (diff)
downloadcore-2bad9f1cd8da0cd3d8ff33e875eaf10c1fd9d0bf.tar.gz
core-2bad9f1cd8da0cd3d8ff33e875eaf10c1fd9d0bf.zip
tdf#103430 Apply mathvariant attribute to <mi> and <mo>
by emulating it with SmFontNode. In case of <mo>, current implementation supports only the one named with an alphabet. Change-Id: I827a7e80f5aa94e243098a6e50eb758cf915c282 Reviewed-on: https://gerrit.libreoffice.org/31240 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath/qa')
-rw-r--r--starmath/qa/extras/data/tdf103430.mml15
-rw-r--r--starmath/qa/extras/mmlimport-test.cxx11
2 files changed, 25 insertions, 1 deletions
diff --git a/starmath/qa/extras/data/tdf103430.mml b/starmath/qa/extras/data/tdf103430.mml
new file mode 100644
index 000000000000..92fba05dc295
--- /dev/null
+++ b/starmath/qa/extras/data/tdf103430.mml
@@ -0,0 +1,15 @@
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mfrac>
+ <mrow>
+ <msup>
+ <mo form="prefix" rspace="0">d</mo>
+ <mn>2</mn>
+ </msup>
+ <mi mathvariant="normal" mathcolor="blue">y</mi>
+ </mrow>
+ <mrow>
+ <mo fontstyle="italic" fontweight="bold" mathvariant="normal" form="prefix" rspace="0">d</mo>
+ <mi fontfamily="serif" mathvariant="sans-serif-bold-italic" mathcolor="red">x</mi>
+ </mrow>
+ </mfrac>
+</math>
diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx
index 3db697f1f849..01ae2ffaaec7 100644
--- a/starmath/qa/extras/mmlimport-test.cxx
+++ b/starmath/qa/extras/mmlimport-test.cxx
@@ -34,6 +34,7 @@ public:
void testMaction();
void testMspace();
void testtdf99556();
+ void testTdf103430();
void testTdf103500();
CPPUNIT_TEST_SUITE(Test);
@@ -42,6 +43,7 @@ public:
CPPUNIT_TEST(testMaction);
CPPUNIT_TEST(testMspace);
CPPUNIT_TEST(testtdf99556);
+ CPPUNIT_TEST(testTdf103430);
CPPUNIT_TEST(testTdf103500);
CPPUNIT_TEST_SUITE_END();
@@ -122,10 +124,17 @@ void Test::testtdf99556()
CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", sExpected, mxDocShell->GetText());
}
+void Test::testTdf103430()
+{
+ loadURL(m_directories.getURLFromSrc("starmath/qa/extras/data/tdf103430.mml"));
+ CPPUNIT_ASSERT_EQUAL(OUString("{{nitalic d}^2 {nitalic {color blue y}}} over {{nitalic d} {font sans {bold {italic {color red x}}}}}"),
+ mxDocShell->GetText());
+}
+
void Test::testTdf103500()
{
loadURL(m_directories.getURLFromSrc("starmath/qa/extras/data/tdf103500.mml"));
- CPPUNIT_ASSERT_EQUAL(OUString("{{ int csub a csup b {1 over x ` d x}} = {intd csub a csup b {1 over y ` d y}}}"),
+ CPPUNIT_ASSERT_EQUAL(OUString("{{ int csub a csup b {1 over x ` {nitalic d} x}} = {intd csub a csup b {1 over y ` {nitalic d} y}}}"),
mxDocShell->GetText());
}