summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2016-11-18 17:10:44 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2016-11-19 07:51:01 +0000
commitf533b3f39956fe8028c1f7f7cc3c37b0feed8b57 (patch)
treeafd74ebba51549da7871c81ff20bb33622e3eee0
parent8d613870b2cd2e3e4396b4fa97dbd8080fda8f52 (diff)
tdf#103500 Import stretchy integral symbol from MathML
as "intd". Change-Id: Ic8a4feef7a3a19c8ed5bca2f09f80901e2b6d343 Reviewed-on: https://gerrit.libreoffice.org/30953 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
-rw-r--r--starmath/qa/extras/data/tdf103500.mml41
-rw-r--r--starmath/qa/extras/mmlimport-test.cxx9
-rw-r--r--starmath/source/node.cxx6
3 files changed, 55 insertions, 1 deletions
diff --git a/starmath/qa/extras/data/tdf103500.mml b/starmath/qa/extras/data/tdf103500.mml
new file mode 100644
index 000000000000..7c4966985918
--- /dev/null
+++ b/starmath/qa/extras/data/tdf103500.mml
@@ -0,0 +1,41 @@
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mrow>
+ <mrow>
+ <munderover>
+ <mo stretchy="false">∫</mo>
+ <mi>a</mi>
+ <mi>b</mi>
+ </munderover>
+ <mrow>
+ <mfrac>
+ <mn>1</mn>
+ <mi>x</mi>
+ </mfrac>
+ <mspace width="0.5em"/>
+ <mstyle mathvariant="normal">
+ <mi mathvariant="normal">d</mi>
+ </mstyle>
+ <mi>x</mi>
+ </mrow>
+ </mrow>
+ <mo stretchy="false">=</mo>
+ <mrow>
+ <munderover>
+ <mo stretchy="true">∫</mo>
+ <mi>a</mi>
+ <mi>b</mi>
+ </munderover>
+ <mrow>
+ <mfrac>
+ <mn>1</mn>
+ <mi>y</mi>
+ </mfrac>
+ <mspace width="0.5em"/>
+ <mstyle mathvariant="normal">
+ <mi mathvariant="normal">d</mi>
+ </mstyle>
+ <mi>y</mi>
+ </mrow>
+ </mrow>
+ </mrow>
+</math>
diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx
index 9bbc08ae39a9..3db697f1f849 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 testTdf103500();
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testSimple);
@@ -41,6 +42,7 @@ public:
CPPUNIT_TEST(testMaction);
CPPUNIT_TEST(testMspace);
CPPUNIT_TEST(testtdf99556);
+ CPPUNIT_TEST(testTdf103500);
CPPUNIT_TEST_SUITE_END();
private:
@@ -120,6 +122,13 @@ void Test::testtdf99556()
CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", sExpected, 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}}}"),
+ mxDocShell->GetText());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 3db53a948155..fe84e556898c 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -2447,7 +2447,11 @@ void SmMathSymbolNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
void SmMathSymbolNode::CreateTextFromNode(OUString &rText)
{
OUString sStr;
- MathType::LookupChar(GetToken().cMathChar, sStr, 3);
+ sal_Unicode cChar = GetToken().cMathChar;
+ if (cChar == MS_INT && GetScaleMode() == SCALE_HEIGHT)
+ sStr = "intd ";
+ else
+ MathType::LookupChar(cChar, sStr, 3);
rText += sStr;
}