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

Markus Mohrhard markus.mohrhard at googlemail.com
Fri Feb 15 16:00:44 PST 2013


 sc/source/ui/docshell/arealink.cxx |    5 -----
 sc/source/ui/docshell/docfunc.cxx  |    1 +
 sc/source/ui/docshell/impex.cxx    |    2 +-
 sc/source/ui/drawfunc/mediash.cxx  |    4 +---
 sc/source/ui/unoobj/cellsuno.cxx   |    5 ++---
 sc/source/ui/view/cellsh3.cxx      |    2 ++
 sc/source/ui/view/viewfun2.cxx     |    3 +++
 sc/source/ui/view/viewfun4.cxx     |    6 ++----
 sc/source/ui/view/viewutil.cxx     |    2 ++
 9 files changed, 14 insertions(+), 16 deletions(-)

New commits:
commit 577d7ecd494b38d673fbb84738f427f18353fcfc
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 00:58:11 2013 +0100

    coverity: fix memory leak
    
    Change-Id: I5e293c67691e0efaded2c359a35e3bbb00dcb3d8

diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx
index d5ad782..1fa6561 100644
--- a/sc/source/ui/view/viewutil.cxx
+++ b/sc/source/ui/view/viewutil.cxx
@@ -379,6 +379,8 @@ bool ScViewUtil::IsFullScreen( SfxViewShell& rViewShell )
 
     if (rBindings.QueryState( SID_WIN_FULLSCREEN, pItem ) >= SFX_ITEM_DEFAULT)
         bIsFullScreen = static_cast< SfxBoolItem* >( pItem )->GetValue();
+    delete pItem;
+
     return bIsFullScreen;
 }
 
commit 9904fea6694f9f93ca049b75d7184260fb93ee68
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 00:37:41 2013 +0100

    coverity: fix memory leak
    
    Change-Id: Ie56951fd321820d16fdee197a86987c99d94f76e

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 64cea57..b7d5221 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -77,6 +77,7 @@
 #include "charthelper.hxx"
 #include "tabbgcolor.hxx"
 #include "clipparam.hxx"
+#include "prnsave.hxx"
 
 #include <boost/scoped_ptr.hpp>
 #include <vector>
@@ -1021,6 +1022,8 @@ void ScViewFunc::SetPrintRanges( sal_Bool bEntireSheet, const String* pPrint,
         pDocSh->GetUndoManager()->AddUndoAction(
                     new ScUndoPrintRange( pDocSh, nCurTab, pOldRanges, pNewRanges ) );
     }
+    else
+        delete pOldRanges;
 
     //  update page breaks
 
commit 0c316e7048131730a9a5bc713796dd917149700e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 00:39:24 2013 +0100

    coverity: fix memory leak
    
    Change-Id: Ie7ba893ed08ca6ba0083db20e4c887866d0b6642

diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 695b2ab..0b3158c 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -315,7 +315,7 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord )
     const EditTextObject* pTObject = NULL;
     ScBaseCell* pCell = NULL;
     EditView* pEditView = NULL;
-    ESelection* pEditSel = NULL;
+    boost::scoped_ptr<ESelection> pEditSel;
     ScEditEngineDefaulter* pThesaurusEngine;
     sal_Bool bIsEditMode = GetViewData()->HasEditView(eWhich);
     if (bRecord && !pDoc->IsUndoEnabled())
@@ -323,7 +323,7 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord )
     if (bIsEditMode)                                            // Edit-Mode aktiv
     {
         GetViewData()->GetEditView(eWhich, pEditView, nCol, nRow);
-        pEditSel = new ESelection(pEditView->GetSelection());
+        pEditSel.reset(new ESelection(pEditView->GetSelection()));
         SC_MOD()->InputEnterHandler();
         GetViewData()->GetBindings().Update();          // sonst kommt der Sfx durcheinander...
     }
@@ -338,7 +338,6 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord )
     if (!aTester.IsEditable())
     {
         ErrorMessage(aTester.GetMessageId());
-        delete pEditSel;
         return;
     }
     pDoc->GetCellType(nCol, nRow, nTab, eCellType);
@@ -440,7 +439,6 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord )
     delete pEditDefaults;
     delete pThesaurusEngine;
     delete pOldTObj;
-    delete pEditSel;
     pDocSh->PostPaintGridAll();
 }
 
commit 8063ede18d03560cec296fab4152be9b24ec8ff8
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 00:31:16 2013 +0100

    coverity: fix memory leak
    
    Change-Id: Ib92f1b80e6e597b233eed91b8ed96cdeec509c90

diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index e916bda..353f469 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -749,6 +749,8 @@ void ScCellShell::Execute( SfxRequest& rReq )
                         SfxPoolItem* pItem = 0;
                         if( rBindings.QueryState( nSlot, pItem ) >= SFX_ITEM_DEFAULT )
                             bMerge = !static_cast< SfxBoolItem* >( pItem )->GetValue();
+
+                        delete pItem;
                     }
                     break;
                 }
commit ad02b999d946469325b16232709dde96a3e9ebc8
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 00:20:56 2013 +0100

    coverity: fix memory leak
    
    Change-Id: I3aed29393376933fe6f07e38fb936911723ed2fe

diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index cbd100f..bcab454 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -4128,9 +4128,9 @@ sal_Int32 SAL_CALL ScCellRangesBase::replaceAll( const uno::Reference<util::XSea
                     for (; itr != itrEnd && *itr < nTabCount; ++itr)
                         if ( *itr != nTab && bUndo)
                             pUndoDoc->AddUndoTab( *itr, *itr );
-                    ScMarkData* pUndoMark = NULL;
+                    boost::scoped_ptr<ScMarkData> pUndoMark;
                     if (bUndo)
-                        pUndoMark = new ScMarkData(aMark);
+                        pUndoMark.reset(new ScMarkData(aMark));
 
                     bool bFound = false;
                     if (bUndo)
@@ -4153,7 +4153,6 @@ sal_Int32 SAL_CALL ScCellRangesBase::replaceAll( const uno::Reference<util::XSea
                     else
                     {
                         delete pUndoDoc;
-                        delete pUndoMark;
                         // nReplaced bleibt 0
                     }
                 }
commit b75386908483351ebd45b2b74caf2667ec7c6d08
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 00:11:55 2013 +0100

    coverity: fix memory leak
    
    Change-Id: Ia69953147cc39b9f5683554188912b8f3fa22265

diff --git a/sc/source/ui/drawfunc/mediash.cxx b/sc/source/ui/drawfunc/mediash.cxx
index b2c6901..17392b1 100644
--- a/sc/source/ui/drawfunc/mediash.cxx
+++ b/sc/source/ui/drawfunc/mediash.cxx
@@ -70,7 +70,7 @@ void ScMediaShell::GetMediaState( SfxItemSet& rSet )
         {
             if( SID_AVMEDIA_TOOLBOX == nWhich )
             {
-                SdrMarkList*    pMarkList = new SdrMarkList( pView->GetMarkedObjectList() );
+                boost::scoped_ptr<SdrMarkList> pMarkList(new SdrMarkList( pView->GetMarkedObjectList() ));
                 bool            bDisable = true;
 
                 if( 1 == pMarkList->GetMarkCount() )
@@ -89,8 +89,6 @@ void ScMediaShell::GetMediaState( SfxItemSet& rSet )
 
                 if( bDisable )
                     rSet.DisableItem( SID_AVMEDIA_TOOLBOX );
-
-                delete pMarkList;
             }
 
             nWhich = aIter.NextWhich();
commit 3d12edc4b069df0e9d3a3283f5bce42c06b1d00b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 00:09:15 2013 +0100

    coverity: prevent acces to unintialized variable
    
    Change-Id: Ic2c28232574460fd59dd404618af6b581f410a83

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 686d0d2..e0186a8 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -970,7 +970,7 @@ static bool lcl_PutString(
     if ( nColFormat == SC_COL_TEXT )
     {
         double fDummy;
-        sal_uInt32 nIndex;
+        sal_uInt32 nIndex = 0;
         if (pFormatter->IsNumberFormat(rStr, nIndex, fDummy))
         {
             // Set the format of this cell to Text.
commit 20ca1cfa6722d62732c4408d14cdc9b1dc56b69a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 16 00:08:10 2013 +0100

    coverity: fix memory leak
    
    Change-Id: I5c8f4002d92be1ddef3f075be7cbcd6a2e88075f

diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 2c8e5e5..7f8254f 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1794,6 +1794,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
                 if (!bApi)
                     rDocShell.ErrorMessage(STR_MSSG_INSERTCELLS_0);
                 rDocShell.GetUndoManager()->LeaveListAction();
+                delete pUndoData;
                 return false;
             }
         }
commit 02e4df3ab41e1e616019c4fb4c542474702988c5
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Feb 15 22:30:11 2013 +0100

    coverity: seems to be unused now
    
    Change-Id: I8bc75ab429619efef65d29a021403444dcd8a1c0

diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index 85db183..9ae8861 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -252,11 +252,6 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
     if ( rNewFilter != aFilterName )
         aOptions.Erase();
 
-    //  ItemSet immer anlegen, damit die DocShell die Optionen setzen kann
-    SfxItemSet* pSet = new SfxAllItemSet( SFX_APP()->GetPool() );
-    if ( aOptions.Len() )
-        pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, aOptions ) );
-
     SfxMedium* pMed = new SfxMedium(aNewUrl, STREAM_STD_READ, pFilter);
 
     // aRef->DoClose() will be closed explicitly, but it is still more safe to use SfxObjectShellLock here


More information about the Libreoffice-commits mailing list