sw/qa/extras/ooxmlexport/data/test_ole_object.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx           |    8 ++++++++
 sw/source/filter/ww8/docxattributeoutput.cxx       |    1 +
 3 files changed, 9 insertions(+)

New commits:
commit 7b7b64f26b9ef4ed717506f689d6d870305cb2bb
Author: Tushar Bende <tushar.be...@synerzip.com>
Date:   Wed Mar 5 11:25:35 2014 +0530

    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 <vmik...@collabora.co.uk>
    Tested-by: Miklos Vajna <vmik...@collabora.co.uk>

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 0000000..4391946
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/test_ole_object.docx 
differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 920f33a..383566c 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 2fe102c..dad9d27 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 );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to