[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - oox/source sc/qa

Miklos Vajna vmiklos at collabora.co.uk
Thu Aug 10 12:56:36 UTC 2017


 oox/source/drawingml/shapegroupcontext.cxx |    2 +-
 sc/qa/unit/data/xlsx/tdf110440.xlsx        |binary
 sc/qa/unit/subsequent_filters-test.cxx     |   21 +++++++++++++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)

New commits:
commit db47b53bcd758a5e403d31642f7574f441ca739e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Aug 7 21:28:30 2017 +0200

    tdf#110440 drawingML import: fix handling of group shape properties
    
    The handler for nvGrpSpPr is "this class", not "no class".
    
    (cherry picked from commit a3c695c12386c2708a0c06ec0ccd42ee2b8aeb98)
    
    Change-Id: I7fc40681d77f94b7473d2f677d813d2ae246f6ac
    Reviewed-on: https://gerrit.libreoffice.org/40863
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/oox/source/drawingml/shapegroupcontext.cxx b/oox/source/drawingml/shapegroupcontext.cxx
index e7c39af3a619..c21a38995cc7 100644
--- a/oox/source/drawingml/shapegroupcontext.cxx
+++ b/oox/source/drawingml/shapegroupcontext.cxx
@@ -79,7 +79,7 @@ ContextHandlerRef ShapeGroupContext::onCreateContext( sal_Int32 aElementToken, c
     case XML_grpSpPr:
         return new ShapePropertiesContext( *this, *mpGroupShapePtr );
     case XML_nvGrpSpPr:
-        return nullptr;
+        return this;
     case XML_spPr:
         return new ShapePropertiesContext( *this, *mpGroupShapePtr );
 /*
diff --git a/sc/qa/unit/data/xlsx/tdf110440.xlsx b/sc/qa/unit/data/xlsx/tdf110440.xlsx
new file mode 100644
index 000000000000..da849d0bd310
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf110440.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 7ca68d89f6e8..6ba489456805 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -239,6 +239,7 @@ public:
     void testTdf100458();
     void testTdf100709XLSX();
     void testTdf97598XLSX();
+    void testTdf110440XLSX();
 
     CPPUNIT_TEST_SUITE(ScFiltersTest);
     CPPUNIT_TEST(testBooleanFormatXLSX);
@@ -359,6 +360,7 @@ public:
     CPPUNIT_TEST(testTdf100458);
     CPPUNIT_TEST(testTdf100709XLSX);
     CPPUNIT_TEST(testTdf97598XLSX);
+    CPPUNIT_TEST(testTdf110440XLSX);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -3763,6 +3765,25 @@ void ScFiltersTest::testColumnStyle2XLSX()
     xDocSh->DoClose();
 }
 
+void ScFiltersTest::testTdf110440XLSX()
+{
+    ScDocShellRef xDocSh = loadDoc("tdf110440.", FORMAT_XLSX);
+    CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.is());
+
+    uno::Reference<frame::XModel> xModel = xDocSh->GetModel();
+    uno::Reference<sheet::XSpreadsheetDocument> xDoc(xModel, uno::UNO_QUERY_THROW);
+    uno::Reference<container::XIndexAccess> xIA(xDoc->getSheets(), uno::UNO_QUERY_THROW);
+    uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xIA->getByIndex(0), uno::UNO_QUERY_THROW);
+    xIA.set(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW);
+    uno::Reference<beans::XPropertySet> xShape(xIA->getByIndex(0), uno::UNO_QUERY_THROW);
+    bool bVisible = true;
+    xShape->getPropertyValue("Visible") >>= bVisible;
+    // This failed: group shape's hidden property was lost on import.
+    CPPUNIT_ASSERT(!bVisible);
+
+    xDocSh->DoClose();
+}
+
 void ScFiltersTest::testBnc762542()
 {
     ScDocShellRef xDocSh = loadDoc("bnc762542.", FORMAT_XLSX);


More information about the Libreoffice-commits mailing list