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

Dennis Francis dennis.francis at collabora.co.uk
Thu Sep 7 12:42:31 UTC 2017


 sc/qa/unit/data/xlsm/tdf111974.xlsm       |binary
 sc/qa/unit/subsequent_filters-test.cxx    |   10 ++++++++++
 sc/source/filter/oox/workbookfragment.cxx |    2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 0b172f1d95c726c3e0bbc0b58a8605bf06bf6c67
Author: Dennis Francis <dennis.francis at collabora.co.uk>
Date:   Thu Aug 31 14:22:15 2017 +0530

    tdf#111974: Ensure sufficient space for all sheets in FormulaBuffer...
    
    and not just for the number of sheet fragments. This is important
    because we changed the internal storage of FormulaBuffer from based
    on std::map to std::vector in d17a83fa549f828f29e6939b16ba8b568a75f95e
    
    Added simple unit test that loads the bugdoc in
    subsequent_filters-test.cxx
    
    Reviewed-on: https://gerrit.libreoffice.org/41792
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Dennis Francis <dennis.francis at collabora.co.uk>
    (cherry picked from commit 20169423d492b58ab93fb0e8e9d2918c0baebc92)
    
    Change-Id: I7320dd537266e540d585d3fccfbb8665bba457c7
    Reviewed-on: https://gerrit.libreoffice.org/41841
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/qa/unit/data/xlsm/tdf111974.xlsm b/sc/qa/unit/data/xlsm/tdf111974.xlsm
new file mode 100644
index 000000000000..bb6ac6d0a2d3
Binary files /dev/null and b/sc/qa/unit/data/xlsm/tdf111974.xlsm differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 6ba489456805..c619d71232c6 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -240,6 +240,7 @@ public:
     void testTdf100709XLSX();
     void testTdf97598XLSX();
     void testTdf110440XLSX();
+    void testTdf111974XLSM();
 
     CPPUNIT_TEST_SUITE(ScFiltersTest);
     CPPUNIT_TEST(testBooleanFormatXLSX);
@@ -361,6 +362,7 @@ public:
     CPPUNIT_TEST(testTdf100709XLSX);
     CPPUNIT_TEST(testTdf97598XLSX);
     CPPUNIT_TEST(testTdf110440XLSX);
+    CPPUNIT_TEST(testTdf111974XLSM);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -3784,6 +3786,14 @@ void ScFiltersTest::testTdf110440XLSX()
     xDocSh->DoClose();
 }
 
+void ScFiltersTest::testTdf111974XLSM()
+{
+    // Would crash without the fix on loading
+    ScDocShellRef xDocSh = loadDoc("tdf111974.", FORMAT_XLSM);
+    CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.is());
+    xDocSh->DoClose();
+}
+
 void ScFiltersTest::testBnc762542()
 {
     ScDocShellRef xDocSh = loadDoc("bnc762542.", FORMAT_XLSX);
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index 72d2985e536f..49343a831b22 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -450,7 +450,7 @@ void WorkbookFragment::finalizeImport()
     }
 
     // setup structure sizes for the number of sheets
-    getFormulaBuffer().SetSheetCount( aSheetFragments.size() );
+    getFormulaBuffer().SetSheetCount( nWorksheetCount );
 
     // create all database ranges and defined names, in that order
     getTables().finalizeImport();


More information about the Libreoffice-commits mailing list