From 23b65a84fd827555dfb84c7e2f78879c479c2f78 Mon Sep 17 00:00:00 2001 From: sushil_shinde Date: Wed, 19 Mar 2014 18:34:45 +0530 Subject: fdo#76356 : Docx file contianing chart in footer/header gets corrupted. - Docx file with chart in footer/header or .bin file referred in chart was getting corrupted. - Embedded file for footer.xml was not grabbaged. - .bin embedded files were not grab baged. - Added grab bag support for both case. - Added UT to check .bin files are grab baged properly. Reviewed on: https://gerrit.libreoffice.org/8674 Change-Id: I221e3867798fc2a3a42f6385d687e80b80a3678f --- oox/source/export/chartexport.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'oox/source/export/chartexport.cxx') diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 91d761f55ca2..0d30e29d1b42 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -801,8 +801,12 @@ void ChartExport::exportExternalData( Reference< ::com::sun::star::chart::XChart } } FSHelperPtr pFS = GetFS(); + OUString type = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"; + if (relationPath.endsWith(OUString(".bin"))) + type = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"; + OUString sRelId = GetFB()->addRelation(pFS->getOutputStream(), - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package", + type, relationPath); pFS->singleElementNS( XML_c, XML_externalData, FSNS(XML_r, XML_id), OUStringToOString(sRelId, RTL_TEXTENCODING_UTF8), -- cgit