summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-11-28 15:52:09 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-11-28 21:27:46 +0100
commitc97d4caf43d8f8c5d26ccddc92896c4a42633d0e (patch)
tree105fda2e908519a8e177c698635f322c27a27f1e
parent51a1fb0beb813624b5bc3255a889f9d630ccb0d4 (diff)
ofz#4412 bail on failure in Formulacell too
Change-Id: Ie7f9e4309ae8468947dce12355201d038e7e63fa Reviewed-on: https://gerrit.libreoffice.org/45428 Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/filter/inc/formel.hxx2
-rw-r--r--sc/source/filter/lotus/lotimpop.cxx2
-rw-r--r--sc/source/filter/lotus/op.cxx4
3 files changed, 6 insertions, 2 deletions
diff --git a/sc/source/filter/inc/formel.hxx b/sc/source/filter/inc/formel.hxx
index aa7944161439..da1ba8ae1a3d 100644
--- a/sc/source/filter/inc/formel.hxx
+++ b/sc/source/filter/inc/formel.hxx
@@ -130,6 +130,8 @@ public:
virtual void Convert( const ScTokenArray*& rpErg, sal_Int32& nRest ) = 0;
+ bool good() const { return aIn.good(); }
+
protected:
using ConverterBase::Reset;
};
diff --git a/sc/source/filter/lotus/lotimpop.cxx b/sc/source/filter/lotus/lotimpop.cxx
index 62fe76b8774e..00ccefab0ee3 100644
--- a/sc/source/filter/lotus/lotimpop.cxx
+++ b/sc/source/filter/lotus/lotimpop.cxx
@@ -275,6 +275,8 @@ void ImportLotus::Formulacell( sal_uInt16 n )
aConv.Reset( aAddr );
aConv.SetWK3();
aConv.Convert( pErg, nRest );
+ if (!aConv.good())
+ return;
ScFormulaCell* pCell = pErg ? new ScFormulaCell(pD, aAddr, *pErg) : new ScFormulaCell(pD, aAddr);
pCell->AddRecalcMode( ScRecalcMode::ONLOAD_ONCE );
diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index 6491b0c08ae1..295cd2804da0 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -151,7 +151,7 @@ void OP_Formula(LotusContext &rContext, SvStream& r, sal_uInt16 /*n*/)
LotusToSc aConv(rContext, r, rSPool, rContext.pLotusRoot->eCharsetQ, false);
aConv.Reset( aAddress );
aConv.Convert( pErg, nBytesLeft );
- if (!r.good())
+ if (!aConv.good())
return;
if (ValidColRow(nCol, nRow))
@@ -401,7 +401,7 @@ void OP_Formula123(LotusContext& rContext, SvStream& r, sal_uInt16 n)
LotusToSc aConv(rContext, r, rSPool, rContext.pLotusRoot->eCharsetQ, true);
aConv.Reset( aAddress );
aConv.Convert( pErg, nBytesLeft );
- if (!r.good())
+ if (!aConv.good())
return;
if (ValidColRow(nCol, nRow) && nTab <= rContext.pDoc->GetMaxTableNumber())