summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-03-23 11:48:09 +0100
committerLuboš Luňák <l.lunak@collabora.com>2022-04-14 13:12:15 +0200
commit0de230a0a3edf64402cdeda379fd039fccda2462 (patch)
tree5fd54ae7e64544cf3464f656c6e01e1fad182f19 /sc/qa
parentba45318c942a0ed399d23b20bf82d7bd0ffa45ea (diff)
handle xlsx with too large sheets the same way as e.g. ods
The generic approach sets an error code on import and then SfxBaseModel::handleLoadError() takes care of it. This also allows checking for the warning in unittests. A drawback is that this generic approach can handle only one error code, so if a sheets has too many rows and column, there will be only one warning, but I consider that to be minor. Change-Id: I1d5f7f9162ef63c3c2e8414823d18a1ff50ad71e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131970 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/data/xlsx/too-many-cols-rows.xlsxbin0 -> 5526 bytes
-rw-r--r--sc/qa/unit/subsequent_filters_test2.cxx6
2 files changed, 6 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/too-many-cols-rows.xlsx b/sc/qa/unit/data/xlsx/too-many-cols-rows.xlsx
new file mode 100644
index 000000000000..45ef9a11f5e8
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/too-many-cols-rows.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters_test2.cxx b/sc/qa/unit/subsequent_filters_test2.cxx
index 70466d7816c8..ead6c8da4070 100644
--- a/sc/qa/unit/subsequent_filters_test2.cxx
+++ b/sc/qa/unit/subsequent_filters_test2.cxx
@@ -3061,6 +3061,12 @@ void ScFiltersTest2::testTooManyColsRows()
CPPUNIT_ASSERT(xDocSh->GetErrorCode() == SCWARN_IMPORT_ROW_OVERFLOW
|| xDocSh->GetErrorCode() == SCWARN_IMPORT_COLUMN_OVERFLOW);
xDocSh->DoClose();
+
+ xDocSh = loadDoc(u"too-many-cols-rows.", FORMAT_XLSX);
+ CPPUNIT_ASSERT(xDocSh.is());
+ CPPUNIT_ASSERT(xDocSh->GetErrorCode() == SCWARN_IMPORT_ROW_OVERFLOW
+ || xDocSh->GetErrorCode() == SCWARN_IMPORT_COLUMN_OVERFLOW);
+ xDocSh->DoClose();
}
CPPUNIT_TEST_SUITE_REGISTRATION(ScFiltersTest2);