summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPriyankaGaikwad <priyanka.gaikwad@synerzip.com>2014-02-06 16:40:17 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-02-14 12:04:23 +0100
commit0ff99adddc104ca09a97c2fd3d25e58787afb32d (patch)
tree9676f291156fd994ad6a226b1f1fc13d38019f76
parente7aab255c1595c8cc54e0eab3d8d1059fb3d00f1 (diff)
fdo#74605 negative value for wp:extents value causing corruption
Description: After roundtrip <wp:extent cx="-22327235" cy="149225" /> The cx value is negative so that the roundtrip file gives error while opening. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/7898 Change-Id: I563f292ac5aaaeb0726159db1f4852a7e237f7ea
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo74605.docxbin0 -> 180916 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx8
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx4
3 files changed, 10 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo74605.docx b/sw/qa/extras/ooxmlexport/data/fdo74605.docx
new file mode 100644
index 000000000000..85231f151f0b
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo74605.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index ccbdc63a6ae1..722c45592a59 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3190,6 +3190,14 @@ DECLARE_OOXMLEXPORT_TEST(testOuterShdw,"testOuterShdw.docx")
assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:effectLst[1]/a:outerShdw[1]", "dist", "57811035");
}
+DECLARE_OOXMLEXPORT_TEST(testExtentValue, "fdo74605.docx")
+{
+ xmlDocPtr pXmlDoc = parseExport();
+ if (!pXmlDoc)
+ return;
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:extent","cx","0");
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 0f3138bc1510..cefb62fb47a8 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -348,8 +348,8 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrmFmt* pFrmFmt, const Size& rS
OString aWidth(OString::number(TwipsToEMU(rSize.Width())));
OString aHeight(OString::number(TwipsToEMU(rSize.Height())));
m_pImpl->m_pSerializer->singleElementNS(XML_wp, XML_extent,
- XML_cx, aWidth.getStr(),
- XML_cy, aHeight.getStr(),
+ XML_cx, (rSize.Width() > 0 ? aWidth.getStr() : "0"),
+ XML_cy, (rSize.Height() > 0 ? aHeight.getStr() : "0"),
FSEND);
// effectExtent, extent including the effect (shadow only for now)