summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-11-22 09:23:28 +0100
committerAndras Timar <andras.timar@collabora.com>2017-02-08 11:56:05 +0100
commitf1011fa0ab2d95657d36ea6493b0b060bb655133 (patch)
tree6cd6bfeff1723ed34ec214265fcf80bf28a8d616 /sw/qa/extras
parentbf030d1ab4638d4a8900c29fbea49a9ba69ff418 (diff)
tdf#103982 DOCX export: make sure SdrObject margin is non-negative
Regression from commit a5a836d8c43dc9cebbbf8af39bf0142de603a7c6 (DOCX filter: effect extent should be part of the margin, 2014-12-04), the effect extent is added to the nominal margin in DOCX, so we exclude that from the margin in our document model. But it shouldn't be ever negative, ST_WrapDistance is a restriction of the W3C XML Schema unsignedInt datatype. (cherry picked from commit f9f7a4ddaed85427522834597271967ee494b436) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport9.cxx Change-Id: I82b3c1ba0e3a14f7c585b0d389264a2c12e454e7 Reviewed-on: https://gerrit.libreoffice.org/31115 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 3cf2b5e0e8edc9d6044f8bc29ca9374f75b498a5)
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf103982.docxbin0 -> 12085 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx10
2 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf103982.docx b/sw/qa/extras/ooxmlexport/data/tdf103982.docx
new file mode 100644
index 000000000000..13e645356bf5
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf103982.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 36a29e8bbdb2..39a378b67978 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -829,6 +829,16 @@ DECLARE_OOXMLEXPORT_TEST(testTDF99434, "protectedform.docx")
}
+DECLARE_OOXMLEXPORT_TEST(testTdf103982, "tdf103982.docx")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ if (!pXmlDoc)
+ return;
+ sal_Int32 nDistB = getXPath(pXmlDoc, "//wp:anchor", "distB").toInt32();
+ // This was -260350, which is not a valid value for an unsigned type.
+ CPPUNIT_ASSERT(nDistB >= 0);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */