diff options
author | Justin Luth <justin.luth@collabora.com> | 2019-10-04 15:48:31 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2019-11-06 19:32:40 +0100 |
commit | 4b2752755609a4132417e57ca52bfc773c9ef897 (patch) | |
tree | 38ae9be1692ead047888a9979c5cda4dc08033e7 | |
parent | ffd9e90058d2e8a54a307ca6f58f60d380eaa4f2 (diff) |
tdf#120412 better unit test
The previous unit test OUGHT to have reported exactly 100% escapement,
and the patch's purpose was to support greater than 100% escapement.
Depending on a number of patches (related to bug 99602),
this unit test verifies that 400% works.
Change-Id: I1ee36d1570c34d86dbfb0a03ee3c2026b9645b63
Reviewed-on: https://gerrit.libreoffice.org/80220
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf120412_400PercentSubscript.docx | bin | 0 -> 10691 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 9 |
2 files changed, 9 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf120412_400PercentSubscript.docx b/sw/qa/extras/ooxmlexport/data/tdf120412_400PercentSubscript.docx Binary files differnew file mode 100644 index 000000000000..526d7d2c18c4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf120412_400PercentSubscript.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index 17b91ecb9180..b9efb409a456 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -206,6 +206,15 @@ DECLARE_OOXMLEXPORT_TEST(textboxWpgOnly, "textbox-wpg-only.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xText), 1), "CharEscapementHeight")); } +DECLARE_OOXMLEXPORT_TEST(testTdf120412_400PercentSubscript, "tdf120412_400PercentSubscript.docx") +{ + uno::Reference<text::XTextRange> xPara = getParagraph(1); + // The word "Base" should not be subscripted. + CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.f, getProperty<float>(getRun(xPara, 1, "Base"), "CharEscapement"), 0); + // The word "Subscript" should be 12pt, subscripted by 400% (48pt). + CPPUNIT_ASSERT_DOUBLES_EQUAL( -400.f, getProperty<float>(getRun(xPara, 2, "Subscript"), "CharEscapement"), 0); +} + DECLARE_OOXMLEXPORT_TEST(testFontEsc, "test_tdf120412.docx") { xmlDocPtr pXmlDoc =parseExport("word/document.xml"); |