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 12:51:33 +0000
commit178550923533b7c015e29d957a2fc3857ba73eb3 (patch)
treef90f8f10542a8f57bfe84354ffff6a7e6361f682
parent8f88c3237d71407f50c70736863439a978c8ec2f (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>
-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 27abde413e9b..df61c77e2eaf 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3485,6 +3485,16 @@ DECLARE_OOXMLEXPORT_TEST(testfdo78907,"fdo78907.docx")
assertXPath ( pXmlDoc1, "/w:ftr[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl", 0 );
}
+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 b86fc6e31574..ac6974575e2c 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1021,12 +1021,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())