summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-05-13 13:03:55 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-05-13 13:20:55 +0100
commiteb2da27e0834925d449373593fb650db49671adf (patch)
tree74db0180dfbe22f400df3637790b74315c09ff70 /starmath
parentedbe07c75fb937a171a7a10c1ef703768e0e7f19 (diff)
Resolves: tdf#99556 if the num of arguments is not 1 infer a raw
not just if the num of arguments is > 1 Change-Id: If0cae16cc52685315708ac3b2b8456ede7c1a6ce
Diffstat (limited to 'starmath')
-rw-r--r--starmath/qa/extras/data/tdf99556-1.mml3
-rw-r--r--starmath/qa/extras/mmlimport-test.cxx10
-rw-r--r--starmath/source/mathmlimport.cxx10
3 files changed, 18 insertions, 5 deletions
diff --git a/starmath/qa/extras/data/tdf99556-1.mml b/starmath/qa/extras/data/tdf99556-1.mml
new file mode 100644
index 000000000000..0eae8b2df252
--- /dev/null
+++ b/starmath/qa/extras/data/tdf99556-1.mml
@@ -0,0 +1,3 @@
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+<msqrt/>
+</math>
diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx
index 6a81acf4ef70..f9f1405b5740 100644
--- a/starmath/qa/extras/mmlimport-test.cxx
+++ b/starmath/qa/extras/mmlimport-test.cxx
@@ -32,11 +32,13 @@ public:
void testSimple();
void testNsPrefixMath();
void testMaction();
+ void testtdf99556();
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testSimple);
CPPUNIT_TEST(testNsPrefixMath);
CPPUNIT_TEST(testMaction);
+ CPPUNIT_TEST(testtdf99556);
CPPUNIT_TEST_SUITE_END();
private:
@@ -103,6 +105,14 @@ void Test::testMaction()
CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", sExpected, mxDocShell->GetText());
}
+void Test::testtdf99556()
+{
+ loadURL(m_directories.getURLFromSrc("starmath/qa/extras/data/tdf99556-1.mml"));
+ OUString sExpected("sqrt");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", sExpected, mxDocShell->GetText());
+}
+
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index fe7654392744..a5537dd1ba42 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -794,7 +794,7 @@ void SmXMLEncloseContext_Impl::EndElement()
contents are treated as a single "inferred <mrow>" containing its
arguments
*/
- if (GetSmImport().GetNodeStack().size() - nElementCount > 1)
+ if (GetSmImport().GetNodeStack().size() - nElementCount != 1)
SmXMLRowContext_Impl::EndElement();
}
@@ -863,7 +863,7 @@ void SmXMLStyleContext_Impl::EndElement()
arguments
*/
SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- if (rNodeStack.size() - nElementCount > 1)
+ if (rNodeStack.size() - nElementCount != 1)
SmXMLRowContext_Impl::EndElement();
aStyleHelper.ApplyAttrs();
}
@@ -887,7 +887,7 @@ void SmXMLPaddedContext_Impl::EndElement()
contents are treated as a single "inferred <mrow>" containing its
arguments
*/
- if (GetSmImport().GetNodeStack().size() - nElementCount > 1)
+ if (GetSmImport().GetNodeStack().size() - nElementCount != 1)
SmXMLRowContext_Impl::EndElement();
}
@@ -910,7 +910,7 @@ void SmXMLPhantomContext_Impl::EndElement()
contents are treated as a single "inferred <mrow>" containing its
arguments
*/
- if (GetSmImport().GetNodeStack().size() - nElementCount > 1)
+ if (GetSmImport().GetNodeStack().size() - nElementCount != 1)
SmXMLRowContext_Impl::EndElement();
SmToken aToken;
@@ -2158,7 +2158,7 @@ void SmXMLSqrtContext_Impl::EndElement()
contents are treated as a single "inferred <mrow>" containing its
arguments
*/
- if (GetSmImport().GetNodeStack().size() - nElementCount > 1)
+ if (GetSmImport().GetNodeStack().size() - nElementCount != 1)
SmXMLRowContext_Impl::EndElement();
SmToken aToken;