diff options
author | Ivan Timofeev <timofeev.i.s@gmail.com> | 2011-11-17 22:13:42 +0400 |
---|---|---|
committer | Ivan Timofeev <timofeev.i.s@gmail.com> | 2011-11-17 22:45:10 +0400 |
commit | 3616dfb094089589b5c9082fc96702ad1155045f (patch) | |
tree | 60f96e277c910ccc0eb76e22f76d6a51c7a82cdc /sw/source/ui/docvw | |
parent | 538c8cfc3f1df95cde6789f52a120c8de0a75511 (diff) |
redundant if not-null checks on delete
Diffstat (limited to 'sw/source/ui/docvw')
-rw-r--r-- | sw/source/ui/docvw/edtwin.cxx | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index f18433c4b929..0bb9dac241d6 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -342,11 +342,9 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier ) PointerStyle eStyle = POINTER_FILL; if( rSh.IsOverReadOnlyPos( rLPt )) { - if( pUserMarker ) - { - delete pUserMarker; - pUserMarker = 0L; - } + delete pUserMarker; + pUserMarker = 0L; + eStyle = POINTER_NOTALLOWED; } else @@ -373,7 +371,7 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier ) pUserMarker = new SdrDropMarkerOverlay( *rSh.GetDrawView(), aTmp ); } } - else if(pUserMarker) + else { delete pUserMarker; pUserMarker = 0L; @@ -661,8 +659,7 @@ void SwEditWin::LeaveArea(const Point &rPos) JustifyAreaTimer(); if( !aTimer.IsActive() ) aTimer.Start(); - if( pShadCrsr ) - delete pShadCrsr, pShadCrsr = 0; + delete pShadCrsr, pShadCrsr = 0; } inline void SwEditWin::EnterArea() @@ -1325,8 +1322,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) // running on a document, no order is being taken return; - if( pShadCrsr ) - delete pShadCrsr, pShadCrsr = 0; + delete pShadCrsr, pShadCrsr = 0; aKeyInputFlushTimer.Stop(); sal_Bool bIsDocReadOnly = rView.GetDocShell()->IsReadOnly() && @@ -2680,8 +2676,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } bWasShdwCrsr = 0 != pShadCrsr; - if( bWasShdwCrsr ) - delete pShadCrsr, pShadCrsr = 0; + delete pShadCrsr, pShadCrsr = 0; const Point aDocPos( PixelToLogic( rMEvt.GetPosPixel() ) ); |