diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2015-08-09 23:08:28 +0900 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-08-11 13:28:54 +0000 |
commit | 9fbf4fd5292f6a3c28a092f7bb02541ceb61351f (patch) | |
tree | 6b0d16ede3e00899e29103f308af0aac2c7d988b /starmath | |
parent | 78446df26f45e2a71187873726388c9d2f6ba6e5 (diff) |
Related: tdf#75171 wrong "italic" happens on importing MathML
As of 4f294a90877d2f91bb88c7d6cd5b74e8e546a025, a SmTextNode can be
the sole child of a SmLineNode without being wrapped in a SmExpressionNode.
Change-Id: I3779eb90e216a70566c1151a9b8cb91a9fa36519
Reviewed-on: https://gerrit.libreoffice.org/17613
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/qa/extras/mmlimport-test.cxx | 6 | ||||
-rw-r--r-- | starmath/source/node.cxx | 9 |
2 files changed, 5 insertions, 10 deletions
diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx index 3effb31a2823..d0cccd782102 100644 --- a/starmath/qa/extras/mmlimport-test.cxx +++ b/starmath/qa/extras/mmlimport-test.cxx @@ -85,21 +85,21 @@ void Test::tearDown() void Test::testSimple() { loadURL(getURLFromSrc("starmath/qa/extras/data/simple.mml")); - OUString sExpected("left ( {italic \"a\" + italic \"b\"} right )^italic \"2\""); + OUString sExpected("left ( {a + b} right )^2"); CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", sExpected, mxDocShell->GetText()); } void Test::testNsPrefixMath() { loadURL(getURLFromSrc("starmath/qa/extras/data/ns-prefix-math.mml")); - OUString sExpected("left ( {italic \"a\" + italic \"b\"} right )^italic \"2\""); + OUString sExpected("left ( {a + b} right )^2"); CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", sExpected, mxDocShell->GetText()); } void Test::testMaction() { loadURL(getURLFromSrc("starmath/qa/extras/data/maction.mml")); - OUString sExpected("matrix {italic \"1\" ## italic \"2\" ## italic \"3\"}"); + OUString sExpected("matrix {1 ## 2 ## 3}"); CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", sExpected, mxDocShell->GetText()); } diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 9e6681010e51..f8a7ae1a25ce 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -2367,13 +2367,8 @@ void SmTextNode::CreateTextFromNode(OUString &rText) (pResult->GetNumSubNodes() == 1) ) { pResult = pResult->GetSubNode(0); - if ( (pResult->GetType() == NEXPRESSION) && - (pResult->GetNumSubNodes() == 1) ) - { - pResult = pResult->GetSubNode(0); - if (pResult->GetType() == NTEXT) - bQuoted=false; - } + if (pResult->GetType() == NTEXT) + bQuoted=false; } } delete pTable; |