summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTushar Bende <tushar.bende@synerzip.com>2014-03-05 11:25:35 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-03-05 04:22:30 -0600
commit7b7b64f26b9ef4ed717506f689d6d870305cb2bb (patch)
tree0a1461aa5f5d10e0ac4e2e66943b02ba9fc42002
parent9a7ca779cdd3007df4e1425d296ba83091a4044d (diff)
fdo#75557 : OLE Objects of type .zip not being preserved in RT
Problem was Document containing ole object if RoundTripped then after Roundtripping the OLE object was not working. Which means if doc contains .zip file as ole object then after RoundTripping that .zip object was not getting opened . Reason found that it was because of missing o:title attribute during RoundTrip for <v:imagedata> inside <v:shape>. XML file difference : In document.xml, Before - <v:shape id="ole_rId2" style="width:72pt;height:40.3pt" o:ole=""> <v:imagedata r:id="rId3" /> </v:shape> After - <v:shape id="ole_rId2" style="width:72pt;height:40.3pt" o:ole=""> <v:imagedata r:id="rId3" o:title="" /> </v:shape> Verified that code changes working for other ole objects as well which are: Equations ,Excel Sheet and .zip. Change-Id: I813de38bcd6e334ce38a661fdfcfa434ef246ed0 Reviewed-on: https://gerrit.libreoffice.org/8458 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/qa/extras/ooxmlexport/data/test_ole_object.docxbin0 -> 286633 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx8
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx1
3 files changed, 9 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/test_ole_object.docx b/sw/qa/extras/ooxmlexport/data/test_ole_object.docx
new file mode 100644
index 000000000000..4391946f086b
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/test_ole_object.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 920f33a7c516..383566c617f1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2943,6 +2943,14 @@ DECLARE_OOXMLEXPORT_TEST(testCompatSettingsForW14, "TextEffects_StylisticSets_Cn
assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[5]", "uri", "http://schemas.microsoft.com/office/word");
assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[5]", "val", "1");
}
+DECLARE_OOXMLEXPORT_TEST(testOleObject, "test_ole_object.docx")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ if (!pXmlDoc)
+ return;
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape/v:imagedata", "o:title", "");
+}
DECLARE_OOXMLEXPORT_TEST(testFdo74792, "fdo74792.docx")
{
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 2fe102c81bfd..dad9d275afa5 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3712,6 +3712,7 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S
// shape filled with the preview image
m_pSerializer->singleElementNS( XML_v, XML_imagedata,
FSNS( XML_r, XML_id ), OUStringToOString( sImageId, RTL_TEXTENCODING_UTF8 ).getStr(),
+ FSNS( XML_o, XML_title ), "",
FSEND );
m_pSerializer->endElementNS( XML_v, XML_shape );