[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - 3 commits - sw/ooxmlexport_setup.mk sw/qa

Michael Stahl mstahl at redhat.com
Wed Dec 16 13:17:41 PST 2015


 sw/ooxmlexport_setup.mk                   |    1 
 sw/qa/extras/ooxmlexport/ooxmlexport2.cxx |    2 
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx |  104 ++++++++++++++++++++++++++++++
 3 files changed, 105 insertions(+), 2 deletions(-)

New commits:
commit b676e97dd30272171dc07c8e5ddc3e562f5ebb1a
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Dec 16 20:25:04 2015 +0100

    sw: extend some more OOXML export test to check embedded objects
    
    Change-Id: Ie1047a2a213632f05b0ae091a3a7e4118a271082
    (cherry picked from commit 988f1c71214870cb0a3df7d156eefd64e096bf0b)

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index b4b8896..0f68506 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -342,6 +342,19 @@ DECLARE_OOXMLEXPORT_TEST(testContentTypeOLE, "fdo77759.docx")
                 "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']",
                 "PartName",
                 "/word/embeddings/oleObject1.xlsx");
+
+    // check the rels too
+    xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
+    assertXPath(pXmlDocRels,
+        "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsx']",
+        "Type",
+        "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
+    // check the content too
+    xmlDocPtr pXmlDocContent = parseExport("word/document.xml");
+    assertXPath(pXmlDocContent,
+        "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject",
+        "ProgID",
+        "Excel.Sheet.12");
 }
 
 DECLARE_OOXMLEXPORT_TEST(testfdo78420, "fdo78420.docx")
@@ -547,6 +560,19 @@ DECLARE_OOXMLEXPORT_TEST(testfdo79968_sldx, "fdo79968.docx")
                 "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.openxmlformats-officedocument.presentationml.slide']",
                 "PartName",
                 "/word/embeddings/oleObject1.sldx");
+
+    // check the rels too
+    xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
+    assertXPath(pXmlDocRels,
+        "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.sldx']",
+        "Type",
+        "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
+    // check the content too
+    xmlDocPtr pXmlDocContent = parseExport("word/document.xml");
+    assertXPath(pXmlDocContent,
+        "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject",
+        "ProgID",
+        "PowerPoint.Slide.12");
 }
 
 DECLARE_OOXMLEXPORT_TEST(testfdo79969_xlsb, "fdo79969_xlsb.docx")
@@ -561,6 +587,19 @@ DECLARE_OOXMLEXPORT_TEST(testfdo79969_xlsb, "fdo79969_xlsb.docx")
                 "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-excel.sheet.binary.macroEnabled.12']",
                 "PartName",
                 "/word/embeddings/oleObject1.xlsb");
+
+    // check the rels too
+    xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
+    assertXPath(pXmlDocRels,
+        "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsb']",
+        "Type",
+        "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
+    // check the content too
+    xmlDocPtr pXmlDocContent = parseExport("word/document.xml");
+    assertXPath(pXmlDocContent,
+        "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject",
+        "ProgID",
+        "Excel.SheetBinaryMacroEnabled.12");
 }
 
 DECLARE_OOXMLEXPORT_TEST(testfdo80097, "fdo80097.docx")
@@ -638,6 +677,19 @@ DECLARE_OOXMLEXPORT_TEST(testfdo79969_xlsm, "fdo79969_xlsm.docx")
                 "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-excel.sheet.macroEnabled.12']",
                 "PartName",
                 "/word/embeddings/oleObject1.xlsm");
+
+    // check the rels too
+    xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
+    assertXPath(pXmlDocRels,
+        "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsm']",
+        "Type",
+        "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
+    // check the content too
+    xmlDocPtr pXmlDocContent = parseExport("word/document.xml");
+    assertXPath(pXmlDocContent,
+        "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject",
+        "ProgID",
+        "Excel.SheetMacroEnabled.12");
 }
 
 DECLARE_OOXMLEXPORT_TEST(testfdo80522,"fdo80522.docx")
@@ -651,6 +703,19 @@ DECLARE_OOXMLEXPORT_TEST(testfdo80522,"fdo80522.docx")
                 "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-word.document.macroEnabled.12']",
                 "PartName",
                 "/word/embeddings/oleObject1.docm");
+
+    // check the rels too
+    xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
+    assertXPath(pXmlDocRels,
+        "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.docm']",
+        "Type",
+        "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
+    // check the content too
+    xmlDocPtr pXmlDocContent = parseExport("word/document.xml");
+    assertXPath(pXmlDocContent,
+        "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject",
+        "ProgID",
+        "Word.DocumentMacroEnabled.12");
 }
 
 DECLARE_OOXMLEXPORT_TEST(testfdo80523_pptm,"fdo80523_pptm.docx")
@@ -664,6 +729,19 @@ DECLARE_OOXMLEXPORT_TEST(testfdo80523_pptm,"fdo80523_pptm.docx")
                 "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-powerpoint.presentation.macroEnabled.12']",
                 "PartName",
                 "/word/embeddings/oleObject1.pptm");
+
+    // check the rels too
+    xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
+    assertXPath(pXmlDocRels,
+        "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.pptm']",
+        "Type",
+        "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
+    // check the content too
+    xmlDocPtr pXmlDocContent = parseExport("word/document.xml");
+    assertXPath(pXmlDocContent,
+        "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject",
+        "ProgID",
+        "PowerPoint.ShowMacroEnabled.12");
 }
 
 DECLARE_OOXMLEXPORT_TEST(testfdo80523_sldm,"fdo80523_sldm.docx")
@@ -677,6 +755,19 @@ DECLARE_OOXMLEXPORT_TEST(testfdo80523_sldm,"fdo80523_sldm.docx")
                 "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-powerpoint.slide.macroEnabled.12']",
                 "PartName",
                 "/word/embeddings/oleObject1.sldm");
+
+    // check the rels too
+    xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
+    assertXPath(pXmlDocRels,
+        "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.sldm']",
+        "Type",
+        "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
+    // check the content too
+    xmlDocPtr pXmlDocContent = parseExport("word/document.xml");
+    assertXPath(pXmlDocContent,
+        "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject",
+        "ProgID",
+        "PowerPoint.SlideMacroEnabled.12");
 }
 
 DECLARE_OOXMLEXPORT_TEST(testfdo80898, "fdo80898.docx")
@@ -691,6 +782,19 @@ DECLARE_OOXMLEXPORT_TEST(testfdo80898, "fdo80898.docx")
                 "/ContentType:Types/ContentType:Override[@ContentType='application/msword']",
                 "PartName",
                 "/word/embeddings/oleObject1.doc");
+
+    // check the rels too
+    xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
+    assertXPath(pXmlDocRels,
+        "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.doc']",
+        "Type",
+        "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject");
+    // check the content too
+    xmlDocPtr pXmlDocContent = parseExport("word/document.xml");
+    assertXPath(pXmlDocContent,
+        "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject",
+        "ProgID",
+        "Word.Document.8");
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTableCellWithDirectFormatting, "fdo80800.docx")
commit 711bbd5a22ad66299babb843964032691d58e664
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Dec 16 22:12:46 2015 +0100

    Revert "temporarily disable testFdo51550, needs debugging"
    
    This reverts commit 31177c138a4a182a247ce1910dc9be10b08c4756.
    
    Fixed by adding unordf component.

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
index 5075d2f..a850c81 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
@@ -480,7 +480,6 @@ DECLARE_OOXMLEXPORT_TEST(testFdo51550, "fdo51550.odt")
     // so check that instead.
     uno::Reference<text::XTextEmbeddedObjectsSupplier> xTextEmbeddedObjectsSupplier(mxComponent, uno::UNO_QUERY);
     uno::Reference<container::XIndexAccess> xEmbeddedObjects(xTextEmbeddedObjectsSupplier->getEmbeddedObjects(), uno::UNO_QUERY);
-#if 0 // TODO FIXME why does it fail on 5.1 branch?
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xEmbeddedObjects->getCount());
 
     xmlDocPtr pXmlDocCT = parseExport("[Content_Types].xml");
@@ -502,7 +501,6 @@ DECLARE_OOXMLEXPORT_TEST(testFdo51550, "fdo51550.odt")
         "/w:document/w:body/w:p/w:r/w:object/o:OLEObject",
         "ProgID",
         "Excel.Sheet.12");
-#endif
 }
 
 /*
commit b3b7982f4690f4ac0f0e9680970ba544157c36dc
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Dec 16 22:11:49 2015 +0100

    sw: loading embedded ODF objects requires unordf component
    
    Change-Id: I4ed58b767d3fb52bdaa65b7732e67a79f26bcd04

diff --git a/sw/ooxmlexport_setup.mk b/sw/ooxmlexport_setup.mk
index 041ac9e..7b33349 100644
--- a/sw/ooxmlexport_setup.mk
+++ b/sw/ooxmlexport_setup.mk
@@ -66,6 +66,7 @@ define sw_ooxmlexport_components
 	ucb/source/ucp/file/ucpfile1 \
 	unotools/util/utl \
 	unoxml/source/service/unoxml \
+	unoxml/source/rdf/unordf \
 	uui/util/uui \
 	writerfilter/util/writerfilter \
 	xmloff/util/xo


More information about the Libreoffice-commits mailing list