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

Caolán McNamara caolanm at redhat.com
Wed Feb 18 12:29:08 PST 2015


 sc/source/core/data/formulacell.cxx       |    4 +++-
 sc/source/core/tool/grouparealistener.cxx |    6 ++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit f7f5fa0d36571b5103a54ed1281668cd23c4ecbc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 18 20:21:48 2015 +0000

    coverity#1267652 Logically dead code
    
    Change-Id: Ie36cf4193d2e202894e378b0094d399267291023

diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index d37b177..2d3522d 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -3882,9 +3882,11 @@ bool ScFormulaCell::InterpretInvariantFormulaGroup()
         ScAddress aTmpPos = aPos;
         aTmpPos.SetRow(mxGroup->mpTopCell->aPos.Row() + i);
         ScFormulaCell* pCell = pDocument->GetFormulaCell(aTmpPos);
-        assert( pCell != NULL );
         if (!pCell)
+        {
+            SAL_WARN("sc", "GetFormulaCell not found");
             continue;
+        }
 
         // FIXME: this set of horrors is unclear to me ... certainly
         // the above GetCell is profoundly nasty & slow ...
diff --git a/sc/source/core/tool/grouparealistener.cxx b/sc/source/core/tool/grouparealistener.cxx
index 6ff467c..17aa26a 100644
--- a/sc/source/core/tool/grouparealistener.cxx
+++ b/sc/source/core/tool/grouparealistener.cxx
@@ -188,9 +188,11 @@ void FormulaGroupAreaListener::collectFormulaCells(
             " mnTopCellRow " << mnTopCellRow << " length " << mnGroupLen);
 
     ScFormulaCell* const * pp = mpColumn->GetFormulaCellBlockAddress( mnTopCellRow);
-    assert(pp);
     if (!pp)
+    {
+        SAL_WARN("sc", "GetFormulaCellBlockAddress not found");
         return;
+    }
 
     ScFormulaCell* const * ppEnd = pp + mnGroupLen;
 
@@ -281,7 +283,7 @@ ScAddress FormulaGroupAreaListener::getTopCellPos() const
 const ScFormulaCell* FormulaGroupAreaListener::getTopCell() const
 {
     const ScFormulaCell* const * pp = mpColumn->GetFormulaCellBlockAddress( mnTopCellRow);
-    assert(pp);
+    SAL_WARN_IF(!pp, "sc", "GetFormulaCellBlockAddress not found");
     return pp ? *pp : NULL;
 }
 


More information about the Libreoffice-commits mailing list