starmath OOXML import: stop quoting single-char math operators as literal text
When importing OOXML math formulas, encloseOrEscapeLiteral() quoted
every delimiter character, including standard math operators like =, -,
and +. StarMath then rendered them as text-font glyphs instead of
math-font operators. This caused the equals sign to misalign with the
fraction bar and the minus sign to render as a shorter text hyphen.
Skip quoting for single-character standard math operators (+, -, *, /,
=, <, >) so StarMath treats them as proper operators with correct glyph
selection and alignment.
A bare operator alone inside braces (e.g. rsup {+}) is a StarMath parse
error because the parser expects an operand. Add a safety re-quote in
readOMathArgInElement() for that case, since all its callers wrap the
result in {...}
Change-Id: I22f01a25212d3c030e8104a00418ab1f6bdb2d07
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3329
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit f2ccbc5a30dbac56b600747af655076d6f7058c2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205823
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
committed by
Xisco Fauli
parent
18071bb0c1
commit
07b1781475
@@ -123,4 +123,9 @@ const SmTokenTableEntry* GetTokenTableEntry(const OUString& rName);
|
||||
|
||||
OUString encloseOrEscapeLiteral(const OUString& string, bool force);
|
||||
|
||||
inline bool isSingleCharMathOperator(sal_Unicode c)
|
||||
{
|
||||
return c == '+' || c == '-' || c == '*' || c == '/' || c == '=' || c == '<' || c == '>';
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
@@ -154,6 +154,9 @@ OUString SmOoxmlImport::readOMathArgInElement( int token )
|
||||
m_rStream.ensureOpeningTag( token );
|
||||
OUString ret = readOMathArg( token );
|
||||
m_rStream.ensureClosingTag( token );
|
||||
// A bare operator alone in braces (e.g. rsup {+}) is a StarMath parse error.
|
||||
if (ret.getLength() == 1 && isSingleCharMathOperator(ret[0]))
|
||||
ret = "\"" + ret + "\"";
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -386,6 +386,8 @@ const SmTokenTableEntry* GetTokenTableEntry(const OUString& rName)
|
||||
|
||||
OUString encloseOrEscapeLiteral(const OUString& string, bool force)
|
||||
{
|
||||
if (string.getLength() == 1 && isSingleCharMathOperator(string[0]))
|
||||
return string;
|
||||
if (force)
|
||||
return "\"" + string + "\"";
|
||||
OUStringBuffer result;
|
||||
|
||||
@@ -340,7 +340,7 @@ DECLARE_OOXMLEXPORT_TEST(testMathD, "math-d.docx")
|
||||
|
||||
DECLARE_OOXMLEXPORT_TEST(testMathEscaping, "math-escaping.docx")
|
||||
{
|
||||
CHECK_FORMULA(u"\u2212 \u221E \"<\" x \"<\" \u221E"_ustr,
|
||||
CHECK_FORMULA(u"\u2212 \u221E < x < \u221E"_ustr,
|
||||
getFormula(getRun(getParagraph(1), 1)));
|
||||
}
|
||||
|
||||
@@ -358,54 +358,54 @@ CPPUNIT_TEST_FIXTURE(Test, testMathMso2k7)
|
||||
{
|
||||
createSwDoc("math-mso2k7.docx");
|
||||
saveAndReload(TestFilter::DOCX);
|
||||
CHECK_FORMULA(u"A \"=\" \u03C0 {r} ^ {2}"_ustr, getFormula(getRun(getParagraph(1), 1)));
|
||||
CHECK_FORMULA(u"A = \u03C0 {r} ^ {2}"_ustr, getFormula(getRun(getParagraph(1), 1)));
|
||||
// TODO check the stack/binom difference
|
||||
// CHECK_FORMULA( "{left (x+a right )} ^ {n} = sum from {k=0} to {n} {left (binom {n} {k} right ) {x} ^ {k} {a} ^ {n-k}}",
|
||||
CHECK_FORMULA(
|
||||
u"{left (x\"+\"a right )} ^ {n} \"=\" sum from {k\"=\"0} to {n} {left (stack {n # k} right ) {x} ^ {k} {a} ^ {n\"-\"k}}"_ustr,
|
||||
u"{left (x + a right )} ^ {n} = sum from {k = 0} to {n} {left (stack {n # k} right ) {x} ^ {k} {a} ^ {n - k}}"_ustr,
|
||||
getFormula(getRun(getParagraph(2), 1)));
|
||||
CHECK_FORMULA(
|
||||
u"{left (1\"+\"x right )} ^ {n} \"=\"1\"+\" {nx} over {1!} \"+\" {n left (n\"-\"1 right ) {x} ^ {2}} over {2!} \"+\"\u2026"_ustr,
|
||||
u"{left (1 + x right )} ^ {n} = 1 + {nx} over {1!} + {n left (n - 1 right ) {x} ^ {2}} over {2!} + \u2026"_ustr,
|
||||
getFormula(getRun(getParagraph(3), 1)));
|
||||
// TODO check (cos/sin miss {})
|
||||
// CHECK_FORMULA( "f left (x right ) = {a} rsub {0} + sum from {n=1} to {\xe2\x88\x9e} {left ({a} rsub {n} cos {{n\xcf\x80x} over {L}} + {b} rsub {n} sin {{n\xcf\x80x} over {L}} right )}",
|
||||
CHECK_FORMULA(
|
||||
u"f left (x right ) \"=\" {a} rsub {0} \"+\" sum from {n\"=\"1} to {\u221E} {left ({a} rsub {n} cos {n\u03C0x} over {L} \"+\" {b} rsub {n} sin {n\u03C0x} over {L} right )}"_ustr,
|
||||
u"f left (x right ) = {a} rsub {0} + sum from {n = 1} to {\u221E} {left ({a} rsub {n} cos {n\u03C0x} over {L} + {b} rsub {n} sin {n\u03C0x} over {L} right )}"_ustr,
|
||||
getFormula(getRun(getParagraph(4), 1)));
|
||||
CHECK_FORMULA(u"{a} ^ {2} \"+\" {b} ^ {2} \"=\" {c} ^ {2}"_ustr,
|
||||
CHECK_FORMULA(u"{a} ^ {2} + {b} ^ {2} = {c} ^ {2}"_ustr,
|
||||
getFormula(getRun(getParagraph(5), 1)));
|
||||
CHECK_FORMULA(u"x \"=\" {\"-\" b \u00B1 sqrt {{b} ^ {2} \"-\"4 ac}} over {2 a}"_ustr,
|
||||
CHECK_FORMULA(u"x = {- b \u00B1 sqrt {{b} ^ {2} - 4 ac}} over {2 a}"_ustr,
|
||||
getFormula(getRun(getParagraph(6), 1)));
|
||||
CHECK_FORMULA(
|
||||
u"{left (1\"+\"x right )} ^ {n} \"=\"1\"+\" {nx} over {1!} \"+\" {n left (n\"-\"1 right ) {x} ^ {2}} over {2!} \"+\"\u2026"_ustr,
|
||||
u"{left (1 + x right )} ^ {n} = 1 + {nx} over {1!} + {n left (n - 1 right ) {x} ^ {2}} over {2!} + \u2026"_ustr,
|
||||
getFormula(getRun(getParagraph(3), 1)));
|
||||
// TODO check (cos/sin miss {})
|
||||
// CHECK_FORMULA( "f left (x right ) = {a} rsub {0} + sum from {n=1} to {\xe2\x88\x9e} {left ({a} rsub {n} cos {{n\xcf\x80x} over {L}} + {b} rsub {n} sin {{n\xcf\x80x} over {L}} right )}",
|
||||
CHECK_FORMULA(
|
||||
u"f left (x right ) \"=\" {a} rsub {0} \"+\" sum from {n\"=\"1} to {\u221E} {left ({a} rsub {n} cos {n\u03C0x} over {L} \"+\" {b} rsub {n} sin {n\u03C0x} over {L} right )}"_ustr,
|
||||
u"f left (x right ) = {a} rsub {0} + sum from {n = 1} to {\u221E} {left ({a} rsub {n} cos {n\u03C0x} over {L} + {b} rsub {n} sin {n\u03C0x} over {L} right )}"_ustr,
|
||||
getFormula(getRun(getParagraph(4), 1)));
|
||||
CHECK_FORMULA("{a} ^ {2} \"+\" {b} ^ {2} \"=\" {c} ^ {2}",
|
||||
CHECK_FORMULA(u"{a} ^ {2} + {b} ^ {2} = {c} ^ {2}"_ustr,
|
||||
getFormula(getRun(getParagraph(5), 1)));
|
||||
CHECK_FORMULA(u"x \"=\" {\"-\" b \u00B1 sqrt {{b} ^ {2} \"-\"4 ac}} over {2 a}"_ustr,
|
||||
CHECK_FORMULA(u"x = {- b \u00B1 sqrt {{b} ^ {2} - 4 ac}} over {2 a}"_ustr,
|
||||
getFormula(getRun(getParagraph(6), 1)));
|
||||
CHECK_FORMULA(
|
||||
u"{e} ^ {x} \"=\"1\"+\" {x} over {1!} \"+\" {{x} ^ {2}} over {2!} \"+\" {{x} ^ {3}} over {3!} \"+\"\u2026,\" \" \" \" \"-\"\u221E\"<\"x\"<\"\u221E"_ustr,
|
||||
u"{e} ^ {x} = 1 + {x} over {1!} + {{x} ^ {2}} over {2!} + {{x} ^ {3}} over {3!} + \u2026,\" \" \" \" - \u221E < x < \u221E"_ustr,
|
||||
getFormula(getRun(getParagraph(7), 1)));
|
||||
CHECK_FORMULA(
|
||||
// "sin {\xce\xb1} \xc2\xb1 sin {\xce\xb2} =2 sin {{1} over {2} left (\xce\xb1\xc2\xb1\xce\xb2 right )} cos {{1} over {2} left (\xce\xb1\xe2\x88\x93\xce\xb2 right )}",
|
||||
// TODO check (cos/in miss {})
|
||||
u"sin \u03B1 \u00B1 sin \u03B2 \"=\"2 sin {1} over {2} left (\u03B1\u00B1\u03B2 right ) cos {1} over {2} left (\u03B1\u2213\u03B2 right )"_ustr,
|
||||
u"sin \u03B1 \u00B1 sin \u03B2 = 2 sin {1} over {2} left (\u03B1\u00B1\u03B2 right ) cos {1} over {2} left (\u03B1\u2213\u03B2 right )"_ustr,
|
||||
getFormula(getRun(getParagraph(8), 1)));
|
||||
CHECK_FORMULA(
|
||||
// "cos {\xce\xb1} + cos {\xce\xb2} =2 cos {{1} over {2} left (\xce\xb1+\xce\xb2 right )} cos {{1} over {2} left (\xce\xb1-\xce\xb2 right )}",
|
||||
// TODO check (cos/sin miss {})
|
||||
u"cos \u03B1 \"+\" cos \u03B2 \"=\"2 cos {1} over {2} left (\u03B1\"+\"\u03B2 right ) cos {1} over {2} left (\u03B1\"-\"\u03B2 right )"_ustr,
|
||||
u"cos \u03B1 + cos \u03B2 = 2 cos {1} over {2} left (\u03B1 + \u03B2 right ) cos {1} over {2} left (\u03B1 - \u03B2 right )"_ustr,
|
||||
getFormula(getRun(getParagraph(9), 1)));
|
||||
}
|
||||
|
||||
DECLARE_OOXMLEXPORT_TEST(testMathNary, "math-nary.docx")
|
||||
{
|
||||
CHECK_FORMULA(u"lllint from {1} to {2} {x \"+\" 1}"_ustr,
|
||||
CHECK_FORMULA(u"lllint from {1} to {2} {x + 1}"_ustr,
|
||||
getFormula(getRun(getParagraph(1), 1)));
|
||||
CHECK_FORMULA( u"prod from {a} {b}"_ustr, getFormula( getRun( getParagraph( 1 ), 2 )));
|
||||
CHECK_FORMULA( u"sum to {2} {x}"_ustr, getFormula( getRun( getParagraph( 1 ), 3 )));
|
||||
@@ -430,12 +430,12 @@ DECLARE_OOXMLEXPORT_TEST(testMathPlaceholders, "math-placeholders.docx")
|
||||
DECLARE_OOXMLEXPORT_TEST(testMathRad, "math-rad.docx")
|
||||
{
|
||||
CHECK_FORMULA( u"sqrt {4}"_ustr, getFormula( getRun( getParagraph( 1 ), 1 )));
|
||||
CHECK_FORMULA(u"nroot {3} {x \"+\" 1}"_ustr, getFormula(getRun(getParagraph(1), 2)));
|
||||
CHECK_FORMULA(u"nroot {3} {x + 1}"_ustr, getFormula(getRun(getParagraph(1), 2)));
|
||||
}
|
||||
|
||||
DECLARE_OOXMLEXPORT_TEST(testMathSubscripts, "math-subscripts.docx")
|
||||
{
|
||||
CHECK_FORMULA(u"{x} ^ {y} \"+\" {e} ^ {x}"_ustr, getFormula(getRun(getParagraph(1), 1)));
|
||||
CHECK_FORMULA(u"{x} ^ {y} + {e} ^ {x}"_ustr, getFormula(getRun(getParagraph(1), 1)));
|
||||
CHECK_FORMULA( u"{x} ^ {b}"_ustr, getFormula( getRun( getParagraph( 1 ), 2 )));
|
||||
CHECK_FORMULA( u"{x} rsub {b}"_ustr, getFormula( getRun( getParagraph( 1 ), 3 )));
|
||||
CHECK_FORMULA( u"{a} rsub {c} rsup {b}"_ustr, getFormula( getRun( getParagraph( 1 ), 4 )));
|
||||
@@ -685,7 +685,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableStylerPrSz, "table-style-rPr-sz.docx")
|
||||
DECLARE_OOXMLEXPORT_TEST(testMathLiteral, "math-literal.docx")
|
||||
{
|
||||
CHECK_FORMULA(
|
||||
u"iiint from {V} to <?> {\"div\" \"F\"} dV\"=\" llint from {S} to <?> {\"F\" \u2219 \"n \" dS}"_ustr,
|
||||
u"iiint from {V} to <?> {\"div\" \"F\"} dV = llint from {S} to <?> {\"F\" \u2219 \"n \" dS}"_ustr,
|
||||
getFormula(getRun(getParagraph(1), 1)));
|
||||
}
|
||||
|
||||
|
||||
@@ -1406,9 +1406,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf170171_equation_without_opening_brackets)
|
||||
{
|
||||
createSwDoc("tdf170171.docx");
|
||||
// Without the fix in place, this test would have failed with
|
||||
// - Expected: left [0; "+" ∞ right [
|
||||
// - Actual : left [0; "+" ∞[
|
||||
CPPUNIT_ASSERT_EQUAL(u"left [0; \"+\" ∞ right ["_ustr, getFormula(getRun(getParagraph(1), 1)));
|
||||
// - Expected: left [0; + ∞ right [
|
||||
// - Actual : left [0; + ∞[
|
||||
CPPUNIT_ASSERT_EQUAL(u"left [0; + ∞ right ["_ustr, getFormula(getRun(getParagraph(1), 1)));
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(Test, testTdf169173)
|
||||
|
||||
@@ -229,7 +229,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMathEqarray)
|
||||
saveAndReload(TestFilter::RTF);
|
||||
OUString aActual = getFormula(getRun(getParagraph(1), 1));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
u"y \"=\" left lbrace stack { 0 , x \"<\" 0 # 1 , x \"=\" 0 # {x} ^ {2} , x \">\" 0 } right none"_ustr,
|
||||
u"y = left lbrace stack { 0 , x < 0 # 1 , x = 0 # {x} ^ {2} , x > 0 } right none"_ustr,
|
||||
aActual);
|
||||
}
|
||||
|
||||
@@ -295,49 +295,46 @@ CPPUNIT_TEST_FIXTURE(Test, testMathMso2007)
|
||||
createSwDoc("math-mso2007.rtf");
|
||||
saveAndReload(TestFilter::RTF);
|
||||
OUString aActual = getFormula(getRun(getParagraph(1), 1));
|
||||
OUString aExpected(u"A \"=\" \u03C0 {r} ^ {2}"_ustr);
|
||||
OUString aExpected(u"A = \u03C0 {r} ^ {2}"_ustr);
|
||||
CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
|
||||
|
||||
aActual = getFormula(getRun(getParagraph(2), 1));
|
||||
aExpected
|
||||
= u"{left (x \"+\" a right )} ^ {n} \"=\" sum from {k \"=\" 0} to {n} {left (stack { n "
|
||||
u"# k } right ) {x} ^ {k} {a} ^ {n \u2212 k}}"_ustr;
|
||||
aExpected = u"{left (x + a right )} ^ {n} = sum from {k = 0} to {n} {left (stack { n "
|
||||
u"# k } right ) {x} ^ {k} {a} ^ {n \u2212 k}}"_ustr;
|
||||
CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
|
||||
|
||||
aActual = getFormula(getRun(getParagraph(3), 1));
|
||||
aExpected = u"{left (1 \"+\" x right )} ^ {n} \"=\" 1 \"+\" {nx} over {1 !} \"+\" {n left (n "
|
||||
aExpected = u"{left (1 + x right )} ^ {n} = 1 + {nx} over {1 !} + {n left (n "
|
||||
u"\u2212 1 "
|
||||
u"right ) {x} ^ {2}} over {2 !} \"+\" \u2026"_ustr;
|
||||
u"right ) {x} ^ {2}} over {2 !} + \u2026"_ustr;
|
||||
CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
|
||||
|
||||
aActual = getFormula(getRun(getParagraph(4), 1));
|
||||
aExpected
|
||||
= u"f left (x right ) \"=\" {a} rsub {0} \"+\" sum from {n \"=\" 1} to {\u221E} {left "
|
||||
u"({a} rsub {n} cos {n\u03C0x} over {L} \"+\" {b} rsub {n} sin {n\u03C0x} "
|
||||
u"over {L} right )}"_ustr;
|
||||
aExpected = u"f left (x right ) = {a} rsub {0} + sum from {n = 1} to {\u221E} {left "
|
||||
u"({a} rsub {n} cos {n\u03C0x} over {L} + {b} rsub {n} sin {n\u03C0x} "
|
||||
u"over {L} right )}"_ustr;
|
||||
CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
|
||||
|
||||
aActual = getFormula(getRun(getParagraph(5), 1));
|
||||
aExpected = "{a} ^ {2} \"+\" {b} ^ {2} \"=\" {c} ^ {2}";
|
||||
aExpected = u"{a} ^ {2} + {b} ^ {2} = {c} ^ {2}"_ustr;
|
||||
CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
|
||||
|
||||
aActual = getFormula(getRun(getParagraph(6), 1));
|
||||
aExpected = u"x \"=\" {\u2212 b \u00B1 sqrt {{b} ^ {2} \u2212 4 ac}} over {2 a}"_ustr;
|
||||
aExpected = u"x = {\u2212 b \u00B1 sqrt {{b} ^ {2} \u2212 4 ac}} over {2 a}"_ustr;
|
||||
CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
|
||||
|
||||
aActual = getFormula(getRun(getParagraph(7), 1));
|
||||
aExpected
|
||||
= u"{e} ^ {x} \"=\" 1 \"+\" {x} over {1 !} \"+\" {{x} ^ {2}} over {2 !} \"+\" {{x} ^ {3}} "
|
||||
u"over {3 !} \"+\" \u2026 , \u2212 \u221E \"<\" x \"<\" \u221E"_ustr;
|
||||
aExpected = u"{e} ^ {x} = 1 + {x} over {1 !} + {{x} ^ {2}} over {2 !} + {{x} ^ {3}} "
|
||||
u"over {3 !} + \u2026 , \u2212 \u221E < x < \u221E"_ustr;
|
||||
CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
|
||||
|
||||
aActual = getFormula(getRun(getParagraph(8), 1));
|
||||
aExpected = u"sin \u03B1 \u00B1 sin \u03B2 \"=\" 2 sin {1} over {2} left (\u03B1 \u00B1 "
|
||||
aExpected = u"sin \u03B1 \u00B1 sin \u03B2 = 2 sin {1} over {2} left (\u03B1 \u00B1 "
|
||||
u"\u03B2 right ) cos {1} over {2} left (\u03B1 \u2213 \u03B2 right )"_ustr;
|
||||
CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
|
||||
|
||||
aActual = getFormula(getRun(getParagraph(9), 1));
|
||||
aExpected = u"cos \u03B1 \"+\" cos \u03B2 \"=\" 2 cos {1} over {2} left (\u03B1 \"+\" \u03B2 "
|
||||
aExpected = u"cos \u03B1 + cos \u03B2 = 2 cos {1} over {2} left (\u03B1 + \u03B2 "
|
||||
u"right ) cos {1} over {2} left (\u03B1 \u2212 \u03B2 right )"_ustr;
|
||||
CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
|
||||
}
|
||||
@@ -347,8 +344,8 @@ CPPUNIT_TEST_FIXTURE(Test, testMathNary)
|
||||
createSwDoc("math-nary.rtf");
|
||||
saveAndReload(TestFilter::RTF);
|
||||
OUString aActual = getFormula(getRun(getParagraph(1), 1));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
u"lllint from {1} to {2} {x \"+\" 1} prod from {a} {b} sum to {2} {x}"_ustr, aActual);
|
||||
CPPUNIT_ASSERT_EQUAL(u"lllint from {1} to {2} {x + 1} prod from {a} {b} sum to {2} {x}"_ustr,
|
||||
aActual);
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(Test, testMathLimupp)
|
||||
@@ -395,7 +392,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMathRad)
|
||||
createSwDoc("math-rad.rtf");
|
||||
saveAndReload(TestFilter::RTF);
|
||||
OUString aActual = getFormula(getRun(getParagraph(1), 1));
|
||||
CPPUNIT_ASSERT_EQUAL(u"sqrt {4} nroot {3} {x \"+\" 1}"_ustr, aActual);
|
||||
CPPUNIT_ASSERT_EQUAL(u"sqrt {4} nroot {3} {x + 1}"_ustr, aActual);
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(Test, testMathSepchr)
|
||||
@@ -415,9 +412,9 @@ CPPUNIT_TEST_FIXTURE(Test, testMathSubscripts)
|
||||
auto verify = [this]() {
|
||||
OUString aActual = getFormula(getRun(getParagraph(1), 1));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
u"{x} ^ {y} \"+\" {e} ^ {x} {x} ^ {b} {x} rsub {b} {a} rsub {c} rsup {b} "
|
||||
"{x} lsub {2} lsup {1} {{x csup {6} csub {3}} lsub {4} lsup {5}} rsub "
|
||||
"{2} rsup {1}"_ustr,
|
||||
u"{x} ^ {y} + {e} ^ {x} {x} ^ {b} {x} rsub {b} {a} rsub {c} rsup {b} "
|
||||
u"{x} lsub {2} lsup {1} {{x csup {6} csub {3}} lsub {4} lsup {5}} rsub "
|
||||
u"{2} rsup {1}"_ustr,
|
||||
aActual);
|
||||
};
|
||||
createSwDoc("math-subscripts.rtf");
|
||||
@@ -653,7 +650,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMnor)
|
||||
// \mnor wasn't handled, leading to missing quotes around "divF" and so on.
|
||||
OUString aActual = getFormula(getRun(getParagraph(1), 1));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
u"iiint from {V} to <?> {\"divF\"} dV \"=\" llint from {S} to <?> {\"F\" \u2219 \"n\" dS}"_ustr,
|
||||
u"iiint from {V} to <?> {\"divF\"} dV = llint from {S} to <?> {\"F\" \u2219 \"n\" dS}"_ustr,
|
||||
aActual);
|
||||
};
|
||||
createSwDoc("mnor.rtf");
|
||||
|
||||
Reference in New Issue
Block a user