From cc1c838942d4b2ae395ae7429271e48335fdee80 Mon Sep 17 00:00:00 2001 From: Ravindra Vidhate Date: Thu, 30 Jan 2014 17:19:14 +0530 Subject: fdo#74215:Fix for empty imagedata in Number Pic bullet 1. While exporting through LO, it writes numPicBullet with imagedata of size 0,0. 2. Because of this image file of 0KB is added in media folder 3. While opening the document in MS-Office, it shows the image missing at the top which is of 0 KB size. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/7744 Change-Id: I5f8f187fc4fe678dceb3f2b594de74a6b52cbe74 --- sw/qa/extras/ooxmlexport/data/FDO74215.docx | Bin 0 -> 24322 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 8 ++++++++ sw/source/filter/ww8/wrtww8.cxx | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 sw/qa/extras/ooxmlexport/data/FDO74215.docx diff --git a/sw/qa/extras/ooxmlexport/data/FDO74215.docx b/sw/qa/extras/ooxmlexport/data/FDO74215.docx new file mode 100644 index 000000000000..fd2cc552efbb Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/FDO74215.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 5ea7e8327bdc..5f55f19287f0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3003,6 +3003,14 @@ DECLARE_OOXMLEXPORT_TEST(testFDO74106, "FDO74106.docx") assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt", "val","hebrew1"); } +DECLARE_OOXMLEXPORT_TEST(testFDO74215, "FDO74215.docx") +{ + xmlDocPtr pXmlDoc = parseExport("word/numbering.xml"); + if (!pXmlDoc) + return; + assertXPath(pXmlDoc, "/w:numbering/w:numPicBullet[2]/w:pict/v:shape", "style", "width:6.4pt;height:6.4pt"); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 9fd02e13f4b0..eb3c2fa91cef 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1460,7 +1460,9 @@ void MSWordExportBase::BulletDefinitions() aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, aMapMode); else aSize = OutputDevice::LogicToLogic(aSize,rGraphic.GetPrefMapMode(), aMapMode); - AttrOutput().BulletDefinition(i, rGraphic, aSize); + + if (0 != aSize.Height() && 0 != aSize.Width()) + AttrOutput().BulletDefinition(i, rGraphic, aSize); } } -- cgit