void Test::testColor()
{
loadFromFile(u"color.mml");
SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell());
CPPUNIT_ASSERT_EQUAL(u"{ color black b" " color white w" " color red r" " color green g" " color blue b" " color yellow y" " color silver s" " color gray g" " color maroon m" " color purple p" " color lime l" " color olive o" " color navy n" " color teal t" " color aqua a" " color fuchsia f" " color crimson c" " color dvip apricot" " a color yellow y" " color rgb 220 20 61 x }"_ustr,
pDocShell->GetText());
}
void Test::testSimple()
{
loadFromFile(u"simple.mml");
SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell());
CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", u"left ( { a + b } right ) ^ 2"_ustr,
pDocShell->GetText());
}
void Test::testNsPrefixMath()
{
loadFromFile(u"ns-prefix-math.mml");
SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell());
CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", u"left ( { a + b } right ) ^ 2"_ustr,
pDocShell->GetText());
}
void Test::testTdf103430()
{
loadFromFile(u"tdf103430.mml");
SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell());
CPPUNIT_ASSERT_EQUAL(u"{ frac { { nitalic d ^ 2 nitalic color blue y } } { { color dvip " "apricot nitalic d font sans bold italic color red x } } }"_ustr,
pDocShell->GetText());
}
void Test::testTdf103500()
{
loadFromFile(u"tdf103500.mml");
SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell());
CPPUNIT_ASSERT_EQUAL(u"{ { int csup b csub a { { frac { 1 } { x } } ` nitalic d x } } = { " "intd csup b csub a { { frac { 1 } { y } } ` nitalic d y } } }"_ustr,
pDocShell->GetText());
}
void Test::testTdf137008()
{ // Without the fix in place, this test would have crashed
loadFromFile(u"tdf137008.mml");
SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell());
CPPUNIT_ASSERT_EQUAL(u"matrix{ { } # ## # }"_ustr, pDocShell->GetText());
}
void Test::testTdf151842()
{ // Without the fix in place, this test would have crashed
loadFromFile(u"tdf151842.odf");
SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell());
CPPUNIT_ASSERT_EQUAL(u"test"_ustr, pDocShell->GetText());
SmFormat aFormat = pDocShell->GetFormat();
// Without the fix in place, this test would have failed with // - Expected: 2400 // - Actual : 423
CPPUNIT_ASSERT_EQUAL(tools::Long(2400), aFormat.GetBaseSize().Height());
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.