summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.co.uk>2017-08-31 14:22:15 +0530
committerDennis Francis <dennis.francis@collabora.co.uk>2017-09-02 18:20:23 +0200
commit20169423d492b58ab93fb0e8e9d2918c0baebc92 (patch)
treef5ceea92ae9e66c424c62ac912180b1f7f32cff7
parent9a46ad2f762765348f7aef6e44774a47871362ae (diff)
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 With help from Markus Mohrhard, was able make a simple unit test working in subsequent_filters-test.cxx after adding the missing the component emfio to CppunitTest_sc_subsequent_filters_test.mk Change-Id: I7320dd537266e540d585d3fccfbb8665bba457c7 Reviewed-on: https://gerrit.libreoffice.org/41792 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Dennis Francis <dennis.francis@collabora.co.uk>
-rw-r--r--sc/CppunitTest_sc_subsequent_filters_test.mk1
-rw-r--r--sc/qa/unit/data/xlsm/tdf111974.xlsmbin0 -> 338812 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx10
-rw-r--r--sc/source/filter/oox/workbookfragment.cxx2
4 files changed, 12 insertions, 1 deletions
diff --git a/sc/CppunitTest_sc_subsequent_filters_test.mk b/sc/CppunitTest_sc_subsequent_filters_test.mk
index ea835c8aea02..e23869e164eb 100644
--- a/sc/CppunitTest_sc_subsequent_filters_test.mk
+++ b/sc/CppunitTest_sc_subsequent_filters_test.mk
@@ -75,6 +75,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_subsequent_filters_test,\
configmgr/source/configmgr \
dbaccess/util/dba \
embeddedobj/util/embobj \
+ emfio/emfio \
eventattacher/source/evtatt \
filter/source/config/cache/filterconfig1 \
forms/util/frm \
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
--- /dev/null
+++ b/sc/qa/unit/data/xlsm/tdf111974.xlsm
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 91f9b962a74f..30db8cd385a7 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -241,6 +241,7 @@ public:
void testTdf100709XLSX();
void testTdf97598XLSX();
void testTdf110440XLSX();
+ void testTdf111974XLSM();
void testTdf83672XLSX();
void testPageScalingXLSX();
@@ -370,6 +371,7 @@ public:
CPPUNIT_TEST(testTdf100709XLSX);
CPPUNIT_TEST(testTdf97598XLSX);
CPPUNIT_TEST(testTdf110440XLSX);
+ CPPUNIT_TEST(testTdf111974XLSM);
CPPUNIT_TEST(testTdf83672XLSX);
CPPUNIT_TEST(testPageScalingXLSX);
@@ -3813,6 +3815,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 17e51d8419e2..c52af23143d5 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();