summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-08-27 16:36:19 +0300
committerJustin Luth <justin_luth@sil.org>2020-08-27 20:54:39 +0200
commite538c63c0d55b581332f4146dab26e26eb611dce (patch)
tree290cc1f0f1b0a082cfa8ec6ef0e9350ba16d74ba
parentc995359be1b768d9848ebbeac57765e217f5acff (diff)
related tdf#132149 ww8 export: unit test to prevent bad fix
The unit test I am using for this patch writes out landscape attribute, but provides portrait width/height values. I was tempted to just "fix" the values on export, but this existing document shows that w/h trump p/l in LO (and Word does the same). So that should also round-trip, and this test will ensure that keeps happening. Change-Id: Ib55cb799462abd1039ce7c1c935b3f66761a5dc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101479 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport3.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 504be6950cd0..2596c8d5d5e4 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -322,6 +322,12 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar3, "calendar3.docx")
uno::Reference<text::XTextRange> xCell2(xTable->getCellByName("A1"), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x2E74B5), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell2->getText()), 1), "CharColor"));
CPPUNIT_ASSERT_EQUAL(20.f, getProperty<float>(getRun(getParagraphOfText(1, xCell2->getText()),1), "CharHeight"));
+
+ // tdf#132149 Despite specifying portrait, the page size's specified width is greater than its height.
+ // Both Word and LO display it as landscape, so ensure that it round-trips with landscape dimentions.
+ uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Page Width (mm) ", sal_Int32(148), getProperty<sal_Int32>(xPageStyle, "Width") / 100);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Page Height (mm)", sal_Int32(105), getProperty<sal_Int32>(xPageStyle, "Height") / 100);
}
DECLARE_OOXMLEXPORT_TEST(testCalendar4, "calendar4.docx")