[Libreoffice-commits] .: vcl/aqua vcl/ios vcl/source vcl/win

Caolán McNamara caolan at kemper.freedesktop.org
Mon Nov 7 04:49:55 PST 2011


 vcl/aqua/source/window/salframe.cxx |    3 +--
 vcl/ios/source/window/salframe.cxx  |    3 +--
 vcl/source/app/dbggui.cxx           |    3 +--
 vcl/source/app/settings.cxx         |    6 ++----
 vcl/source/control/edit.cxx         |    3 +--
 vcl/source/control/menubtn.cxx      |    6 ++----
 vcl/source/gdi/regband.cxx          |    3 +--
 vcl/source/window/accmgr.cxx        |    6 ++----
 vcl/source/window/brdwin.cxx        |    6 ++----
 vcl/source/window/msgbox.cxx        |    3 +--
 vcl/source/window/splitwin.cxx      |    3 +--
 vcl/source/window/tabdlg.cxx        |    3 +--
 vcl/source/window/toolbox.cxx       |    3 +--
 vcl/source/window/window.cxx        |   12 ++++--------
 vcl/win/source/gdi/salgdi.cxx       |    9 +++------
 vcl/win/source/window/salobj.cxx    |    3 +--
 16 files changed, 25 insertions(+), 50 deletions(-)

New commits:
commit 2411ea09a8d20609e48b0750ab2102c00e0c3b8a
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Mon Nov 7 12:49:03 2011 +0000

    redundant if not-null checks on delete

diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index 5ac2842..7733649 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -128,8 +128,7 @@ AquaSalFrame::~AquaSalFrame()
     if( this == s_pCaptureFrame )
         s_pCaptureFrame = NULL;
 
-    if ( mpGraphics )
-        delete mpGraphics;
+    delete mpGraphics;
 
     if( mpDockMenuEntry )
         // life cycle comment: the menu has ownership of the item, so no release
diff --git a/vcl/ios/source/window/salframe.cxx b/vcl/ios/source/window/salframe.cxx
index 8e2ea9d..3aab37a 100644
--- a/vcl/ios/source/window/salframe.cxx
+++ b/vcl/ios/source/window/salframe.cxx
@@ -106,8 +106,7 @@ IosSalFrame::~IosSalFrame()
     if( this == s_pCaptureFrame )
         s_pCaptureFrame = NULL;
 
-    if ( mpGraphics )
-        delete mpGraphics;
+    delete mpGraphics;
 
     if ( mpView ) {
         [mpView release];
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index 6e76706..468e7c8 100755
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -1998,8 +1998,7 @@ void DbgGUIDeInit()
     DbgSetAbort( NULL );
 
     DbgWindow* pDbgWindow = ImplGetSVData()->maWinData.mpDbgWin;
-    if ( pDbgWindow )
-        delete pDbgWindow;
+    delete pDbgWindow;
 }
 
 // -----------------------------------------------------------------------
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 1795d5a..533fe6b 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -1546,10 +1546,8 @@ ImplAllSettingsData::ImplAllSettingsData( const ImplAllSettingsData& rData ) :
 
 ImplAllSettingsData::~ImplAllSettingsData()
 {
-    if ( mpLocaleDataWrapper )
-        delete mpLocaleDataWrapper;
-    if ( mpUILocaleDataWrapper )
-        delete mpUILocaleDataWrapper;
+    delete mpLocaleDataWrapper;
+    delete mpUILocaleDataWrapper;
     if ( mpI18nHelper )
         delete mpI18nHelper;
     if ( mpUII18nHelper )
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index cf83869..a0a81e9 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -253,8 +253,7 @@ Edit::~Edit()
 
     delete mpIMEInfos;
 
-    if ( mpUpdateDataTimer )
-        delete mpUpdateDataTimer;
+    delete mpUpdateDataTimer;
 
     if ( mxDnDListener.is() )
     {
diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx
index 13513f6..2e1ad53 100644
--- a/vcl/source/control/menubtn.cxx
+++ b/vcl/source/control/menubtn.cxx
@@ -133,10 +133,8 @@ void MenuButton::ImplLoadRes( const ResId& rResId )
 
 MenuButton::~MenuButton()
 {
-    if ( mpMenuTimer )
-        delete mpMenuTimer;
-    if ( mpOwnMenu )
-        delete mpOwnMenu;
+    delete mpMenuTimer;
+    delete mpOwnMenu;
 }
 
 // -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/regband.cxx b/vcl/source/gdi/regband.cxx
index 1cec295..b091783 100644
--- a/vcl/source/gdi/regband.cxx
+++ b/vcl/source/gdi/regband.cxx
@@ -201,8 +201,7 @@ void ImplRegionBand::ProcessPoints()
     }
 
     // remove last element if necessary
-    if ( pRegionBandPoint )
-        delete pRegionBandPoint;
+    delete pRegionBandPoint;
 
     // list is now empty
     mpFirstBandPoint = NULL;
diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx
index 43c78d5..a14530a 100644
--- a/vcl/source/window/accmgr.cxx
+++ b/vcl/source/window/accmgr.cxx
@@ -43,10 +43,8 @@ DBG_NAMEEX( Accelerator )
 
 ImplAccelManager::~ImplAccelManager()
 {
-    if ( mpAccelList )
-        delete mpAccelList;
-    if ( mpSequenceList )
-        delete mpSequenceList;
+    delete mpAccelList;
+    delete mpSequenceList;
 }
 
 // -----------------------------------------------------------------------
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index d048b3a..bf25f34 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -1438,10 +1438,8 @@ ImplStdBorderWindowView::ImplStdBorderWindowView( ImplBorderWindow* pBorderWindo
 
 ImplStdBorderWindowView::~ImplStdBorderWindowView()
 {
-    if ( mpATitleVirDev )
-        delete mpATitleVirDev;
-    if ( mpDTitleVirDev )
-        delete mpDTitleVirDev;
+    delete mpATitleVirDev;
+    delete mpDTitleVirDev;
 }
 
 // -----------------------------------------------------------------------
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index bc32832..4b4861a 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -258,8 +258,7 @@ void MessBox::ImplPosControls()
     WinBits         nWinStyle = WB_LEFT | WB_WORDBREAK | WB_NOLABEL | WB_INFO;
     sal_uInt16          nTextStyle = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | TEXT_DRAW_LEFT;
 
-    if ( mpFixedText )
-        delete mpFixedText;
+    delete mpFixedText;
     if ( mpFixedImage )
     {
         delete mpFixedImage;
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index ed717f6..8850e7d 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -2621,8 +2621,7 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
 
         if ( rTEvt.IsTrackingEnded() )
         {
-            if ( mpLastSizes )
-                delete mpLastSizes;
+            delete mpLastSizes;
             mpLastSizes     = NULL;
             mpSplitSet      = NULL;
             mnMouseOff      = 0;
diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx
index 32e8a0d..beb02a1 100644
--- a/vcl/source/window/tabdlg.cxx
+++ b/vcl/source/window/tabdlg.cxx
@@ -239,8 +239,7 @@ TabDialog::TabDialog( Window* pParent, const ResId& rResId ) :
 
 TabDialog::~TabDialog()
 {
-    if ( mpFixedLine )
-        delete mpFixedLine;
+    delete mpFixedLine;
 }
 
 // -----------------------------------------------------------------------
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 87347e8..13a5648 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1796,8 +1796,7 @@ ToolBox::~ToolBox()
     delete mpData;
 
     // FloatSizeAry gegebenenfalls loeschen
-    if ( mpFloatSizeAry )
-        delete mpFloatSizeAry;
+    delete mpFloatSizeAry;
 
     // Wenn keine ToolBox-Referenzen mehr auf die Listen bestehen, dann
     // Listen mit wegloeschen
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index f64a3a6..1dc681c 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1899,8 +1899,7 @@ sal_Bool Window::ImplSetClipFlagChilds( sal_Bool bSysObjOnlySmaller )
             bUpdate = sal_False;
         }
 
-        if ( pOldRegion )
-            delete pOldRegion;
+        delete pOldRegion;
     }
     else
     {
@@ -2459,8 +2458,7 @@ void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags )
     if( !aSelectionRect.IsEmpty() )
         DrawSelectionBackground( aSelectionRect, 3, sal_False, sal_True, sal_False );
 
-    if ( pChildRegion )
-        delete pChildRegion;
+    delete pChildRegion;
 }
 
 // -----------------------------------------------------------------------
@@ -3469,10 +3467,8 @@ void Window::ImplPosSizeWindow( long nX, long nY,
             mpWindowImpl->mpSysObj->SetPosSize( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight );
     }
 
-    if ( pOverlapRegion )
-        delete pOverlapRegion;
-    if ( pOldRegion )
-        delete pOldRegion;
+    delete pOverlapRegion;
+    delete pOldRegion;
 }
 
 // -----------------------------------------------------------------------
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index 3c0e828..ee34758 100644
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -785,14 +785,11 @@ WinSalGraphics::~WinSalGraphics()
     if ( mpStdClipRgnData )
         delete [] mpStdClipRgnData;
 
-    if ( mpLogFont )
-        delete mpLogFont;
+    delete mpLogFont;
 
-    if ( mpFontCharSets )
-        delete mpFontCharSets;
+    delete mpFontCharSets;
 
-    if ( mpFontKernPairs )
-        delete mpFontKernPairs;
+    delete mpFontKernPairs;
 }
 
 // -----------------------------------------------------------------------
diff --git a/vcl/win/source/window/salobj.cxx b/vcl/win/source/window/salobj.cxx
index 0ee631d..01ffd8b 100644
--- a/vcl/win/source/window/salobj.cxx
+++ b/vcl/win/source/window/salobj.cxx
@@ -654,8 +654,7 @@ WinSalObject::~WinSalObject()
     }
 
     // Cache-Daten zerstoeren
-    if ( mpStdClipRgnData )
-        delete mpStdClipRgnData;
+    delete mpStdClipRgnData;
 
     HWND hWndParent = ::GetParent( mhWnd );
 


More information about the Libreoffice-commits mailing list