[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sd/qa xmloff/source

Michael Stahl mstahl at redhat.com
Wed Apr 16 05:15:05 PDT 2014


 sd/qa/unit/data/odp/fdo77027.odp |binary
 sd/qa/unit/import-tests.cxx      |   37 +++++++++++++++++++++++++++++++++++++
 xmloff/source/draw/ximpshap.cxx  |    2 +-
 3 files changed, 38 insertions(+), 1 deletion(-)

New commits:
commit 192963c3c1959389cb78e80bbc3e22e49fabcc73
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Apr 15 23:34:37 2014 +0200

    fdo#77027: ODF import: fix wrong version in check for embedded objects
    
    SvXMLImport::LO_4x does not mean 4.0+ any more.
    
    (regression from 92cb21ebeda98c5193c50c4cf7ef3d60611c2a52)
    
    (cherry picked from commit 25a2eab22798373b8197f1e594568207eb7c5039)
    
    Conflicts:
    	sd/qa/unit/import-tests.cxx
    
    Change-Id: Ib444762c2d6e4d051e99962eaff1b1ed34af983a
    Reviewed-on: https://gerrit.libreoffice.org/9064
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/qa/unit/data/odp/fdo77027.odp b/sd/qa/unit/data/odp/fdo77027.odp
new file mode 100644
index 0000000..4d834d4
Binary files /dev/null and b/sd/qa/unit/data/odp/fdo77027.odp differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 991f5fe..7fddb39 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -18,6 +18,10 @@
 
 #include <svx/svdotext.hxx>
 #include <svx/svdoashp.hxx>
+#include <svx/svdogrp.hxx>
+#include <svx/svdomedia.hxx>
+#include <svx/svdoole2.hxx>
+#include <svx/xflclit.hxx>
 #include <animations/animationnodehelper.hxx>
 
 #include <com/sun/star/drawing/XDrawPage.hpp>
@@ -43,6 +47,7 @@ class SdFiltersTest : public SdModelTestBase
 public:
     void testDocumentLayout();
     void testSmoketest();
+    void testFdo77027();
     void testN759180();
     void testN778859();
     void testFdo64512();
@@ -53,6 +58,7 @@ public:
     CPPUNIT_TEST_SUITE(SdFiltersTest);
     CPPUNIT_TEST(testDocumentLayout);
     CPPUNIT_TEST(testSmoketest);
+    CPPUNIT_TEST(testFdo77027);
     CPPUNIT_TEST(testN759180);
     CPPUNIT_TEST(testN778859);
     CPPUNIT_TEST(testFdo64512);
@@ -243,6 +249,37 @@ void SdFiltersTest::testN778859()
     }
 }
 
+// FIXME copypasta
+std::ostream& operator<<(std::ostream& rStrm, const Color& rColor)
+{
+    rStrm << "Color: R:" << rColor.GetRed() << " G:" << rColor.GetGreen() << " B: << rColor.GetBlue()";
+    return rStrm;
+}
+
+void SdFiltersTest::testFdo77027()
+{
+    ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/odp/fdo77027.odp"));
+
+    SdDrawDocument *pDoc = xDocShRef->GetDoc();
+    CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
+    const SdrPage *pPage = pDoc->GetPage(1);
+    CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
+    {
+        SdrOle2Obj *const pObj = dynamic_cast<SdrOle2Obj*>(pPage->GetObj(0));
+        CPPUNIT_ASSERT(pObj);
+
+        // check that the fill style/color was actually imported
+        const XFillStyleItem& rStyleItem = dynamic_cast<const XFillStyleItem&>(
+                pObj->GetMergedItem(XATTR_FILLSTYLE));
+        CPPUNIT_ASSERT_EQUAL(XFILL_SOLID, rStyleItem.GetValue());
+        const XFillColorItem& rColorItem = dynamic_cast<const XFillColorItem&>(
+                pObj->GetMergedItem(XATTR_FILLCOLOR));
+        CPPUNIT_ASSERT_EQUAL(Color(0xff6600), rColorItem.GetColorValue());
+    }
+
+    xDocShRef->DoClose();
+}
+
 void SdFiltersTest::testFdo64512()
 {
     ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/fdo64512.odp"));
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index bb3a49f..ae94d31 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -2677,7 +2677,7 @@ void SdXMLObjectShapeContext::StartElement( const ::com::sun::star::uno::Referen
 void SdXMLObjectShapeContext::EndElement()
 {
     if (GetImport().isGeneratorVersionOlderThan(
-                SvXMLImport::OOo_34x, SvXMLImport::LO_4x))
+                SvXMLImport::OOo_34x, SvXMLImport::LO_41x)) // < LO 4.0
     {
         // #i118485#
         // If it's an old file from us written before OOo3.4, we need to correct


More information about the Libreoffice-commits mailing list