[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - 3 commits - sw/qa sw/source

Dushyant Bhalgami dushyant.bhalgami at synerzip.com
Fri Jul 11 05:04:08 PDT 2014


 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/data/fdo80522.docx      |binary
 sw/qa/extras/ooxmlexport/data/fdo80523_pptm.docx |binary
 sw/qa/extras/ooxmlexport/data/fdo80523_sldm.docx |binary
 sw/qa/extras/ooxmlexport/data/fdo80898.docx      |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx         |   96 +++++++++++++++++++++++
 sw/source/filter/ww8/docxattributeoutput.cxx     |   43 ++++++++++
 9 files changed, 139 insertions(+)

New commits:
commit 6b76a1855a60fce90eb09e3d40a79dca0c5901bd
Author: Dushyant Bhalgami <dushyant.bhalgami at synerzip.com>
Date:   Fri Jul 4 13:35:54 2014 +0530

    fdo#80898:Fix for embedded obj 97-2003 MS Doc File
    
    Added implementation for embedded Word 97-2003 document.
    
    Change-Id: I47ec39f25beee9a37f2a1e914384bc458df31b78
    Reviewed-on: https://gerrit.libreoffice.org/10078
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 163b5fd59fe1e9b8c8a1bcac9dab069c0bcd27e9)
    Signed-off-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/qa/extras/ooxmlexport/data/fdo80898.docx b/sw/qa/extras/ooxmlexport/data/fdo80898.docx
new file mode 100644
index 0000000..d4b9e1f
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo80898.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index da32d57..312d9d9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3595,6 +3595,20 @@ DECLARE_OOXMLEXPORT_TEST(testfdo80523_sldm,"fdo80523_sldm.docx")
                 "/word/embeddings/oleObject1.sldm");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testfdo80898, "fdo80898.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/msword']",
+                "PartName",
+                "/word/embeddings/oleObject1.doc");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 0e7538a..3b71536 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4199,6 +4199,13 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S
         sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
         sFileExtension = "docm";
     }
+    //Implementation for embedded Word 97-2003 document was missing
+    else if( sProgID == "Word.Document.8" )
+    {
+        sMediaType = "application/msword";
+        sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";
+        sFileExtension = "doc";
+    }
     else
     {
         sMediaType = "application/vnd.openxmlformats-officedocument.oleObject";
commit 1f9e3661ee2ca8334dc228c65cfc23442c2a9c39
Author: PriyankaGaikwad <priyanka.gaikwad at synerzip.com>
Date:   Thu Jun 26 18:07:26 2014 +0530

    fdo#80522 & fdo#80523:Embedded Macro-Enabled objects are not preserved
    
    Description :
    fdo#80522
    - DOCX contain embedded word Macro-Enabled document.
    - Embedded word Macro-Enabled object is not preserved.
    - .docm preserved as .bin so word Macro-Enabled document is converted to picture.
    
    fdo#80523
    1) Embedded PowerPoint Macro-Enabled Slide
       - DOCX contain embedded PowerPoint Macro-Enabled Slide
       - Embedded PowerPoint Macro-Enabled Slide is not preserved.
       - .sldm preserved as .bin so powerpoint Macro-Enabled slide is converted to picture.
    2) Embedded PowerPoint Macro-Enabled Presentation
       - same case with embedded PowerPoint Macro-Enabled Presentation
       - Embedded PowerPoint Macro-Enabled presentation is not preserved.
       - .pptm preserved as .pptx so powerpoint Macro-Enabled presentation is converted to picture .
    
    Implementation :
    Added sMediaType, sRelationType & sFileExtension for these embedded objects.
    
    Change-Id: Ia58662ba921f3d940e8ead04a7f7ae83689a3b35
    Reviewed-on: https://gerrit.libreoffice.org/9917
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit f11d6421e4e61ce6f557ebd8272485f79968224e)
    Signed-off-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/qa/extras/ooxmlexport/data/fdo80522.docx b/sw/qa/extras/ooxmlexport/data/fdo80522.docx
new file mode 100644
index 0000000..9445b73
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo80522.docx differ
diff --git a/sw/qa/extras/ooxmlexport/data/fdo80523_pptm.docx b/sw/qa/extras/ooxmlexport/data/fdo80523_pptm.docx
new file mode 100644
index 0000000..3140f3b
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo80523_pptm.docx differ
diff --git a/sw/qa/extras/ooxmlexport/data/fdo80523_sldm.docx b/sw/qa/extras/ooxmlexport/data/fdo80523_sldm.docx
new file mode 100644
index 0000000..e50cda1
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo80523_sldm.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index c62b750..da32d57 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3556,6 +3556,45 @@ DECLARE_OOXMLEXPORT_TEST(testfdo79817,"fdo79817.docx")
 
 #endif
 
+DECLARE_OOXMLEXPORT_TEST(testfdo80522,"fdo80522.docx")
+{
+   xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml");
+
+    if (!pXmlDoc)
+       return;
+
+    assertXPath(pXmlDoc,
+                "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-word.document.macroEnabled.12']",
+                "PartName",
+                "/word/embeddings/oleObject1.docm");
+}
+
+DECLARE_OOXMLEXPORT_TEST(testfdo80523_pptm,"fdo80523_pptm.docx")
+{
+   xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml");
+
+    if (!pXmlDoc)
+       return;
+
+    assertXPath(pXmlDoc,
+                "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-powerpoint.presentation.macroEnabled.12']",
+                "PartName",
+                "/word/embeddings/oleObject1.pptm");
+}
+
+DECLARE_OOXMLEXPORT_TEST(testfdo80523_sldm,"fdo80523_sldm.docx")
+{
+   xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml");
+
+    if (!pXmlDoc)
+       return;
+
+    assertXPath(pXmlDoc,
+                "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-powerpoint.slide.macroEnabled.12']",
+                "PartName",
+                "/word/embeddings/oleObject1.sldm");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 7b2db2e..0e7538a 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4169,6 +4169,12 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S
         sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
         sFileExtension = "pptx";
     }
+    else if(sProgID == "PowerPoint.ShowMacroEnabled.12")
+    {
+        sMediaType = "application/vnd.ms-powerpoint.presentation.macroEnabled.12";
+        sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
+        sFileExtension = "pptm";
+    }
     else if( sProgID.startsWith("PowerPoint.Show") )
     {
         sMediaType = "application/vnd.ms-powerpoint";
@@ -4181,6 +4187,18 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S
        sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
        sFileExtension = "sldx";
     }
+    else if( sProgID == "PowerPoint.SlideMacroEnabled.12" )
+    {
+       sMediaType = "application/vnd.ms-powerpoint.slide.macroEnabled.12";
+       sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
+       sFileExtension = "sldm";
+    }
+    else if( sProgID == "Word.DocumentMacroEnabled.12" )
+    {
+        sMediaType = "application/vnd.ms-word.document.macroEnabled.12";
+        sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
+        sFileExtension = "docm";
+    }
     else
     {
         sMediaType = "application/vnd.openxmlformats-officedocument.oleObject";
commit de0d60327e2cd274f55e73417d3281e4a81b2271
Author: Yogesh Bharate <yogesh.bharate at 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.
    
    Signed-off-by: Michael Stahl <mstahl at redhat.com>
    
    Conflicts:
    	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
    Reviewed on:
    	https://gerrit.libreoffice.org/9765
    
    (cherry picked from commit 9f8785074512d6442fd97d67860fd625ac4d6bb1)
    
    Conflicts:
    	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
    
    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 4d02d31..c62b750 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1657,6 +1657,49 @@ DECLARE_OOXMLEXPORT_TEST(testFdo69644, "fdo69644.docx")
     assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol", 5);
 }
 
+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");
+}
+
+
 DECLARE_OOXMLEXPORT_TEST(testCp1000015, "cp1000015.odt")
 {
     // Redline and hyperlink end got exported in an incorrect order.
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index edcd130..7b2db2e 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4145,6 +4145,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";
@@ -4163,6 +4175,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";


More information about the Libreoffice-commits mailing list