summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/CppunitTest_sc_filters_test.mk1
-rw-r--r--sc/inc/testlotus.hxx16
-rw-r--r--sc/qa/unit/data/123/ofz9704.123bin0 -> 239 bytes
-rw-r--r--sc/qa/unit/filters-test.cxx11
-rw-r--r--sc/source/core/tool/compiler.cxx6
-rw-r--r--sc/source/filter/lotus/lotread.cxx1
6 files changed, 34 insertions, 1 deletions
diff --git a/sc/CppunitTest_sc_filters_test.mk b/sc/CppunitTest_sc_filters_test.mk
index 0a2b9a757362..32a9199a5031 100644
--- a/sc/CppunitTest_sc_filters_test.mk
+++ b/sc/CppunitTest_sc_filters_test.mk
@@ -40,6 +40,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_filters_test, \
salhelper \
sax \
sc \
+ scfilt \
scqahelper \
sfx \
sot \
diff --git a/sc/inc/testlotus.hxx b/sc/inc/testlotus.hxx
new file mode 100644
index 000000000000..aeaf359124f3
--- /dev/null
+++ b/sc/inc/testlotus.hxx
@@ -0,0 +1,16 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "scdll.hxx"
+
+class SvStream;
+
+extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportWKS(SvStream& rStream);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/unit/data/123/ofz9704.123 b/sc/qa/unit/data/123/ofz9704.123
new file mode 100644
index 000000000000..20464391a298
--- /dev/null
+++ b/sc/qa/unit/data/123/ofz9704.123
Binary files differ
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 144a5babac9e..1b8b99bda2db 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -33,6 +33,7 @@
#include <userdat.hxx>
#include <formulacell.hxx>
#include <tabprotection.hxx>
+#include <testlotus.hxx>
#include <dbdocfun.hxx>
#include <globalnames.hxx>
#include <dbdata.hxx>
@@ -72,6 +73,7 @@ public:
void testContentXLSX();
void testContentXLSXStrict(); // strict OOXML
void testContentLotus123();
+ void testContentofz9704();
void testContentDIF();
void testContentXLSB();
void testContentXLS_XML();
@@ -95,6 +97,7 @@ public:
CPPUNIT_TEST(testContentXLSX);
CPPUNIT_TEST(testContentXLSXStrict);
CPPUNIT_TEST(testContentLotus123);
+ CPPUNIT_TEST(testContentofz9704);
CPPUNIT_TEST(testContentDIF);
CPPUNIT_TEST(testContentXLSB);
CPPUNIT_TEST(testContentXLS_XML);
@@ -302,6 +305,14 @@ void ScFiltersTest::testContentLotus123()
xDocSh->DoClose();
}
+void ScFiltersTest::testContentofz9704()
+{
+ OUString aFileName;
+ createFileURL("ofz9704.", "123", aFileName);
+ SvFileStream aFileStream(aFileName, StreamMode::READ);
+ TestImportWKS(aFileStream);
+}
+
void ScFiltersTest::testContentDIF()
{
ScDocShellRef xDocSh = loadDoc("universal-content.", FORMAT_DIF);
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 899871d42404..54e816b5ff7a 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -5989,7 +5989,11 @@ void ScCompiler::PostProcessCode()
void ScCompiler::ReplaceDoubleRefII(FormulaToken** ppDoubleRefTok)
{
- const ScComplexRefData& rRange = *(*ppDoubleRefTok)->GetDoubleRef();
+ const ScComplexRefData* pRange = (*ppDoubleRefTok)->GetDoubleRef();
+ if (!pRange)
+ return;
+
+ const ScComplexRefData& rRange = *pRange;
// Can't do optimization reliably in this case (when row references are absolute).
// Example : =SIN(A$1:A$10) filled in a formula group starting at B5 and of length 100.
diff --git a/sc/source/filter/lotus/lotread.cxx b/sc/source/filter/lotus/lotread.cxx
index ee2ea3a434c6..5be4db478cfc 100644
--- a/sc/source/filter/lotus/lotread.cxx
+++ b/sc/source/filter/lotus/lotread.cxx
@@ -26,6 +26,7 @@
#include "lotfilter.hxx"
#include <lotimpop.hxx>
#include <lotattr.hxx>
+#include <testlotus.hxx>
#include <fprogressbar.hxx>
#include <sal/log.hxx>