[Libreoffice-commits] core.git: sw/qa sw/source

PriyankaGaikwad priyanka.gaikwad at synerzip.com
Wed Jul 2 01:20:32 PDT 2014


 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/ooxmlexport.cxx         |   39 +++++++++++++++++++++++
 sw/source/filter/ww8/docxattributeoutput.cxx     |   18 ++++++++++
 5 files changed, 57 insertions(+)

New commits:
commit f11d6421e4e61ce6f557ebd8272485f79968224e
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>

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 8683d56..0d03eb4 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3680,6 +3680,45 @@ DECLARE_OOXMLEXPORT_TEST(testfdo79969_xlsm, "fdo79969_xlsm.docx")
                 "/word/embeddings/oleObject1.xlsm");
 }
 
+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 fcd5794..1ff9d84 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4357,6 +4357,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";
@@ -4369,6 +4375,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";


More information about the Libreoffice-commits mailing list