summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2013-04-09 07:21:20 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2013-04-09 07:22:55 +0900
commitc70fc41d6b7eb6f56c70b8e85469c5db66837a42 (patch)
treebb95cb099e8930ec77aa4ae0f3ed088fdb8d6435 /svx
parent0f9190b1fad6a468a03d13db0345051aef82217a (diff)
deleting NULL is safe
Change-Id: Ief65149bc88ac4ce8badc7dbce818fca0cdcb201
Diffstat (limited to 'svx')
-rw-r--r--svx/source/accessibility/AccessibleShape.cxx6
-rw-r--r--svx/source/dialog/ctredlin.cxx10
-rw-r--r--svx/source/dialog/dlgctrl.cxx3
-rw-r--r--svx/source/items/hlnkitem.cxx3
-rw-r--r--svx/source/svdraw/svddrag.cxx2
-rw-r--r--svx/source/svdraw/svdedxv.cxx4
-rw-r--r--svx/source/svdraw/svdibrow.cxx6
-rw-r--r--svx/source/svdraw/svdmodel.cxx8
-rw-r--r--svx/source/svdraw/svdobj.cxx8
-rw-r--r--svx/source/svdraw/svdoole2.cxx6
-rw-r--r--svx/source/svdraw/svdotext.cxx6
-rw-r--r--svx/source/svdraw/svdtext.cxx3
-rw-r--r--svx/source/svdraw/svdundo.cxx43
-rw-r--r--svx/source/table/cell.cxx3
-rw-r--r--svx/source/table/tablecolumn.cxx3
-rw-r--r--svx/source/table/tablecontroller.cxx3
-rw-r--r--svx/source/table/tablerow.cxx3
17 files changed, 42 insertions, 78 deletions
diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx
index c35a8aa21300..007bded67b08 100644
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -112,10 +112,8 @@ AccessibleShape::AccessibleShape (
AccessibleShape::~AccessibleShape (void)
{
- if (mpChildrenManager != NULL)
- delete mpChildrenManager;
- if (mpText != NULL)
- delete mpText;
+ delete mpChildrenManager;
+ delete mpText;
OSL_TRACE ("~AccessibleShape");
// Unregistering from the various broadcasters should be unnecessary
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index aedc3187398b..01b1a8f33c7d 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -70,10 +70,7 @@ SvxRedlinEntry::SvxRedlinEntry()
SvxRedlinEntry::~SvxRedlinEntry()
{
RedlinData* pRedDat=(RedlinData*) GetUserData();
- if(pRedDat!=NULL)
- {
- delete pRedDat;
- }
+ delete pRedDat;
}
// Functions in the inserts Items of SvxRedlinTable
@@ -149,8 +146,7 @@ SvxRedlinTable::SvxRedlinTable(SvxSimpleTableContainer& rParent,WinBits nBits)
SvxRedlinTable::~SvxRedlinTable()
{
- if(pCommentSearcher!=NULL)
- delete pCommentSearcher;
+ delete pCommentSearcher;
}
StringCompare SvxRedlinTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* pRight)
@@ -301,7 +297,7 @@ void SvxRedlinTable::SetCommentParams( const utl::SearchParam* pSearchPara )
{
if(pSearchPara!=NULL)
{
- if(pCommentSearcher!=NULL) delete pCommentSearcher;
+ delete pCommentSearcher;
pCommentSearcher=new utl::TextSearch(*pSearchPara, LANGUAGE_SYSTEM );
}
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index 4d65bb7f1692..671083f7a231 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -165,8 +165,7 @@ void SvxRectCtl::Resize_Impl()
void SvxRectCtl::InitRectBitmap( void )
{
- if( pBitmap )
- delete pBitmap;
+ delete pBitmap;
const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings();
svtools::ColorConfig aColorConfig;
diff --git a/svx/source/items/hlnkitem.cxx b/svx/source/items/hlnkitem.cxx
index 1de41eb9fa0f..4919251e09ba 100644
--- a/svx/source/items/hlnkitem.cxx
+++ b/svx/source/items/hlnkitem.cxx
@@ -282,8 +282,7 @@ void SvxHyperlinkItem::SetMacro( sal_uInt16 nEvent, const SvxMacro& rMacro )
void SvxHyperlinkItem::SetMacroTable( const SvxMacroTableDtor& rTbl )
{
- if ( pMacroTable )
- delete pMacroTable;
+ delete pMacroTable;
pMacroTable = new SvxMacroTableDtor ( rTbl );
}
diff --git a/svx/source/svdraw/svddrag.cxx b/svx/source/svdraw/svddrag.cxx
index 9d836f1e5fbe..0a982d2a40cf 100644
--- a/svx/source/svdraw/svddrag.cxx
+++ b/svx/source/svdraw/svddrag.cxx
@@ -26,7 +26,7 @@ void SdrDragStat::Clear(bool bLeaveOne)
delete aPnts.back();
aPnts.pop_back();
}
- if (pUser!=NULL) delete pUser;
+ delete pUser;
pUser=NULL;
aPnts.clear();
if (bLeaveOne) {
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index f67151001585..18e12508c0c4 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -96,9 +96,7 @@ SdrObjEditView::~SdrObjEditView()
{
pTextEditWin = NULL; // so there's no ShowCursor in SdrEndTextEdit
if (IsTextEdit()) SdrEndTextEdit();
- if (pTextEditOutliner!=NULL) {
- delete pTextEditOutliner;
- }
+ delete pTextEditOutliner;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index ff9ba23870f4..d42bbeadca5f 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -217,11 +217,9 @@ _SdrItemBrowserControl::_SdrItemBrowserControl(Window* pParent, WinBits nBits):
_SdrItemBrowserControl::~_SdrItemBrowserControl()
{
- if(pEditControl)
- delete pEditControl;
+ delete pEditControl;
- if(pAktChangeEntry)
- delete pAktChangeEntry;
+ delete pAktChangeEntry;
Clear();
}
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 70eeeb395e81..092544dae9cd 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -306,8 +306,7 @@ SdrModel::~SdrModel()
OSL_FAIL(aStr.getStr());
}
#endif
- if (pAktUndoGroup!=NULL)
- delete pAktUndoGroup;
+ delete pAktUndoGroup;
ClearModel(sal_True);
@@ -346,8 +345,7 @@ SdrModel::~SdrModel()
if( mpForbiddenCharactersTable )
mpForbiddenCharactersTable->release();
- if(mpNumberFormatter)
- delete mpNumberFormatter;
+ delete mpNumberFormatter;
delete mpImpl->mpUndoFactory;
delete mpImpl;
@@ -1515,7 +1513,7 @@ void SdrModel::InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos)
void SdrModel::DeleteMasterPage(sal_uInt16 nPgNum)
{
SdrPage* pPg=RemoveMasterPage(nPgNum);
- if (pPg!=NULL) delete pPg;
+ delete pPg;
}
SdrPage* SdrModel::RemoveMasterPage(sal_uInt16 nPgNum)
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 0d6d8f2adf3d..5a5f53669f4a 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -275,9 +275,9 @@ SdrObjPlusData::SdrObjPlusData():
SdrObjPlusData::~SdrObjPlusData()
{
- if (pBroadcast !=NULL) delete pBroadcast;
- if (pUserDataList!=NULL) delete pUserDataList;
- if (pGluePoints !=NULL) delete pGluePoints;
+ delete pBroadcast;
+ delete pUserDataList;
+ delete pGluePoints;
}
SdrObjPlusData* SdrObjPlusData::Clone(SdrObject* pObj1) const
@@ -484,7 +484,7 @@ SdrObject::~SdrObject()
DBG_DTOR(SdrObject,NULL);
SendUserCall(SDRUSERCALL_DELETE, GetLastBoundRect());
- if (pPlusData!=NULL) delete pPlusData;
+ delete pPlusData;
if(mpProperties)
{
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 3029917c93ba..e3656a4ffa84 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -795,11 +795,9 @@ SdrOle2Obj::~SdrOle2Obj()
if ( mpImpl->mbConnected )
Disconnect();
- if( pGraphic!=NULL )
- delete pGraphic;
+ delete pGraphic;
- if(mpImpl->pGraphicObject!=NULL)
- delete mpImpl->pGraphicObject;
+ delete mpImpl->pGraphicObject;
if(pModifyListener)
{
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 19d5fffd631e..6a41d5bb9992 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -193,11 +193,9 @@ SdrTextObj::~SdrTextObj()
rOutl.SetTextObj( NULL );
}
- if(mpText!=NULL)
- delete mpText;
+ delete mpText;
- if (pFormTextBoundRect!=NULL)
- delete pFormTextBoundRect;
+ delete pFormTextBoundRect;
ImpLinkAbmeldung();
}
diff --git a/svx/source/svdraw/svdtext.cxx b/svx/source/svdraw/svdtext.cxx
index 894fcbd71338..cd541754ea24 100644
--- a/svx/source/svdraw/svdtext.cxx
+++ b/svx/source/svdraw/svdtext.cxx
@@ -84,8 +84,7 @@ void SdrText::SetOutlinerParaObject( OutlinerParaObject* pTextObject )
mpModel->GetHitTestOutliner().SetTextObj( 0 );
}
- if( mpOutlinerParaObject )
- delete mpOutlinerParaObject;
+ delete mpOutlinerParaObject;
mpOutlinerParaObject = pTextObject;
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index 30a2b10f80db..055a94d6d364 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -301,20 +301,14 @@ SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1, bool bSave
SdrUndoAttrObj::~SdrUndoAttrObj()
{
- if(pUndoSet)
- delete pUndoSet;
- if(pRedoSet)
- delete pRedoSet;
- if(pRepeatSet)
- delete pRepeatSet;
- if(pUndoGroup)
- delete pUndoGroup;
- if(pTextUndo)
- delete pTextUndo;
+ delete pUndoSet;
+ delete pRedoSet;
+ delete pRepeatSet;
+ delete pUndoGroup;
+ delete pTextUndo;
// #i8508#
- if(pTextRedo)
- delete pTextRedo;
+ delete pTextRedo;
}
void SdrUndoAttrObj::Undo()
@@ -331,10 +325,7 @@ void SdrUndoAttrObj::Undo()
{
bHaveToTakeRedoSet = sal_False;
- if(pRedoSet)
- {
- delete pRedoSet;
- }
+ delete pRedoSet;
pRedoSet = new SfxItemSet(pObj->GetMergedItemSet());
@@ -603,9 +594,9 @@ SdrUndoGeoObj::SdrUndoGeoObj(SdrObject& rNewObj):
SdrUndoGeoObj::~SdrUndoGeoObj()
{
- if (pUndoGeo!=NULL) delete pUndoGeo;
- if (pRedoGeo!=NULL) delete pRedoGeo;
- if (pUndoGroup!=NULL) delete pUndoGroup;
+ delete pUndoGeo;
+ delete pRedoGeo;
+ delete pUndoGroup;
}
void SdrUndoGeoObj::Undo()
@@ -622,7 +613,7 @@ void SdrUndoGeoObj::Undo()
}
else
{
- if (pRedoGeo!=NULL) delete pRedoGeo;
+ delete pRedoGeo;
pRedoGeo=pObj->GetGeoData();
pObj->SetGeoData(*pUndoGeo);
}
@@ -639,7 +630,7 @@ void SdrUndoGeoObj::Redo()
}
else
{
- if (pUndoGeo!=NULL) delete pUndoGeo;
+ delete pUndoGeo;
pUndoGeo=pObj->GetGeoData();
pObj->SetGeoData(*pRedoGeo);
}
@@ -1095,10 +1086,8 @@ SdrUndoObjSetText::SdrUndoObjSetText(SdrObject& rNewObj, sal_Int32 nText)
SdrUndoObjSetText::~SdrUndoObjSetText()
{
- if ( pOldText )
- delete pOldText;
- if ( pNewText )
- delete pNewText;
+ delete pOldText;
+ delete pNewText;
}
void SdrUndoObjSetText::AfterSetText()
@@ -1495,9 +1484,7 @@ SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg):
SdrUndoDelPage::~SdrUndoDelPage()
{
- if (pUndoGroup!=NULL) {
- delete pUndoGroup;
- }
+ delete pUndoGroup;
}
void SdrUndoDelPage::Undo()
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index fff251a6857e..dd6c37f81938 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -1584,8 +1584,7 @@ Any SAL_CALL Cell::getPropertyDefault( const OUString& aPropertyName ) throw(Unk
void SAL_CALL Cell::setAllPropertiesToDefault( ) throw (RuntimeException)
{
- if( mpProperties )
- delete mpProperties;
+ delete mpProperties;
mpProperties = new sdr::properties::CellProperties( static_cast< SdrTableObj& >( GetObject() ), this );
SdrOutliner& rOutliner = GetObject().ImpGetDrawOutliner();
diff --git a/svx/source/table/tablecolumn.cxx b/svx/source/table/tablecolumn.cxx
index cd781ec9b1fb..ca3212ceeb8a 100644
--- a/svx/source/table/tablecolumn.cxx
+++ b/svx/source/table/tablecolumn.cxx
@@ -224,8 +224,7 @@ void SAL_CALL TableColumn::setFastPropertyValue( sal_Int32 nHandle, const Any& a
mxTableModel->setModified(sal_True);
}
- if( pUndo )
- delete pUndo;
+ delete pUndo;
}
// -----------------------------------------------------------------------------
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 7400cf770134..3cb77caa84d1 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -482,8 +482,7 @@ void SvxTableController::GetState( SfxItemSet& rSet )
}
nWhich = aIter.NextWhich();
}
- if( pSet )
- delete pSet;
+ delete pSet;
}
// --------------------------------------------------------------------
diff --git a/svx/source/table/tablerow.cxx b/svx/source/table/tablerow.cxx
index a994ce01bed6..936c9ca05237 100644
--- a/svx/source/table/tablerow.cxx
+++ b/svx/source/table/tablerow.cxx
@@ -298,8 +298,7 @@ void SAL_CALL TableRow::setFastPropertyValue( sal_Int32 nHandle, const Any& aVal
mxTableModel->setModified(sal_True);
}
- if( pUndo )
- delete pUndo;
+ delete pUndo;
}
// -----------------------------------------------------------------------------