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

Markus Mohrhard markus.mohrhard at googlemail.com
Fri Feb 15 18:37:17 PST 2013


 sc/source/core/data/attarray.cxx          |    2 +-
 sc/source/core/data/documen3.cxx          |    2 +-
 sc/source/core/data/documen4.cxx          |    3 ++-
 sc/source/core/tool/addincol.cxx          |    2 +-
 sc/source/core/tool/cellkeytranslator.cxx |    2 +-
 sc/source/core/tool/compiler.cxx          |    2 +-
 sc/source/ui/inc/checklistmenu.hxx        |    6 +++++-
 sc/source/ui/view/gridwin.cxx             |    6 +++---
 sd/source/core/sdpage.cxx                 |    1 +
 9 files changed, 16 insertions(+), 10 deletions(-)

New commits:
commit b491b5e0c0599446e3853eb0e0021d20c36e88f8
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 03:28:53 2013 +0100

    coverity: finally fix the memory leak correctly
    
    Change-Id: I1cd8978eba9f42aaa3d5e53085cac23f5e6a31ef

diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 9356e77..6299578 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -185,7 +185,8 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1,
                         // Zelle ein eigenes Array erhaelt!
                         aPos = ScAddress( j, k, *itr );
                         t->CalcRelFromAbs( aPos );
-                        pCell = new ScFormulaCell( this, aPos, aArr.Clone(), eGram, MM_REFERENCE );
+                        boost::scoped_ptr<ScTokenArray> pTokArr(aArr.Clone());
+                        pCell = new ScFormulaCell( this, aPos, pTokArr.get(), eGram, MM_REFERENCE );
                         maTabs[*itr]->PutCell(j, k, (ScBaseCell*) pCell);
                     }
                 }
commit 608521e9070156a43b9ee1f68db46aea671f08b9
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 03:28:12 2013 +0100

    coverity: we need a virtual d'tor here
    
    Change-Id: Ifb4cc80761611fbf398ee3cc1d56d104a2d2b5c9

diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx
index 1a36ae5..52066c3 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -218,7 +218,11 @@ public:
      * Extended data that the client code may need to store.  Create a
      * sub-class of this and store data there.
      */
-    struct ExtendedData {};
+    struct ExtendedData {
+
+    virtual ~ExtendedData() {}
+
+    };
 
     /**
      * Configuration options for this popup window.
commit bec878031af5ed1e533300d5f0fd93ac295b46db
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 03:06:54 2013 +0100

    coverity: missing break => memory leak
    
    Change-Id: I85292446e72acdf1afce2eff83e3aa9ae5e20546

diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 6bf3990..f9187be 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -329,6 +329,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
             Graphic aGraphic( aBmpEx );
             ( (SdrOle2Obj*) pSdrObj)->SetGraphic(&aGraphic);
         }
+        break;
 
         case PRESOBJ_TABLE:
         case PRESOBJ_CALC:
commit d46c1cc675b5bf94c8b19bf8fd24904dd9bfd881
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 02:54:57 2013 +0100

    fix indentation
    
    Change-Id: I22e22105f1dd226a0bf721b7087fa16afd2e468a

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index ee963dc..bafe363 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2598,11 +2598,11 @@ static void lcl_InitMouseEvent( ::com::sun::star::awt::MouseEvent& rEvent, const
     if ( rEvt.IsShift() )
         rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::SHIFT;
     if ( rEvt.IsMod1() )
-    rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1;
+        rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1;
     if ( rEvt.IsMod2() )
         rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2;
-        if ( rEvt.IsMod3() )
-                rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD3;
+    if ( rEvt.IsMod3() )
+        rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD3;
 
     rEvent.Buttons = 0;
     if ( rEvt.IsLeft() )
commit 16586efd12d226b2e5750de0b68b2a855acda353
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 02:00:16 2013 +0100

    coverity: copy & paste error
    
    Change-Id: I51c79d9b0d59b6de9b831ec8b4e9bf1a2642bd17

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 0da95b4..f9b9e9d 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -5056,7 +5056,7 @@ ScRangeData* ScCompiler::UpdateMoveTab( SCTAB nOldTab, SCTAB nNewTab,
                     if ( rRef2.IsTabRel() )
                         nTab2 = rRef2.nRelTab + nPosTab;
                     else
-                        nTab2 = rRef1.nTab;
+                        nTab2 = rRef2.nTab;
                     if ( nTab2 < nTab1 )
                     {   // PutInOrder
                         rRef1.nTab = nTab2;
commit d93d3232af0148e9ace67386efd597d5e2b1cef4
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 01:55:40 2013 +0100

    coverity: fix copy & paste error
    
    Change-Id: I8969b3152547d2d919c4bc41f2d7955763779bb8

diff --git a/sc/source/core/tool/cellkeytranslator.cxx b/sc/source/core/tool/cellkeytranslator.cxx
index afe8e5a..add7df3 100644
--- a/sc/source/core/tool/cellkeytranslator.cxx
+++ b/sc/source/core/tool/cellkeytranslator.cxx
@@ -45,7 +45,7 @@ enum LocaleMatch
 static LocaleMatch lclLocaleCompare(const Locale& rLocale1, const Locale& rLocale2)
 {
     LocaleMatch eMatchLevel = LOCALE_MATCH_NONE;
-    if ( !rLocale1.Language.compareTo(rLocale1.Language) )
+    if ( !rLocale1.Language.compareTo(rLocale2.Language) )
         eMatchLevel = LOCALE_MATCH_LANG;
     else
         return eMatchLevel;
commit e6522dd0337948ccd6e9007b8f095db65d21ad0f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 01:48:06 2013 +0100

    coverity: fix copy & paste error
    
    Change-Id: I5ac5d7c05da7652ae61d2f1925a3fe8e3aaf0d71

diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx
index 8f63781..8ab6e75 100644
--- a/sc/source/core/tool/addincol.cxx
+++ b/sc/source/core/tool/addincol.cxx
@@ -951,7 +951,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>&
                                             }
                                             catch(uno::Exception&)
                                             {
-                                                aArgName = "###";
+                                                aArgDesc = "###";
                                             }
 
                                             sal_Bool bOptional =
commit 47da977f5a2c90d28e7573b03203ac467159c23b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 01:12:44 2013 +0100

    coverity: prevent integer overflow
    
    Change-Id: If22c897ff97c584e98ab95301f89ed5c5b8bf7c2

diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 944241b..8e0fa5b 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1676,7 +1676,7 @@ static bool lcl_AddTwipsWhile( long & rTwips, long nStopTwips, SCROW & rPosY, SC
             {
                 sal_Int64 nDiff = nAdd + rTwips - nStopTwips;
                 nRows -= static_cast<SCROW>(nDiff / nHeight);
-                nAdd = nHeight * nRows;
+                nAdd = static_cast<sal_Int64>(nHeight) * nRows;
                 // We're looking for a value that satisfies loop condition.
                 if (nAdd + rTwips >= nStopTwips)
                 {
commit c3e573ce863bb9ff749d4be17692e245898d580f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 01:08:37 2013 +0100

    coverity: fix copy&paste error
    
    Change-Id: I706eef2373d37452afe6b044a052762da1c8a848

diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index f8f982a..ebf246a 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -1247,7 +1247,7 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const
                     if( pSet && pSet->GetItemState( ATTR_PROTECTION, true, &pItem ) == SFX_ITEM_SET )
                     {
                         const ScProtectionAttr* pCondProtect = static_cast<const ScProtectionAttr*>(pItem);
-                        if( pCondProtect->GetProtection() || pProtect->GetHideCell() )
+                        if( pCondProtect->GetProtection() || pCondProtect->GetHideCell() )
                             bFoundCond = true;
                         else
                             break;


More information about the Libreoffice-commits mailing list