summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx5
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo78474.docxbin0 -> 116064 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx12
3 files changed, 16 insertions, 1 deletions
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 4d9b91ad69b2..34a84b42f93f 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -463,7 +463,10 @@ ShapeContextHandler::getShape() throw (uno::RuntimeException, std::exception)
mxLockedCanvasContext.clear();
}
}
- else if (mxChartShapeContext.is())
+ //NMSP_dmlChart == getNamespace( mnStartToken ) check is introduced to make sure that
+ //mnStartToken is set as NMSP_dmlChart in setStartToken.
+ //Only in case it is set then only the below block of code for ChartShapeContext should be executed.
+ else if (mxChartShapeContext.is() && (NMSP_dmlChart == getNamespace( mnStartToken )))
{
ChartGraphicDataContext* pChartGraphicDataContext = dynamic_cast<ChartGraphicDataContext*>(mxChartShapeContext.get());
if (pChartGraphicDataContext)
diff --git a/sw/qa/extras/ooxmlexport/data/fdo78474.docx b/sw/qa/extras/ooxmlexport/data/fdo78474.docx
new file mode 100644
index 000000000000..6468a8421895
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo78474.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 795ec6735742..67ccaaea4db6 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3194,6 +3194,18 @@ DECLARE_OOXMLEXPORT_TEST(testContentTypeTIF, "fdo77476.docx")
assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='image/tif']", "PartName", "/word/media/image1.tif");
}
+DECLARE_OOXMLEXPORT_TEST(fdo78474, "fdo78474.docx")
+{
+ xmlDocPtr pXmlDoc1 = parseExport("word/document.xml");
+ if (!pXmlDoc1) return;
+ //docx file after RT is getting corrupted.
+ assertXPath(pXmlDoc1, "/w:document[1]/w:body[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1]/w:p[1]/w:r[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/pic:pic[1]/pic:blipFill[1]/a:blip[1]", "embed", "rId2");
+
+ xmlDocPtr pXmlDoc2 = parseExport("word/_rels/document.xml.rels");
+ if (!pXmlDoc2) return;
+ assertXPath(pXmlDoc2,"/rels:Relationships/rels:Relationship[2]","Id","rId2");
+}
+
DECLARE_OOXMLEXPORT_TEST(testFDO77117, "fdo77117.docx")
{
uno::Reference<drawing::XShapes> xGroup(getShape(1), uno::UNO_QUERY);