[Libreoffice-commits] core.git: sc/source

Caolán McNamara caolanm at redhat.com
Tue Nov 28 20:28:19 UTC 2017


 sc/source/filter/inc/formel.hxx     |    2 ++
 sc/source/filter/lotus/lotimpop.cxx |    2 ++
 sc/source/filter/lotus/op.cxx       |    4 ++--
 3 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit c97d4caf43d8f8c5d26ccddc92896c4a42633d0e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 28 15:52:09 2017 +0000

    ofz#4412 bail on failure in Formulacell too
    
    Change-Id: Ie7f9e4309ae8468947dce12355201d038e7e63fa
    Reviewed-on: https://gerrit.libreoffice.org/45428
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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())


More information about the Libreoffice-commits mailing list