summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPriyankaGaikwad <priyanka.gaikwad@synerzip.com>2014-06-10 14:53:40 +0530
committerMichael Stahl <mstahl@redhat.com>2014-06-10 14:52:40 +0200
commit713c639ce5ba6371e9c0d9ff51be7cf4c68d3d4c (patch)
tree314260af52d63307236c7ba7aef51992704014c6
parent5ae32a6977207ca05c62186411a2f5e83b16d8f2 (diff)
fdo#79822 : Crash:LO Crashes while Saving the DOCX containing smartart
Decription : - Docx file contain smartart and it was created in MS word 2007. - MS word 2007 does not create any drawing.xml for smartart - So in DocxSdrExport::writeDiagram() diagramDrawing was not set in this case. - File crashing at diagramDrawing[0] >>= drawingDom as diagramDrawing is empty. Change-Id: I6bc38e702f731ad8074b562572fd50f2e29a41b7 Reviewed-on: https://gerrit.libreoffice.org/9706 Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 178550923533b7c015e29d957a2fc3857ba73eb3)
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo79822.docxbin0 -> 40902 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx10
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx4
3 files changed, 13 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo79822.docx b/sw/qa/extras/ooxmlexport/data/fdo79822.docx
new file mode 100644
index 000000000000..2844671d607d
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo79822.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index fd98235793fa..a87ddef92f52 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3468,6 +3468,16 @@ DECLARE_OOXMLEXPORT_TEST(testWordArtWithinDraingtool, "testWordArtWithinDraingto
assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1]",1);
}
+DECLARE_OOXMLEXPORT_TEST(testfdo79822, "fdo79822.docx")
+{
+ /* File getting crash while saving in LO.
+ * The Docx contain smartart and the file was created in ms word 2007
+ */
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ if (!pXmlDoc)
+ return;
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 29c119500e42..2e774184150e 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -945,12 +945,14 @@ void DocxSdrExport::writeDiagram(const SdrObject* sdrObject, const SwFrmFmt& rFr
else if (propName == "OOXColor")
propList[nProp].Value >>= colorDom;
else if (propName == "OOXDrawing")
+ {
propList[nProp].Value >>= diagramDrawing;
+ diagramDrawing[0] >>= drawingDom; // if there is OOXDrawing property then set drawingDom here only.
+ }
else if (propName == "OOXDiagramDataRels")
propList[nProp].Value >>= xDataRelSeq;
}
- diagramDrawing[0] >>= drawingDom;
// check that we have the 4 mandatory XDocuments
// if not, there was an error importing and we won't output anything
if (!dataDom.is() || !layoutDom.is() || !styleDom.is() || !colorDom.is())