sw/qa/extras/ooxmlexport/data/fdo79968.docx      |binary
 sw/qa/extras/ooxmlexport/data/fdo79969_xlsb.docx |binary
 sw/qa/extras/ooxmlexport/data/fdo79969_xlsm.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx         |   42 +++++++++++++++++++++++
 sw/source/filter/ww8/docxattributeoutput.cxx     |   18 +++++++++
 5 files changed, 60 insertions(+)

New commits:
commit 9f8785074512d6442fd97d67860fd625ac4d6bb1
Author: Yogesh Bharate <yogesh.bhar...@synerzip.com>
Date:   Fri Jun 13 16:15:16 2014 +0530

    fdo#79968: & fdo#79969: Fix for embedded powerpoint & excel sheet in docx.
    
    Problem Description:
    fdo#79968:
    1. Document contains embedded powerpoint in docx.
    2. After RT, embedded powerpoint object is not preserved.
    3. In this case, .sldx is get converted to .bin due to this powerpoint 
slides
    is getting converted to picture.
    
    fdo#79969:
    1. Document contains embedded excel work sheet.
    2. After RT, embedded excel sheet is not preserved.
    3. In this case, .xlsm is get converted to .xls.
    4. Similar case happened with binary excel work sheet.
    
    Implementation:
    Added sMediaType, sRelationType & sFileExtension for embedded excel sheet,
    binary excel sheet & powerpoint slide.
    
    Conflicts:
        sw/qa/extras/ooxmlexport/ooxmlexport.cxx
    Reviewed on:
        https://gerrit.libreoffice.org/9765
    
    Change-Id: I8f94e3f9293f2ac98b61f919d60ca556695b26c2

diff --git a/sw/qa/extras/ooxmlexport/data/fdo79968.docx 
b/sw/qa/extras/ooxmlexport/data/fdo79968.docx
new file mode 100644
index 0000000..2da7ddc
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo79968.docx differ
diff --git a/sw/qa/extras/ooxmlexport/data/fdo79969_xlsb.docx 
b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsb.docx
new file mode 100644
index 0000000..0e41399
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsb.docx 
differ
diff --git a/sw/qa/extras/ooxmlexport/data/fdo79969_xlsm.docx 
b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsm.docx
new file mode 100644
index 0000000..6fd11f3
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsm.docx 
differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 5b0244e..7368b46 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3648,6 +3648,48 @@ DECLARE_OOXMLEXPORT_TEST(testFDO78590, "FDO78590.docx")
     assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "h", 
"1669" );
 }
 
+DECLARE_OOXMLEXPORT_TEST(testfdo79968_sldx, "fdo79968.docx")
+{
+    // This UT for DOCX embedded with powerpoint slide
+    xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml");
+
+    if (!pXmlDoc)
+       return;
+
+    assertXPath(pXmlDoc,
+                
"/ContentType:Types/ContentType:Override[@ContentType='application/vnd.openxmlformats-officedocument.presentationml.slide']",
+                "PartName",
+                "/word/embeddings/oleObject1.sldx");
+}
+
+DECLARE_OOXMLEXPORT_TEST(testfdo79969_xlsb, "fdo79969_xlsb.docx")
+{
+    // This UT for DOCX embedded with binary excel work sheet.
+    xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml");
+
+    if (!pXmlDoc)
+       return;
+
+    assertXPath(pXmlDoc,
+                
"/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-excel.sheet.binary.macroEnabled.12']",
+                "PartName",
+                "/word/embeddings/oleObject1.xlsb");
+}
+
+DECLARE_OOXMLEXPORT_TEST(testfdo79969_xlsm, "fdo79969_xlsm.docx")
+{
+    // This UT for DOCX embedded with excel work sheet.
+    xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml");
+
+    if (!pXmlDoc)
+       return;
+
+    assertXPath(pXmlDoc,
+                
"/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-excel.sheet.macroEnabled.12']",
+                "PartName",
+                "/word/embeddings/oleObject1.xlsm");
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index ebaaecb..06230f4 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4328,6 +4328,18 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, 
const Size& rSize, const S
         sRelationType = 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";;
         sFileExtension = "xlsx";
     }
+    else if(sProgID.startsWith("Excel.SheetBinaryMacroEnabled.12") )
+    {
+        sMediaType = "application/vnd.ms-excel.sheet.binary.macroEnabled.12";
+        sRelationType = 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";;
+        sFileExtension = "xlsb";
+    }
+    else if( sProgID.startsWith("Excel.SheetMacroEnabled.12") )
+    {
+        sMediaType = "application/vnd.ms-excel.sheet.macroEnabled.12";
+        sRelationType = 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";;
+        sFileExtension = "xlsm";
+    }
     else if( sProgID.startsWith("Excel.Sheet") )
     {
         sMediaType = "application/vnd.ms-excel";
@@ -4346,6 +4358,12 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, 
const Size& rSize, const S
         sRelationType = 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";;
         sFileExtension = "ppt";
     }
+    else if (sProgID.startsWith("PowerPoint.Slide.12"))
+    {
+        sMediaType = 
"application/vnd.openxmlformats-officedocument.presentationml.slide";
+       sRelationType = 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";;
+       sFileExtension = "sldx";
+    }
     else
     {
         sMediaType = "application/vnd.openxmlformats-officedocument.oleObject";
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to