summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
diff options
context:
space:
mode:
authorSven Lüppken <sven@slueppken.de>2020-10-31 19:42:50 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2020-11-01 14:07:04 +0100
commit5cbdda84ff4c0b1b5e22bc8965fb5c4c275c365c (patch)
treed6f97cfa35c268e7131cfd5e7d539247f8f762a3 /sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
parentcef6b619da74f2f00520bb283b21c0347fc074e8 (diff)
tdf#136814 Fix border padding in Word export
While converting twips to points in the Word export filer, information is lost due to integer division. This patch tries to fix this by using floating-point division and (hopefully) proper rounding. The example document attached to the bug ticket works as expected now. Change-Id: I4b5b2163e42932b5e877726d16635d9f02a43cb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105128 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/qa/extras/ooxmlexport/ooxmlexport15.cxx')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index c2466dc809e6..8d98ccd39487 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -844,6 +844,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135660, "tdf135660.docx")
CPPUNIT_ASSERT_EQUAL_MESSAGE("Bottom wrap distance is wrong", static_cast<sal_Int32>(199), nWrapDistanceBottom);
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf136814, "tdf136814.odt")
+{
+ xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
+
+ // Padding in this document is 0.10 cm which should translate to 3 pt (approx. 1.0583mm)
+ assertXPath(pXmlDocument, "/w:document/w:body/w:sectPr/w:pgBorders/w:top", "space", "3");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:sectPr/w:pgBorders/w:left", "space", "3");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:sectPr/w:pgBorders/w:bottom", "space", "3");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:sectPr/w:pgBorders/w:right", "space", "3");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */