[Libreoffice-commits] .: 4 commits - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Aug 28 06:32:32 PDT 2012


 sc/source/core/data/conditio.cxx               |    2 -
 sc/source/filter/xml/XMLStylesImportHelper.cxx |   33 ++++++++-----------------
 sc/source/filter/xml/xmlcelli.cxx              |   30 +++-------------------
 3 files changed, 16 insertions(+), 49 deletions(-)

New commits:
commit 309b4e24d2507a93a0825dff2a6df13859e9487e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Aug 28 02:59:39 2012 +0200

    don't crash for invalid repaint ranges in cond formats, fdo#53839
    
    Change-Id: I83cbb2574849c69fba3ca315d7507358654ff2b9

diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 1438a78..4a842fb 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1123,7 +1123,7 @@ void ScConditionEntry::SourceChanged( const ScAddress& rChanged )
                         ScRange aPaint( nCol1,nRow1,nTab1, nCol2,nRow2,nTab2 );
 
                         //  kein Paint, wenn es nur die Zelle selber ist
-                        if ( aPaint.aStart != rChanged || aPaint.aEnd != rChanged )
+                        if ( aPaint.IsValid() && (aPaint.aStart != rChanged || aPaint.aEnd != rChanged ))
                             DataChanged( &aPaint );
                     }
                 }
commit fd1fad4f4228630fa244820e5f0314c5835c5333
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Aug 24 22:58:48 2012 +0200

    remove some more null pointer checks before delete
    
    Change-Id: I5997f0440a8a4875e800e830df211e8108752b37

diff --git a/sc/source/filter/xml/XMLStylesImportHelper.cxx b/sc/source/filter/xml/XMLStylesImportHelper.cxx
index 438ac0e..c40ba95 100644
--- a/sc/source/filter/xml/XMLStylesImportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesImportHelper.cxx
@@ -264,22 +264,16 @@ ScMyStylesImportHelper::ScMyStylesImportHelper(ScXMLImport& rTempImport)
 
 ScMyStylesImportHelper::~ScMyStylesImportHelper()
 {
-    if (pPrevStyleName)
-        delete pPrevStyleName;
-    if (pPrevCurrency)
-        delete pPrevCurrency;
-    if (pStyleName)
-        delete pStyleName;
-    if (pCurrency)
-        delete pCurrency;
+    delete pPrevStyleName;
+    delete pPrevCurrency;
+    delete pStyleName;
+    delete pCurrency;
 }
 
 void ScMyStylesImportHelper::ResetAttributes()
 {
-    if (pPrevStyleName)
-        delete pPrevStyleName;
-    if (pPrevCurrency)
-        delete pPrevCurrency;
+    delete pPrevStyleName;
+    delete pPrevCurrency;
     pPrevStyleName = pStyleName;
     pPrevCurrency = pCurrency;
     nPrevCellType = nCellType;
@@ -331,8 +325,7 @@ void ScMyStylesImportHelper::AddDefaultRange(const ScRange& rRange)
                     ScRange aRange(rRange);
                     aRange.aStart.SetCol(nStartCol);
                     aRange.aEnd.SetCol(i - 1);
-                    if (pPrevStyleName)
-                        delete pPrevStyleName;
+                    delete pPrevStyleName;
                     pPrevStyleName = new rtl::OUString(aPrevItr->sStyleName);
                     AddSingleRange(aRange);
                     nStartCol = i;
@@ -343,8 +336,7 @@ void ScMyStylesImportHelper::AddDefaultRange(const ScRange& rRange)
             {
                 ScRange aRange(rRange);
                 aRange.aStart.SetCol(nStartCol);
-                if (pPrevStyleName)
-                    delete pPrevStyleName;
+                delete pPrevStyleName;
                 pPrevStyleName = new rtl::OUString(aPrevItr->sStyleName);
                 AddSingleRange(aRange);
             }
@@ -360,8 +352,7 @@ void ScMyStylesImportHelper::AddDefaultRange(const ScRange& rRange)
     }
     else
     {
-        if (pPrevStyleName)
-            delete pPrevStyleName;
+        delete pPrevStyleName;
         pPrevStyleName = new rtl::OUString(aRowDefaultStyle->sStyleName);
         AddSingleRange(rRange);
     }
@@ -411,10 +402,8 @@ void ScMyStylesImportHelper::SetRowStyle(const rtl::OUString& sStyleName)
 void ScMyStylesImportHelper::SetAttributes(rtl::OUString* pStyleNameP,
     rtl::OUString* pCurrencyP, const sal_Int16 nCellTypeP)
 {
-    if (this->pStyleName)
-        delete this->pStyleName;
-    if (this->pCurrency)
-        delete this->pCurrency;
+    delete this->pStyleName;
+    delete this->pCurrency;
     this->pStyleName = pStyleNameP;
     this->pCurrency = pCurrencyP;
     this->nCellType = nCellTypeP;
commit 06784203728ae5c03edd2a5e311fae532c3e7a12
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Aug 24 22:55:18 2012 +0200

    remove redundant function
    
    Change-Id: If082663aea3e5ed4d242997a1fdd3fd2769daf8d

diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index f1e49fe..3b6ca50 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -511,25 +511,6 @@ ScValidErrorStyle validAlertToValidError( const sheet::ValidationAlertStyle eVAl
     return eVErrStyle;
 }
 
-ScConditionMode conditionOpToMode( const sheet::ConditionOperator eOp )
-{
-    ScConditionMode eMode;
-    switch( eOp )
-    {
-        case sheet::ConditionOperator_EQUAL:            eMode = SC_COND_EQUAL;      break;
-        case sheet::ConditionOperator_NOT_EQUAL:        eMode = SC_COND_NOTEQUAL;   break;
-        case sheet::ConditionOperator_GREATER:          eMode = SC_COND_GREATER;    break;
-        case sheet::ConditionOperator_GREATER_EQUAL:    eMode = SC_COND_EQGREATER;  break;
-        case sheet::ConditionOperator_LESS:             eMode = SC_COND_LESS;       break;
-        case sheet::ConditionOperator_LESS_EQUAL:       eMode = SC_COND_EQLESS;     break;
-        case sheet::ConditionOperator_BETWEEN:          eMode = SC_COND_BETWEEN;    break;
-        case sheet::ConditionOperator_NOT_BETWEEN:      eMode = SC_COND_NOTBETWEEN; break;
-        case sheet::ConditionOperator_FORMULA:          eMode = SC_COND_DIRECT;     break;
-        default:                                        eMode = SC_COND_NONE;       break;
-    }
-    return eMode;
-}
-
 }
 
 void ScXMLTableRowCellContext::SetContentValidation( const ScRange& rScRange )
@@ -543,7 +524,7 @@ void ScXMLTableRowCellContext::SetContentValidation( const ScRange& rScRange )
         {
             ScValidationData aScValidationData(
                 validationTypeToMode(aValidation.aValidationType),
-                conditionOpToMode(aValidation.aOperator),
+                ScConditionEntry::GetModeFromApi(static_cast<sal_Int32>(aValidation.aOperator)),
                 aValidation.sFormula1, aValidation.sFormula2, pDoc, ScAddress(),
                 aValidation.sFormulaNmsp1, aValidation.sFormulaNmsp2,
                 aValidation.eGrammar1, aValidation.eGrammar2
commit 176598dbbee3d6e14893de11c08401a00cdd87aa
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Aug 24 22:51:47 2012 +0200

    remove useless null pointer checks before delete
    
    Change-Id: I33ba84aebcb8d8abec4af13f9c0bb12a3364d8de

diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index e09868f..f1e49fe 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -273,12 +273,9 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
 
 ScXMLTableRowCellContext::~ScXMLTableRowCellContext()
 {
-    if (pContentValidationName)
-        delete pContentValidationName;
-    if (pDetectiveObjVec)
-        delete pDetectiveObjVec;
-    if (pCellRangeSource)
-        delete pCellRangeSource;
+    delete pContentValidationName;
+    delete pDetectiveObjVec;
+    delete pCellRangeSource;
 }
 
 void ScXMLTableRowCellContext::LockSolarMutex()


More information about the Libreoffice-commits mailing list