diff options
128 files changed, 261 insertions, 508 deletions
diff --git a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx index 878ecd1914c4..f2321666a279 100644 --- a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx +++ b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx @@ -53,8 +53,7 @@ AccessibleTextHelper::AccessibleTextHelper( AccessibleTextHelper::~AccessibleTextHelper() { - if( m_pTextHelper ) - delete m_pTextHelper; + delete m_pTextHelper; } // ____ XInitialization ____ diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx index 9f60c63bb405..4dbe04c2f4e3 100644 --- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx +++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx @@ -54,8 +54,7 @@ ViewElementListProvider::ViewElementListProvider( DrawModelWrapper* pDrawModelWr ViewElementListProvider::~ViewElementListProvider() { - if(m_pFontList) - delete m_pFontList; + delete m_pFontList; } XColorListRef ViewElementListProvider::GetColorTable() const diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx b/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx index fe2f8f7c4a01..797575818056 100644 --- a/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx +++ b/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx @@ -91,8 +91,7 @@ MQuery::~MQuery() NULL ) m_aQueryDirectory->directoryQuery->StopQuery(m_aQueryDirectory->contextId); - if ( m_aQueryDirectory ) - delete m_aQueryDirectory; + delete m_aQueryDirectory; NS_IF_RELEASE( m_aQueryHelper); diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index b91f0039f62a..6bf6282e6eb8 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -819,8 +819,7 @@ void SfxAcceleratorConfigPage::dispose() while (pEntry) { TAccInfo* pUserData = static_cast<TAccInfo*>(pEntry->GetUserData()); - if (pUserData) - delete pUserData; + delete pUserData; pEntry = m_pEntriesBox->Next(pEntry); } @@ -828,8 +827,7 @@ void SfxAcceleratorConfigPage::dispose() while (pEntry) { TAccInfo* pUserData = static_cast<TAccInfo*>(pEntry->GetUserData()); - if (pUserData) - delete pUserData; + delete pUserData; pEntry = m_pKeyBox->Next(pEntry); } @@ -1427,8 +1425,7 @@ void SfxAcceleratorConfigPage::StartFileDialog( WinBits nBits, const OUString& r bool bSave = ( ( nBits & WB_SAVEAS ) == WB_SAVEAS ); short nDialogType = bSave ? ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION : ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE; - if ( m_pFileDlg ) - delete m_pFileDlg; + delete m_pFileDlg; m_pFileDlg = new sfx2::FileDialogHelper( nDialogType, 0 ); m_pFileDlg->SetTitle( rTitle ); diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx index 798731af25d1..234ea38d7428 100644 --- a/cui/source/dialogs/hldocntp.cxx +++ b/cui/source/dialogs/hldocntp.cxx @@ -316,8 +316,7 @@ void SvxHyperlinkNewDocTp::DoApply () bool bOk = pIStm && ( pIStm->GetError() == 0); - if( pIStm ) - delete pIStm; + delete pIStm; if( bOk ) { diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx index 54bcb270b116..ed933d7e0e97 100644 --- a/cui/source/tabpages/numfmt.cxx +++ b/cui/source/tabpages/numfmt.cxx @@ -511,8 +511,7 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet* rSet ) break; } - if ( pNumFmtShell ) - delete pNumFmtShell; // delete old shell if applicable (== reset) + delete pNumFmtShell; // delete old shell if applicable (== reset) nInitFormat = ( pValFmtAttr ) // memorize init key ? pValFmtAttr->GetValue() // (for FillItemSet()) diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index 547c2c113090..ebdd4a81f073 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -113,9 +113,7 @@ ORowSetBase::~ORowSetBase() m_pColumns = NULL; } - if ( m_pEmptyCollection ) - delete m_pEmptyCollection; - + delete m_pEmptyCollection; } // com::sun::star::lang::XTypeProvider diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx index 0c21188c477d..bdd7740a855f 100644 --- a/dbaccess/source/core/api/TableDeco.cxx +++ b/dbaccess/source/core/api/TableDeco.cxx @@ -75,8 +75,7 @@ ODBTableDecorator::ODBTableDecorator( const Reference< XConnection >& _rxConnect ODBTableDecorator::~ODBTableDecorator() { - if ( m_pColumns ) - delete m_pColumns; + delete m_pColumns; } Sequence< sal_Int8 > ODBTableDecorator::getImplementationId() throw (RuntimeException, std::exception) diff --git a/dbaccess/source/core/dataaccess/intercept.cxx b/dbaccess/source/core/dataaccess/intercept.cxx index d6c05953941f..7059c2290b0f 100644 --- a/dbaccess/source/core/dataaccess/intercept.cxx +++ b/dbaccess/source/core/dataaccess/intercept.cxx @@ -96,12 +96,8 @@ OInterceptor::OInterceptor( ODocumentDefinition* _pContentHolder ) OInterceptor::~OInterceptor() { - if( m_pDisposeEventListeners ) - delete m_pDisposeEventListeners; - - if(m_pStatCL) - delete m_pStatCL; - + delete m_pDisposeEventListeners; + delete m_pStatCL; } struct DispatchHelper diff --git a/dbaccess/source/ui/misc/moduledbu.cxx b/dbaccess/source/ui/misc/moduledbu.cxx index 63502fbf7bd2..702b14e0ac65 100644 --- a/dbaccess/source/ui/misc/moduledbu.cxx +++ b/dbaccess/source/ui/misc/moduledbu.cxx @@ -54,9 +54,7 @@ OModuleImpl::OModuleImpl() OModuleImpl::~OModuleImpl() { - if (m_pResources) - delete m_pResources; - + delete m_pResources; } ResMgr* OModuleImpl::getResManager() diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx index d35a20edbde9..e99cb023c2d2 100644 --- a/editeng/source/items/bulitem.cxx +++ b/editeng/source/items/bulitem.cxx @@ -181,8 +181,7 @@ SvxBulletItem::SvxBulletItem( const SvxBulletItem& rItem) : SfxPoolItem( rItem ) SvxBulletItem::~SvxBulletItem() { - if( pGraphicObject ) - delete pGraphicObject; + delete pGraphicObject; } diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index b70fd01a3a24..1bc5cf1c5dbb 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -101,8 +101,7 @@ SvxRTFParser::~SvxRTFParser() void SvxRTFParser::SetInsPos( const SvxPosition& rNew ) { - if( pInsPos ) - delete pInsPos; + delete pInsPos; pInsPos = rNew.Clone(); } @@ -1037,8 +1036,7 @@ void SvxRTFParser::AttrGroupEnd() // process the current, delete from Stack } while( false ); - if( pOld ) - delete pOld; + delete pOld; bNewGroup = false; } diff --git a/embeddedobj/source/general/intercept.cxx b/embeddedobj/source/general/intercept.cxx index 710caf93bd4d..079d912dde6b 100644 --- a/embeddedobj/source/general/intercept.cxx +++ b/embeddedobj/source/general/intercept.cxx @@ -62,11 +62,8 @@ Interceptor::Interceptor( DocumentHolder* pDocHolder ) Interceptor::~Interceptor() { - if( m_pDisposeEventListeners ) - delete m_pDisposeEventListeners; - - if(m_pStatCL) - delete m_pStatCL; + delete m_pDisposeEventListeners; + delete m_pStatCL; } //XDispatch diff --git a/embedserv/source/embed/intercept.cxx b/embedserv/source/embed/intercept.cxx index 2593c3e94c0e..20dcfd116511 100644 --- a/embedserv/source/embed/intercept.cxx +++ b/embedserv/source/embed/intercept.cxx @@ -112,11 +112,8 @@ Interceptor::Interceptor( Interceptor::~Interceptor() { - if( m_pDisposeEventListeners ) - delete m_pDisposeEventListeners; - - if(m_pStatCL) - delete m_pStatCL; + delete m_pDisposeEventListeners; + delete m_pStatCL; DocumentHolder* pTmpDocH = NULL; uno::Reference< uno::XInterface > xLock; diff --git a/embedserv/source/inprocserv/advisesink.cxx b/embedserv/source/inprocserv/advisesink.cxx index 6d44b9f3caf2..eb6488c91c58 100644 --- a/embedserv/source/inprocserv/advisesink.cxx +++ b/embedserv/source/inprocserv/advisesink.cxx @@ -92,8 +92,7 @@ OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pList OleWrapperAdviseSink::~OleWrapperAdviseSink() { - if ( m_pFormatEtc ) - delete m_pFormatEtc; + delete m_pFormatEtc; } STDMETHODIMP OleWrapperAdviseSink::QueryInterface( REFIID riid , void** ppv ) diff --git a/extensions/source/inc/componentmodule.cxx b/extensions/source/inc/componentmodule.cxx index bc19b5aaa073..44b5311a1f21 100644 --- a/extensions/source/inc/componentmodule.cxx +++ b/extensions/source/inc/componentmodule.cxx @@ -66,8 +66,7 @@ namespace COMPMOD_NAMESPACE OModuleImpl::~OModuleImpl() { - if (m_pResources) - delete m_pResources; + delete m_pResources; } diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx index e4d89d53b57a..f5f54fe4c4be 100644 --- a/extensions/source/plugin/base/xplugin.cxx +++ b/extensions/source/plugin/base/xplugin.cxx @@ -1038,8 +1038,7 @@ PluginInputStream::~PluginInputStream() } else osl::File::remove( aFile ); - if( m_pContent ) - delete m_pContent; + delete m_pContent; } PluginStreamType PluginInputStream::getStreamType() diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index b3dbfde83ba5..0079569f9ec5 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -4479,8 +4479,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin nBlibId = ImplInsertBlib( p_EscherBlibEntry ), p_EscherBlibEntry = NULL; } } - if ( p_EscherBlibEntry ) - delete p_EscherBlibEntry; + delete p_EscherBlibEntry; return nBlibId; } diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 6053ae3a76db..3cf0c9ebcecd 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -4987,15 +4987,13 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt, { case 0x038F: pImpRec->nXAlign = nUDData; break; case 0x0390: - if (pImpRec->pXRelTo) - delete pImpRec->pXRelTo; + delete pImpRec->pXRelTo; pImpRec->pXRelTo = new sal_uInt32; *(pImpRec->pXRelTo) = nUDData; break; case 0x0391: pImpRec->nYAlign = nUDData; break; case 0x0392: - if (pImpRec->pYRelTo) - delete pImpRec->pYRelTo; + delete pImpRec->pYRelTo; pImpRec->pYRelTo = new sal_uInt32; *(pImpRec->pYRelTo) = nUDData; break; diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 0226922d31ee..d637ccbaed3c 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -106,10 +106,8 @@ SVGAttributeWriter::SVGAttributeWriter( SVGExport& rExport, SVGFontExport& rFont SVGAttributeWriter::~SVGAttributeWriter() { - if( mpElemPaint ) - delete mpElemPaint; - if( mpElemFont ) - delete mpElemFont; + delete mpElemPaint; + delete mpElemFont; } double SVGAttributeWriter::ImplRound( double fValue, sal_Int32 nDecs ) diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx index 0623c2e64406..a590b2300e2b 100644 --- a/filter/source/t602/t602filter.cxx +++ b/filter/source/t602/t602filter.cxx @@ -883,8 +883,7 @@ T602ImportFilterDialog::T602ImportFilterDialog(const ::com::sun::star::uno::Refe T602ImportFilterDialog::~T602ImportFilterDialog() { - if (mpResMgr) - delete mpResMgr; + delete mpResMgr; } // XLocalizable diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx index a0ac4c07a4da..90518576a0f0 100644 --- a/forms/source/component/clickableimage.cxx +++ b/forms/source/component/clickableimage.cxx @@ -722,8 +722,7 @@ namespace frm if (!rURL.isEmpty() && !::svt::GraphicAccess::isSupportedURL( rURL ) ) { - if (m_pMedium) - delete m_pMedium; + delete m_pMedium; m_pMedium = new SfxMedium(rURL, STREAM_STD_READ); diff --git a/formula/source/ui/resource/ModuleHelper.cxx b/formula/source/ui/resource/ModuleHelper.cxx index 4d4803e4cb57..8044b84ad15c 100644 --- a/formula/source/ui/resource/ModuleHelper.cxx +++ b/formula/source/ui/resource/ModuleHelper.cxx @@ -62,8 +62,7 @@ OModuleImpl::OModuleImpl() OModuleImpl::~OModuleImpl() { - if (m_pResources) - delete m_pResources; + delete m_pResources; } diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx index 1e5fbf9f4d89..22393d27b537 100644 --- a/framework/source/uielement/addonstoolbarmanager.cxx +++ b/framework/source/uielement/addonstoolbarmanager.cxx @@ -148,8 +148,7 @@ void SAL_CALL AddonsToolBarManager::dispose() throw( RuntimeException, std::exce if ( nId > 0 ) { AddonsParams* pRuntimeItemData = static_cast<AddonsParams*>(m_pToolBar->GetItemData( nId )); - if ( pRuntimeItemData ) - delete pRuntimeItemData; + delete pRuntimeItemData; m_pToolBar->SetItemData( nId, NULL ); } } diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx index a0229d6b8a11..97b2d1baab7e 100644 --- a/framework/source/uielement/fontsizemenucontroller.cxx +++ b/framework/source/uielement/fontsizemenucontroller.cxx @@ -155,8 +155,7 @@ void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r vcl::FontInfo aFntInfo = pFontList->Get( m_aFontDescriptor.Name, m_aFontDescriptor.StyleName ); // setup font size array - if ( m_pHeightArray ) - delete m_pHeightArray; + delete m_pHeightArray; const sal_IntPtr* pTempAry; const sal_IntPtr* pAry = pFontList->GetSizeAry( aFntInfo ); diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx index 80e81c03032b..a9a33a41c053 100644 --- a/framework/source/uielement/statusbarmanager.cxx +++ b/framework/source/uielement/statusbarmanager.cxx @@ -210,8 +210,7 @@ void SAL_CALL StatusBarManager::dispose() throw( uno::RuntimeException, std::exc { AddonStatusbarItemData *pUserData = static_cast< AddonStatusbarItemData *>( m_pStatusBar->GetItemData( m_pStatusBar->GetItemId( n ) ) ); - if ( pUserData ) - delete pUserData; + delete pUserData; } m_pStatusBar.disposeAndClear(); diff --git a/helpcompiler/source/HelpLinker.cxx b/helpcompiler/source/HelpLinker.cxx index e4798b1523f3..624f8de7dd08 100644 --- a/helpcompiler/source/HelpLinker.cxx +++ b/helpcompiler/source/HelpLinker.cxx @@ -270,8 +270,7 @@ void HelpLinker::addBookmark( FILE* pFile_DBHelp, std::string thishid, void HelpLinker::initIndexerPreProcessor() { - if( m_pIndexerPreProcessor ) - delete m_pIndexerPreProcessor; + delete m_pIndexerPreProcessor; std::string mod = module; std::transform (mod.begin(), mod.end(), mod.begin(), tocharlower); m_pIndexerPreProcessor = new IndexerPreProcessor( mod, indexDirParentName, diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx index db7ed1156b08..d4457a5f1a7f 100644 --- a/hwpfilter/source/hwpfile.cxx +++ b/hwpfilter/source/hwpfile.cxx @@ -307,8 +307,7 @@ void HWPFile::TagsRead() } break; case FILETAG_OLE_OBJECT: - if (oledata) - delete oledata; + delete oledata; oledata = new OlePicture(size); oledata->Read(*this); break; diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx index 3eb93f364e2c..95334e8873fa 100644 --- a/i18npool/source/collator/collator_unicode.cxx +++ b/i18npool/source/collator/collator_unicode.cxx @@ -47,8 +47,8 @@ Collator_Unicode::Collator_Unicode() Collator_Unicode::~Collator_Unicode() { - if (collator) delete collator; - if (uca_base) delete uca_base; + delete collator; + delete uca_base; #ifndef DISABLE_DYNLOADING if (hModule) osl_unloadModule(hModule); #endif diff --git a/idlc/source/astexpression.cxx b/idlc/source/astexpression.cxx index fffeadf49b3e..ceda954a53d2 100644 --- a/idlc/source/astexpression.cxx +++ b/idlc/source/astexpression.cxx @@ -122,14 +122,10 @@ AstExpression::AstExpression(OString* scopedName) AstExpression::~AstExpression() { - if ( m_exprValue ) - delete m_exprValue; - if ( m_subExpr1 ) - delete m_subExpr1; - if ( m_subExpr2 ) - delete m_subExpr2; - if ( m_pSymbolicName ) - delete m_pSymbolicName; + delete m_exprValue; + delete m_subExpr1; + delete m_subExpr2; + delete m_pSymbolicName; } /* diff --git a/idlc/source/idlc.cxx b/idlc/source/idlc.cxx index 27cb47d93423..94d152501a01 100644 --- a/idlc/source/idlc.cxx +++ b/idlc/source/idlc.cxx @@ -218,19 +218,14 @@ Idlc::Idlc(Options* pOptions) Idlc::~Idlc() { - if (m_pRoot) - delete m_pRoot; - if (m_pScopes) - delete m_pScopes; - if (m_pErrorHandler) - delete m_pErrorHandler; + delete m_pRoot; + delete m_pScopes; + delete m_pErrorHandler; } void Idlc::init() { - if ( m_pRoot ) - delete m_pRoot; - + delete m_pRoot; m_pRoot = new AstModule(NT_root, OString(), NULL); // push the root node on the stack @@ -256,8 +251,7 @@ void Idlc::reset() m_documentation.clear(); m_pScopes->clear(); - if ( m_pRoot) - delete m_pRoot; + delete m_pRoot; m_pRoot = new AstModule(NT_root, OString(), NULL); @@ -363,10 +357,7 @@ Idlc* SAL_CALL idlc() Idlc* SAL_CALL setIdlc(Options* pOptions) { - if ( pStaticIdlc ) - { - delete pStaticIdlc; - } + delete pStaticIdlc; pStaticIdlc = new Idlc(pOptions); pStaticIdlc->init(); return pStaticIdlc; diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 25b2cdbf31b6..ee4fc4376b93 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -258,8 +258,7 @@ void Export::Init() Export::~Export() { - if( pParseQueue ) - delete pParseQueue; + delete pParseQueue; if ( bMergeMode ) { aOutput.mSimple->close(); @@ -1315,9 +1314,10 @@ ParserQueue::ParserQueue( Export& aExportObj ) } -ParserQueue::~ParserQueue(){ - if( aQueueNext ) delete aQueueNext; - if( aQueueCur ) delete aQueueCur; +ParserQueue::~ParserQueue() +{ + delete aQueueNext; + delete aQueueCur; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx index d5abd211a9df..f47880dbb2a9 100644 --- a/l10ntools/source/xmlparse.cxx +++ b/l10ntools/source/xmlparse.cxx @@ -333,8 +333,7 @@ XMLFile::XMLFile( const OString &rFileName ) // the file name, empty if created void XMLFile::Extract( XMLFile *pCur ) { - if( m_pXMLStrings ) - delete m_pXMLStrings; // Elements ? + delete m_pXMLStrings; // Elements ? m_pXMLStrings = new XMLHashMap(); if ( !pCur ) @@ -420,8 +419,7 @@ XMLFile& XMLFile::operator=(const XMLFile& rObj) m_aNodes_localize = rObj.m_aNodes_localize; m_vOrder = rObj.m_vOrder; - if( m_pXMLStrings ) - delete m_pXMLStrings; + delete m_pXMLStrings; if( rObj.m_pXMLStrings ) { diff --git a/lotuswordpro/source/filter/lwpbreaksoverride.cxx b/lotuswordpro/source/filter/lwpbreaksoverride.cxx index 12a855ab3748..23f7f83a1f51 100644 --- a/lotuswordpro/source/filter/lwpbreaksoverride.cxx +++ b/lotuswordpro/source/filter/lwpbreaksoverride.cxx @@ -79,8 +79,7 @@ LwpBreaksOverride::LwpBreaksOverride(LwpBreaksOverride const& rOther) LwpBreaksOverride::~LwpBreaksOverride() { - if( m_pNextStyle ) - delete m_pNextStyle; + delete m_pNextStyle; } LwpBreaksOverride* LwpBreaksOverride::clone() const diff --git a/lotuswordpro/source/filter/lwpfoundry.cxx b/lotuswordpro/source/filter/lwpfoundry.cxx index d343520ae96e..7e90c366d781 100644 --- a/lotuswordpro/source/filter/lwpfoundry.cxx +++ b/lotuswordpro/source/filter/lwpfoundry.cxx @@ -91,20 +91,10 @@ LwpFoundry::LwpFoundry(LwpObjectStream *pStrm, LwpDocument* pDoc) LwpFoundry::~LwpFoundry() { - if(m_pPieceMgr) - { - delete m_pPieceMgr; - } - if(m_pStyleMgr) - { - delete m_pStyleMgr; - } - if (m_pDropcapMgr) - delete m_pDropcapMgr; - if (m_pBulletStyleMgr) - { - delete m_pBulletStyleMgr; - } + delete m_pPieceMgr; + delete m_pStyleMgr; + delete m_pDropcapMgr; + delete m_pBulletStyleMgr; } void LwpFoundry::Read(LwpObjectStream *pStrm) diff --git a/lotuswordpro/source/filter/lwpfrib.cxx b/lotuswordpro/source/filter/lwpfrib.cxx index f93066082438..851a3db27d53 100644 --- a/lotuswordpro/source/filter/lwpfrib.cxx +++ b/lotuswordpro/source/filter/lwpfrib.cxx @@ -102,8 +102,7 @@ LwpFrib::LwpFrib(LwpPara* pPara) LwpFrib::~LwpFrib() { - if(m_pModifiers) - delete m_pModifiers; + delete m_pModifiers; } LwpFrib* LwpFrib::CreateFrib(LwpPara* pPara, LwpObjectStream* pObjStrm, sal_uInt8 fribtag,sal_uInt8 editID) diff --git a/lotuswordpro/source/filter/lwpobj.cxx b/lotuswordpro/source/filter/lwpobj.cxx index 7e15b6265fe3..5a0a79b3615c 100644 --- a/lotuswordpro/source/filter/lwpobj.cxx +++ b/lotuswordpro/source/filter/lwpobj.cxx @@ -74,8 +74,7 @@ LwpObject::LwpObject(LwpObjectHeader objHdr, LwpSvStream* pStrm) */ LwpObject::~LwpObject() { - if(m_pObjStrm) - delete m_pObjStrm; + delete m_pObjStrm; } /** diff --git a/lotuswordpro/source/filter/lwpparaborderoverride.cxx b/lotuswordpro/source/filter/lwpparaborderoverride.cxx index 318ff8d40f4c..254dc092c192 100644 --- a/lotuswordpro/source/filter/lwpparaborderoverride.cxx +++ b/lotuswordpro/source/filter/lwpparaborderoverride.cxx @@ -113,14 +113,10 @@ LwpParaBorderOverride::LwpParaBorderOverride(LwpParaBorderOverride const& rOther LwpParaBorderOverride::~LwpParaBorderOverride() { - if( m_pBorderStuff ) - delete m_pBorderStuff; - if( m_pBetweenStuff ) - delete m_pBetweenStuff; - if( m_pShadow ) - delete m_pShadow; - if( m_pMargins ) - delete m_pMargins; + delete m_pBorderStuff; + delete m_pBetweenStuff; + delete m_pShadow; + delete m_pMargins; } LwpParaBorderOverride* LwpParaBorderOverride::clone() const diff --git a/lotuswordpro/source/filter/xfilter/xfcell.cxx b/lotuswordpro/source/filter/xfilter/xfcell.cxx index ac79dda1e331..a263a6355ce6 100644 --- a/lotuswordpro/source/filter/xfilter/xfcell.cxx +++ b/lotuswordpro/source/filter/xfilter/xfcell.cxx @@ -75,8 +75,7 @@ XFCell::XFCell() XFCell::~XFCell() { - if( m_pSubTable ) - delete m_pSubTable; + delete m_pSubTable; } void XFCell::Add(XFContent *pContent) diff --git a/lotuswordpro/source/filter/xfilter/xfcellstyle.cxx b/lotuswordpro/source/filter/xfilter/xfcellstyle.cxx index b0d4881162b0..a6350e2f1f65 100644 --- a/lotuswordpro/source/filter/xfilter/xfcellstyle.cxx +++ b/lotuswordpro/source/filter/xfilter/xfcellstyle.cxx @@ -74,8 +74,7 @@ XFCellStyle::XFCellStyle() XFCellStyle::~XFCellStyle() { - if( m_pBorders ) - delete m_pBorders; + delete m_pBorders; } void XFCellStyle::SetPadding(double left, double right,double top, double bottom) @@ -97,15 +96,13 @@ void XFCellStyle::SetBackColor(XFColor& color) void XFCellStyle::SetBackImage(XFBGImage *pImage) { - if( m_pBackImage ) - delete m_pBackImage; + delete m_pBackImage; m_pBackImage = pImage; } void XFCellStyle::SetBorders(XFBorders *pBorders) { - if( m_pBorders ) - delete m_pBorders; + delete m_pBorders; m_pBorders = pBorders; } diff --git a/lotuswordpro/source/filter/xfilter/xfconfigmanager.cxx b/lotuswordpro/source/filter/xfilter/xfconfigmanager.cxx index 6b218bc42671..dab6c9da91c7 100644 --- a/lotuswordpro/source/filter/xfilter/xfconfigmanager.cxx +++ b/lotuswordpro/source/filter/xfilter/xfconfigmanager.cxx @@ -76,15 +76,13 @@ XFConfigManager::~XFConfigManager() void XFConfigManager::SetLineNumberConfig(XFLineNumberConfig *pLNConfig) { - if( m_pLineNumberConfig ) - delete m_pLineNumberConfig; + delete m_pLineNumberConfig; m_pLineNumberConfig = pLNConfig; } void XFConfigManager::SetFootnoteConfig(XFFootnoteConfig *pFNConfig) { - if( m_pFootnoteConfig ) - delete m_pFootnoteConfig; + delete m_pFootnoteConfig; m_pFootnoteConfig = pFNConfig; } diff --git a/lotuswordpro/source/filter/xfilter/xfframestyle.cxx b/lotuswordpro/source/filter/xfilter/xfframestyle.cxx index a0b485b002f6..b11ce54694e2 100644 --- a/lotuswordpro/source/filter/xfilter/xfframestyle.cxx +++ b/lotuswordpro/source/filter/xfilter/xfframestyle.cxx @@ -89,41 +89,33 @@ XFFrameStyle::XFFrameStyle() XFFrameStyle::~XFFrameStyle() { - if( m_pBorders ) - delete m_pBorders; - if( m_pColumns ) - delete m_pColumns; - if( m_pShadow ) - delete m_pShadow; - if( m_pBGImage ) - delete m_pBGImage; + delete m_pBorders; + delete m_pColumns; + delete m_pShadow; + delete m_pBGImage; } void XFFrameStyle::SetBorders(XFBorders *pBorders) { - if( m_pBorders ) - delete m_pBorders; + delete m_pBorders; m_pBorders = pBorders; } void XFFrameStyle::SetColumns(XFColumns *pColumns) { - if( m_pColumns ) - delete m_pColumns; + delete m_pColumns; m_pColumns = pColumns; } void XFFrameStyle::SetShadow(XFShadow *pShadow) { - if( m_pShadow ) - delete m_pShadow; + delete m_pShadow; m_pShadow = pShadow; } void XFFrameStyle::SetBackImage(XFBGImage *image) { - if( m_pBGImage ) - delete m_pBGImage; + delete m_pBGImage; m_pBGImage = image; } diff --git a/lotuswordpro/source/filter/xfilter/xfheaderstyle.cxx b/lotuswordpro/source/filter/xfilter/xfheaderstyle.cxx index 10345c886d83..d2521ab9bf39 100644 --- a/lotuswordpro/source/filter/xfilter/xfheaderstyle.cxx +++ b/lotuswordpro/source/filter/xfilter/xfheaderstyle.cxx @@ -73,12 +73,9 @@ XFHeaderStyle::XFHeaderStyle(bool isFooter) XFHeaderStyle::~XFHeaderStyle() { - if( m_pBorders ) - delete m_pBorders; - if( m_pBGImage ) - delete m_pBGImage; - if( m_pShadow ) - delete m_pShadow; + delete m_pBorders; + delete m_pBGImage; + delete m_pShadow; } void XFHeaderStyle::SetMargins(double left, double right, double bottom) @@ -114,15 +111,13 @@ void XFHeaderStyle::SetShadow(XFShadow *pShadow) void XFHeaderStyle::SetBorders(XFBorders *pBorders) { - if( m_pBorders ) - delete m_pBorders; + delete m_pBorders; m_pBorders = pBorders; } void XFHeaderStyle::SetBackImage(XFBGImage *image) { - if( m_pBGImage ) - delete m_pBGImage; + delete m_pBGImage; m_pBGImage = image; } diff --git a/lotuswordpro/source/filter/xfilter/xfindex.cxx b/lotuswordpro/source/filter/xfilter/xfindex.cxx index 40d64feefd9b..a028aa919120 100644 --- a/lotuswordpro/source/filter/xfilter/xfindex.cxx +++ b/lotuswordpro/source/filter/xfilter/xfindex.cxx @@ -76,8 +76,7 @@ XFIndex::XFIndex() XFIndex::~XFIndex() { - if( m_pTitle ) - delete m_pTitle; + delete m_pTitle; for(sal_uInt16 i=1;i<MAX_TOC_LEVEL+1;i++) { @@ -88,7 +87,7 @@ XFIndex::~XFIndex() { XFIndexTemplate * pTemplate = m_aTemplates.back(); m_aTemplates.pop_back(); - delete pTemplate;pTemplate=NULL; + delete pTemplate; } } diff --git a/lotuswordpro/source/filter/xfilter/xfmasterpage.cxx b/lotuswordpro/source/filter/xfilter/xfmasterpage.cxx index 2efc78decb80..084f50e757cf 100644 --- a/lotuswordpro/source/filter/xfilter/xfmasterpage.cxx +++ b/lotuswordpro/source/filter/xfilter/xfmasterpage.cxx @@ -71,23 +71,19 @@ XFMasterPage::XFMasterPage() XFMasterPage::~XFMasterPage() { - if( m_pHeader ) - delete m_pHeader; - if( m_pFooter ) - delete m_pFooter; + delete m_pHeader; + delete m_pFooter; } void XFMasterPage::SetHeader(XFHeader *pHeader) { - if( m_pHeader ) - delete m_pHeader; + delete m_pHeader; m_pHeader = pHeader; } void XFMasterPage::SetFooter(XFFooter *pFooter) { - if( m_pFooter ) - delete m_pFooter; + delete m_pFooter; m_pFooter = pFooter; } diff --git a/lotuswordpro/source/filter/xfilter/xfpagemaster.cxx b/lotuswordpro/source/filter/xfilter/xfpagemaster.cxx index dcf78947de67..15e2fa1e693c 100644 --- a/lotuswordpro/source/filter/xfilter/xfpagemaster.cxx +++ b/lotuswordpro/source/filter/xfilter/xfpagemaster.cxx @@ -78,18 +78,12 @@ m_fSepSpaceBelow(0), m_nSepLengthPercent(0) XFPageMaster::~XFPageMaster() { - if( m_pBorders ) - delete m_pBorders; - if( m_pShadow ) - delete m_pShadow; - if( m_pColumns ) - delete m_pColumns; - if( m_pHeaderStyle ) - delete m_pHeaderStyle; - if( m_pFooterStyle ) - delete m_pFooterStyle; - if( m_pBGImage ) - delete m_pBGImage; + delete m_pBorders; + delete m_pShadow; + delete m_pColumns; + delete m_pHeaderStyle; + delete m_pFooterStyle; + delete m_pBGImage; } enumXFStyle XFPageMaster::GetStyleFamily() @@ -140,8 +134,7 @@ void XFPageMaster::SetBackColor(XFColor color) void XFPageMaster::SetBackImage(XFBGImage *image) { - if( m_pBGImage ) - delete m_pBGImage; + delete m_pBGImage; m_pBGImage = image; } diff --git a/lotuswordpro/source/filter/xfilter/xfparastyle.cxx b/lotuswordpro/source/filter/xfilter/xfparastyle.cxx index 8364d1ae5c8b..701d057449f5 100644 --- a/lotuswordpro/source/filter/xfilter/xfparastyle.cxx +++ b/lotuswordpro/source/filter/xfilter/xfparastyle.cxx @@ -136,7 +136,7 @@ XFParaStyle& XFParaStyle::operator=(const XFParaStyle& other) if (this != &other) { // first , clean member - delete(m_pBGImage); + delete m_pBGImage; m_aTabs.Reset(); m_strParentStyleName = other.m_strParentStyleName; @@ -186,10 +186,8 @@ XFParaStyle& XFParaStyle::operator=(const XFParaStyle& other) XFParaStyle::~XFParaStyle() { - if( m_pBorders ) - delete m_pBorders; - if( m_pBGImage ) - delete m_pBGImage; + delete m_pBorders; + delete m_pBGImage; } enumXFStyle XFParaStyle::GetStyleFamily() @@ -234,15 +232,13 @@ void XFParaStyle::SetBackColor(XFColor& color) void XFParaStyle::SetBackImage(XFBGImage *image) { - if( m_pBGImage ) - delete m_pBGImage; + delete m_pBGImage; m_pBGImage = image; } void XFParaStyle::SetBorders(XFBorders *pBorders) { - if( m_pBorders ) - delete m_pBorders; + delete m_pBorders; m_pBorders = pBorders; } diff --git a/lotuswordpro/source/filter/xfilter/xfrow.cxx b/lotuswordpro/source/filter/xfilter/xfrow.cxx index 7f7a54078833..26c258174d50 100644 --- a/lotuswordpro/source/filter/xfilter/xfrow.cxx +++ b/lotuswordpro/source/filter/xfilter/xfrow.cxx @@ -79,8 +79,7 @@ XFRow::~XFRow() for( it=m_aCells.begin(); it!=m_aCells.end(); ++it ) { XFCell *pCell = (*it).second; - if( pCell ) - delete pCell; + delete pCell; } } @@ -88,16 +87,6 @@ void XFRow::AddCell(XFCell *pCell) { if( !pCell ) return; -/* sal_Int32 col = pCell->GetCol(); - if( col<1 ) - { - pCell->SetCol(m_aCells.size()+1); - } - - col = pCell->GetCol(); - if( m_aCells.find(col) != m_aCells.end() ) - delete m_aCells[col]; -*/ sal_Int32 col = m_aCells.size()+1; pCell->SetCol(col); pCell->SetOwnerRow(this); diff --git a/lotuswordpro/source/filter/xfilter/xfrowstyle.cxx b/lotuswordpro/source/filter/xfilter/xfrowstyle.cxx index ffeaa0603440..a8acfbadc490 100644 --- a/lotuswordpro/source/filter/xfilter/xfrowstyle.cxx +++ b/lotuswordpro/source/filter/xfilter/xfrowstyle.cxx @@ -108,8 +108,7 @@ XFRowStyle& XFRowStyle::operator=(XFRowStyle const &other) m_fMinHeight = other.m_fMinHeight; m_aBackColor = other.m_aBackColor; - if( m_pBGImage ) - delete m_pBGImage; + delete m_pBGImage; if( other.m_pBGImage ) m_pBGImage = new XFBGImage(*other.m_pBGImage); diff --git a/lotuswordpro/source/filter/xfilter/xfsaxstream.cxx b/lotuswordpro/source/filter/xfilter/xfsaxstream.cxx index 9419630d4650..6a5bcd7ccc4a 100644 --- a/lotuswordpro/source/filter/xfilter/xfsaxstream.cxx +++ b/lotuswordpro/source/filter/xfilter/xfsaxstream.cxx @@ -87,8 +87,7 @@ XFSaxStream::XFSaxStream(Reference<XDocumentHandler>& xHandler) XFSaxStream::~XFSaxStream() { - if( m_pAttrList ) - delete m_pAttrList; + delete m_pAttrList; } void XFSaxStream::StartDocument() diff --git a/lotuswordpro/source/filter/xfilter/xfsectionstyle.cxx b/lotuswordpro/source/filter/xfilter/xfsectionstyle.cxx index dd04e8662054..cb9d5cf972f9 100644 --- a/lotuswordpro/source/filter/xfilter/xfsectionstyle.cxx +++ b/lotuswordpro/source/filter/xfilter/xfsectionstyle.cxx @@ -70,10 +70,8 @@ XFSectionStyle::XFSectionStyle() XFSectionStyle::~XFSectionStyle() { - if( m_pColumns ) - delete m_pColumns; - if( m_pBackImage ) - delete m_pBackImage; + delete m_pColumns; + delete m_pBackImage; } enumXFStyle XFSectionStyle::GetStyleFamily() @@ -93,8 +91,7 @@ void XFSectionStyle::SetMarginRight(double right) void XFSectionStyle::SetColumns(XFColumns *pColumns) { - if( m_pColumns ) - delete m_pColumns; + delete m_pColumns; m_pColumns = pColumns; } diff --git a/lotuswordpro/source/filter/xfilter/xfstylemanager.cxx b/lotuswordpro/source/filter/xfilter/xfstylemanager.cxx index 6a31a9cd1f73..8704816b3fc3 100644 --- a/lotuswordpro/source/filter/xfilter/xfstylemanager.cxx +++ b/lotuswordpro/source/filter/xfilter/xfstylemanager.cxx @@ -203,8 +203,7 @@ IXFStyleRet XFStyleManager::AddStyle(IXFStyle *pStyle) } else if( pStyle->GetStyleFamily() == enumXFStyleOutline ) { - if( s_pOutlineStyle ) - delete s_pOutlineStyle; + delete s_pOutlineStyle; s_pOutlineStyle = pStyle; } else if( pStyle->GetStyleFamily() == enumXFStyleStrokeDash ) diff --git a/lotuswordpro/source/filter/xfilter/xftablestyle.cxx b/lotuswordpro/source/filter/xfilter/xftablestyle.cxx index 0fc87b216541..0e055515c25e 100644 --- a/lotuswordpro/source/filter/xfilter/xftablestyle.cxx +++ b/lotuswordpro/source/filter/xfilter/xftablestyle.cxx @@ -69,14 +69,12 @@ XFTableStyle::XFTableStyle() XFTableStyle::~XFTableStyle() { - if( m_pBGImage ) - delete m_pBGImage; + delete m_pBGImage; } void XFTableStyle::SetBackImage(XFBGImage *pImage) { - if( m_pBGImage ) - delete m_pBGImage; + delete m_pBGImage; m_pBGImage = pImage; } diff --git a/package/source/xstor/ocompinstream.cxx b/package/source/xstor/ocompinstream.cxx index bcf502798b5d..00561849c887 100644 --- a/package/source/xstor/ocompinstream.cxx +++ b/package/source/xstor/ocompinstream.cxx @@ -63,18 +63,15 @@ OInputCompStream::OInputCompStream( uno::Reference < io::XInputStream > xStream, OInputCompStream::~OInputCompStream() { - { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); - - if ( !m_bDisposed ) - { - m_refCount++; - dispose(); - } + ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); - if ( m_pInterfaceContainer ) - delete m_pInterfaceContainer; + if ( !m_bDisposed ) + { + m_refCount++; + dispose(); } + + delete m_pInterfaceContainer; } uno::Any SAL_CALL OInputCompStream::queryInterface( const uno::Type& rType ) diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index 7c1f440d5f77..3096b8356cf8 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -548,11 +548,8 @@ MethodEntry::MethodEntry() MethodEntry::~MethodEntry() { - if (m_params) - delete[] m_params; - - if (m_excNames) - delete[] m_excNames; + delete[] m_params; + delete[] m_excNames; } void MethodEntry::setData(const OString& name, diff --git a/reportdesign/source/core/sdr/ModuleHelper.cxx b/reportdesign/source/core/sdr/ModuleHelper.cxx index ecbd677ed606..3632382f0b53 100644 --- a/reportdesign/source/core/sdr/ModuleHelper.cxx +++ b/reportdesign/source/core/sdr/ModuleHelper.cxx @@ -63,8 +63,7 @@ OModuleImpl::OModuleImpl() OModuleImpl::~OModuleImpl() { - if (m_pResources) - delete m_pResources; + delete m_pResources; } diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx index 6f906e67a746..d8517e142749 100644 --- a/rsc/source/parser/rsclex.cxx +++ b/rsc/source/parser/rsclex.cxx @@ -357,8 +357,7 @@ void EndParser() delete pStringContainer; pStringContainer = NULL; - if( pExp ) - delete pExp; + delete pExp; pTC = NULL; pFI = NULL; pExp = NULL; diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx index 7daa2f0ec531..ac1fb17b2ce8 100644 --- a/rsc/source/tools/rscdef.cxx +++ b/rsc/source/tools/rscdef.cxx @@ -155,8 +155,7 @@ void RscDefine::DecRef() void RscDefine::DefineToNumber() { - if( pExp ) - delete pExp; + delete pExp; pExp = NULL; SetName(OString::number(lId)); } diff --git a/sax/source/expatwrap/xml2utf.cxx b/sax/source/expatwrap/xml2utf.cxx index aca05ed937d8..f58023ca8e4a 100644 --- a/sax/source/expatwrap/xml2utf.cxx +++ b/sax/source/expatwrap/xml2utf.cxx @@ -118,10 +118,8 @@ sal_Int32 XMLFile2UTFConverter::readAndConvert( Sequence<sal_Int8> &seq , sal_In XMLFile2UTFConverter::~XMLFile2UTFConverter() { - if( m_pText2Unicode ) - delete m_pText2Unicode; - if( m_pUnicode2Text ) - delete m_pUnicode2Text; + delete m_pText2Unicode; + delete m_pUnicode2Text; } diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 4af29d6d1dcd..72b698b47ba2 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -1105,8 +1105,7 @@ void ScFormulaCell::Compile( const OUString& rFormula, bool bNoListening, ScCompiler aComp( pDocument, aPos); aComp.SetGrammar(eGrammar); pCode = aComp.CompileString( rFormula ); - if ( pCodeOld ) - delete pCodeOld; + delete pCodeOld; if( !pCode->GetCodeError() ) { if ( !pCode->GetLen() && !aResult.GetHybridFormula().isEmpty() && rFormula == aResult.GetHybridFormula() ) @@ -1140,8 +1139,7 @@ void ScFormulaCell::Compile( ScTokenArray* pCodeOld = pCode; ScCompiler aComp(rCxt, aPos); pCode = aComp.CompileString( rFormula ); - if ( pCodeOld ) - delete pCodeOld; + delete pCodeOld; if( !pCode->GetCodeError() ) { if ( !pCode->GetLen() && !aResult.GetHybridFormula().isEmpty() && rFormula == aResult.GetHybridFormula() ) diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index be1bc8fc5ba0..a1bc8ee56cd5 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -677,8 +677,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if (rInner == nIEnd) break; if (bPositive) ++rInner; else --rInner; } - if ( pNewPattern ) - delete pNewPattern; + delete pNewPattern; // Analyse diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index c8bdc22dab18..7158224e9d68 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -3736,14 +3736,11 @@ ScInterpreter::ScInterpreter( ScFormulaCell* pCell, ScDocument* pDoc, ScInterpreter::~ScInterpreter() { -// delete pStack; - if ( pStackObj == pGlobalStack ) bGlobalStackInUse = false; else delete pStackObj; - if (pTokenMatrixMap) - delete pTokenMatrixMap; + delete pTokenMatrixMap; } void ScInterpreter::SetGlobalConfig(const ScCalcConfig& rConfig) diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index 9b316c477d24..5df0787b4768 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -568,8 +568,7 @@ ExcFilterCondition::ExcFilterCondition() : ExcFilterCondition::~ExcFilterCondition() { - if( pText ) - delete pText; + delete pText; } sal_Size ExcFilterCondition::GetTextBytes() const diff --git a/sc/source/filter/excel/exctools.cxx b/sc/source/filter/excel/exctools.cxx index c23c70dab191..6f85f28c3044 100644 --- a/sc/source/filter/excel/exctools.cxx +++ b/sc/source/filter/excel/exctools.cxx @@ -223,12 +223,9 @@ ExcScenario::ExcScenario( XclImpStream& rIn, const RootData& rR ) ExcScenario::~ExcScenario() { - if( pName ) - delete pName; - if( pComment ) - delete pComment; - if( pUserName ) - delete pUserName; + delete pName; + delete pComment; + delete pUserName; } void ExcScenario::Apply( const XclImpRoot& rRoot, const bool bLast ) diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index 001286c379c1..ef9a9ff4e4bb 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -464,8 +464,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu } } } - if ( pProgress ) - delete pProgress; + delete pProgress; } bool ScEEImport::GraphicSize( SCCOL nCol, SCROW nRow, SCTAB /*nTab*/, ScEEParseEntry* pE ) diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx index 91788a6b030e..bf0eafd5ad92 100644 --- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx @@ -56,8 +56,7 @@ ScChangeTrackingExportHelper::ScChangeTrackingExportHelper(ScXMLExport& rTempExp ScChangeTrackingExportHelper::~ScChangeTrackingExportHelper() { - if (pDependings) - delete pDependings; + delete pDependings; } OUString ScChangeTrackingExportHelper::GetChangeID(const sal_uInt32 nActionNumber) diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx index 33c601679266..cbc0442f1292 100644 --- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx @@ -136,8 +136,7 @@ ScMyDelAction::ScMyDelAction(const ScChangeActionType nActionTypeP) ScMyDelAction::~ScMyDelAction() { - if (pInsCutOff) - delete pInsCutOff; + delete pInsCutOff; } ScMyMoveAction::ScMyMoveAction() @@ -149,8 +148,7 @@ ScMyMoveAction::ScMyMoveAction() ScMyMoveAction::~ScMyMoveAction() { - if (pMoveRanges) - delete pMoveRanges; + delete pMoveRanges; } ScMyContentAction::ScMyContentAction() diff --git a/sc/source/filter/xml/XMLExportSharedData.cxx b/sc/source/filter/xml/XMLExportSharedData.cxx index 5f2b06f2244a..0e3fd2c61f50 100644 --- a/sc/source/filter/xml/XMLExportSharedData.cxx +++ b/sc/source/filter/xml/XMLExportSharedData.cxx @@ -37,16 +37,11 @@ ScMySharedData::ScMySharedData(const sal_Int32 nTempTableCount) : ScMySharedData::~ScMySharedData() { - if (pShapesContainer) - delete pShapesContainer; - if (pTableShapes) - delete pTableShapes; - if (pDrawPages) - delete pDrawPages; - if (pDetectiveObjContainer) - delete pDetectiveObjContainer; - if (pNoteShapes) - delete pNoteShapes; + delete pShapesContainer; + delete pTableShapes; + delete pDrawPages; + delete pDetectiveObjContainer; + delete pNoteShapes; } void ScMySharedData::SetLastColumn(const sal_Int32 nTable, const sal_Int32 nCol) diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index 10231fb0a4ef..de8a6a07f5c4 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -339,8 +339,7 @@ void ScMyValidationsContainer::WriteMessage(ScXMLExport& rExport, rExport.GetTextParagraphExport()->exportText(sTemp.makeStringAndClear(), bPrevCharWasSpace); } } - if (pMessage) - delete pMessage; + delete pMessage; } void ScMyValidationsContainer::WriteValidations(ScXMLExport& rExport) diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx index 2232a1f592ad..1499f34d7afc 100644 --- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx +++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx @@ -977,8 +977,7 @@ ScXMLChangeTextPContext::ScXMLChangeTextPContext( ScXMLImport& rImport, ScXMLChangeTextPContext::~ScXMLChangeTextPContext() { - if (pTextPContext) - delete pTextPContext; + delete pTextPContext; } SvXMLImportContext *ScXMLChangeTextPContext::CreateChildContext( sal_uInt16 nTempPrefix, diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx index 9ae4d34a1e85..ba3eae03833f 100644 --- a/sc/source/ui/dbgui/sfiltdlg.cxx +++ b/sc/source/ui/dbgui/sfiltdlg.cxx @@ -110,8 +110,7 @@ void ScSpecialFilterDlg::dispose() delete pOptionsMgr; - if ( pOutItem ) - delete pOutItem; + delete pOutItem; // Hack: RefInput-Kontrolle pIdle->Stop(); diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx index 719f03726188..a237f18d58c1 100644 --- a/sc/source/ui/miscdlgs/instbdlg.cxx +++ b/sc/source/ui/miscdlgs/instbdlg.cxx @@ -281,8 +281,7 @@ IMPL_LINK_NOARG(ScInsertTableDlg, ChoiceHdl_Impl) IMPL_LINK_NOARG(ScInsertTableDlg, BrowseHdl_Impl) { - if ( pDocInserter ) - delete pDocInserter; + delete pDocInserter; pDocInserter = new ::sfx2::DocumentInserter( OUString::createFromAscii( ScDocShell::Factory().GetShortName() ) ); pDocInserter->StartExecuteModal( LINK( this, ScInsertTableDlg, DialogClosedHdl ) ); diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 5a8de34029fe..80cd7520bbfc 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -145,8 +145,7 @@ SdPage::~SdPage() EndListenOutlineText(); - if( mpItems ) - delete mpItems; + delete mpItems; Clear(); } diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 033eeb0fe52b..9bdf9cf915f0 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -1549,8 +1549,7 @@ bool SdPublishingDlg::Load() bool bOk = pIStm && ( pIStm->GetError() == 0); - if( pIStm ) - delete pIStm; + delete pIStm; if( !bOk ) return false; diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index 633427ec3e80..f0bf4bf81c1e 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -2217,8 +2217,7 @@ void CustomAnimationDialog::dispose() STLPropertySet* CustomAnimationDialog::getResultSet() { - if( mpResultSet ) - delete mpResultSet; + delete mpResultSet; mpResultSet = createDefaultSet(); @@ -2292,8 +2291,7 @@ PropertyControl::~PropertyControl() void PropertyControl::dispose() { - if( mpSubControl ) - delete mpSubControl; + delete mpSubControl; ListBox::dispose(); } diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index 53be94336ebf..899388a4c9c6 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -75,8 +75,7 @@ SdUnoPageBackground::~SdUnoPageBackground() throw() if( mpDoc ) EndListening( *mpDoc ); - if( mpSet ) - delete mpSet; + delete mpSet; } void SdUnoPageBackground::Notify( SfxBroadcaster&, const SfxHint& rHint ) diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 455640e1a0e1..7d985036bcec 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -175,8 +175,7 @@ OutlineView::~OutlineView() mrOutlineViewShell.GetViewShellBase().GetEventMultiplexer()->RemoveEventListener( aLink ); DisconnectFromApplication(); - if( mpProgress ) - delete mpProgress; + delete mpProgress; // unregister OutlinerViews and destroy them for (sal_uInt16 nView = 0; nView < MAX_OUTLINERVIEWS; nView++) @@ -604,9 +603,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) if (mnPagesToProcess > PROCESS_WITH_PROGRESS_THRESHOLD) { - if( mpProgress ) - delete mpProgress; - + delete mpProgress; mpProgress = new SfxProgress( GetDocSh(), SD_RESSTR(STR_CREATE_PAGES), mnPagesToProcess ); } else @@ -1196,9 +1193,7 @@ IMPL_LINK_NOARG(OutlineView, RemovingPagesHdl) if (mnPagesToProcess) { - if( mpProgress ) - delete mpProgress; - + delete mpProgress; mpProgress = new SfxProgress( GetDocSh(), SD_RESSTR(STR_DELETE_PAGES), mnPagesToProcess ); } mrOutliner.UpdateFields(); diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx index 9765086a333d..1f8cf7e7a32c 100644 --- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx @@ -1054,8 +1054,7 @@ struct PDFFileImplData PDFFile::~PDFFile() { - if( m_pData ) - delete m_pData; + delete m_pData; } bool PDFFile::isEncrypted() const diff --git a/sdext/source/pdfimport/tree/genericelements.cxx b/sdext/source/pdfimport/tree/genericelements.cxx index 7332495fa66a..67d2767ccc63 100644 --- a/sdext/source/pdfimport/tree/genericelements.cxx +++ b/sdext/source/pdfimport/tree/genericelements.cxx @@ -266,10 +266,8 @@ TextElement* ParagraphElement::getFirstTextChild() const PageElement::~PageElement() { - if( HeaderElement ) - delete HeaderElement; - if( FooterElement ) - delete FooterElement; + delete HeaderElement; + delete FooterElement; } void PageElement::visitedBy( ElementTreeVisitor& rVisitor, diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index 4eb4e65cd373..12bd1ccacb52 100644 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -181,8 +181,7 @@ bool SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/, { // otherwise it will be executed asynchronously { - if( pRequest ) - delete pRequest; + delete pRequest; pRequest = new DdeRequest( *pConnection, sItem ); pRequest->SetDataHdl( LINK( this, SvDDEObject, ImplGetDDEData ) ); diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx index f447273a90ed..380b3ba02c93 100644 --- a/sfx2/source/appl/xpackcreator.cxx +++ b/sfx2/source/appl/xpackcreator.cxx @@ -117,8 +117,7 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const OUString& aFolde } catch (const uno::RuntimeException&) { - if ( pTempStream ) - delete pTempStream; + delete pTempStream; if ( !aTempURL.isEmpty() ) ::utl::UCBContentHelper::Kill( aTempURL ); @@ -127,8 +126,7 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const OUString& aFolde } catch (const io::IOException&) { - if ( pTempStream ) - delete pTempStream; + delete pTempStream; if ( !aTempURL.isEmpty() ) ::utl::UCBContentHelper::Kill( aTempURL ); @@ -139,8 +137,7 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const OUString& aFolde { } - if ( pTempStream ) - delete pTempStream; + delete pTempStream; if ( !aTempURL.isEmpty() ) ::utl::UCBContentHelper::Kill( aTempURL ); diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 3ca399f97d30..ddb1ee1048d7 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -365,11 +365,8 @@ ModelData_Impl::ModelData_Impl( SfxStoringHelper& aOwner, ModelData_Impl::~ModelData_Impl() { FreeDocumentProps(); - if ( m_pDocumentPropsHM ) - delete m_pDocumentPropsHM; - - if ( m_pModulePropsHM ) - delete m_pModulePropsHM; + delete m_pDocumentPropsHM; + delete m_pModulePropsHM; } diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx index fbc38528430c..dbb4402dd0c0 100644 --- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx +++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx @@ -108,13 +108,9 @@ COooFilter::COooFilter() : COooFilter::~COooFilter() { delete [] m_pAttributes; - - if (m_pContentReader) - delete m_pContentReader; - if (m_pMetaInfoReader) - delete m_pMetaInfoReader; - if (m_pStream) - delete m_pStream; + delete m_pContentReader; + delete m_pMetaInfoReader; + delete m_pStream; InterlockedDecrement( &g_lInstances ); } @@ -576,12 +572,10 @@ SCODE STDMETHODCALLTYPE COooFilter::Load(LPCWSTR pszFileName, DWORD /*dwMode*/) // Open the file previously specified in call to IPersistFile::Load and get content. try { - if (m_pMetaInfoReader) - delete m_pMetaInfoReader; + delete m_pMetaInfoReader; m_pMetaInfoReader = new CMetaInfoReader(WStringToString(m_pwszFileName)); - if (m_pContentReader) - delete m_pContentReader; + delete m_pContentReader; m_pContentReader = new CContentReader(WStringToString(m_pwszFileName), m_pMetaInfoReader->getDefaultLocale()); } catch (const std::exception&) @@ -637,12 +631,10 @@ SCODE STDMETHODCALLTYPE COooFilter::Load(IStream *pStm) m_pStream = new BufferStream(pStm); try { - if (m_pMetaInfoReader) - delete m_pMetaInfoReader; + delete m_pMetaInfoReader; m_pMetaInfoReader = new CMetaInfoReader(m_pStream); - if (m_pContentReader) - delete m_pContentReader; + delete m_pContentReader; m_pContentReader = new CContentReader(m_pStream, m_pMetaInfoReader->getDefaultLocale()); } catch (const std::exception&) diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 19bb96ce22fe..a4e1110610a7 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -702,14 +702,12 @@ UCBStorageStream_Impl::~UCBStorageStream_Impl() if( m_rSource.is() ) m_rSource.clear(); - if( m_pStream ) - delete m_pStream; + delete m_pStream; if ( !m_aTempURL.isEmpty() ) ::utl::UCBContentHelper::Kill( m_aTempURL ); - if( m_pContent ) - delete m_pContent; + delete m_pContent; } diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index a9b6d9881b15..460706e334a7 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -237,8 +237,7 @@ OUString SmDocShell::GetAccessibleText() void SmDocShell::Parse() { - if (pTree) - delete pTree; + delete pTree; ReplaceBadChars(); pTree = aInterpreter.Parse(aText); nModifyCount++; //! see comment for SID_GAPHIC_SM in SmDocShell::GetState @@ -679,8 +678,7 @@ SmDocShell::~SmDocShell() EndListening(*pp->GetConfig()); - if(pCursor) - delete pCursor; + delete pCursor; pCursor = NULL; delete pEditEngine; diff --git a/svgio/source/svgreader/svgcirclenode.cxx b/svgio/source/svgreader/svgcirclenode.cxx index 17031af2bf20..0f0c63a6a411 100644 --- a/svgio/source/svgreader/svgcirclenode.cxx +++ b/svgio/source/svgreader/svgcirclenode.cxx @@ -39,7 +39,7 @@ namespace svgio SvgCircleNode::~SvgCircleNode() { - if(mpaTransform) delete mpaTransform; + delete mpaTransform; } const SvgStyleAttributes* SvgCircleNode::getSvgStyleAttributes() const diff --git a/svgio/source/svgreader/svgclippathnode.cxx b/svgio/source/svgreader/svgclippathnode.cxx index 7d4ac8977e3f..7100535b913c 100644 --- a/svgio/source/svgreader/svgclippathnode.cxx +++ b/svgio/source/svgreader/svgclippathnode.cxx @@ -42,7 +42,7 @@ namespace svgio SvgClipPathNode::~SvgClipPathNode() { - if(mpaTransform) delete mpaTransform; + delete mpaTransform; } const SvgStyleAttributes* SvgClipPathNode::getSvgStyleAttributes() const diff --git a/svgio/source/svgreader/svgellipsenode.cxx b/svgio/source/svgreader/svgellipsenode.cxx index e23dfaa62c01..93caf79d11c4 100644 --- a/svgio/source/svgreader/svgellipsenode.cxx +++ b/svgio/source/svgreader/svgellipsenode.cxx @@ -40,7 +40,7 @@ namespace svgio SvgEllipseNode::~SvgEllipseNode() { - if(mpaTransform) delete mpaTransform; + delete mpaTransform; } const SvgStyleAttributes* SvgEllipseNode::getSvgStyleAttributes() const diff --git a/svgio/source/svgreader/svggnode.cxx b/svgio/source/svgreader/svggnode.cxx index 306de2e15a29..0b7f49b26888 100644 --- a/svgio/source/svgreader/svggnode.cxx +++ b/svgio/source/svgreader/svggnode.cxx @@ -38,7 +38,7 @@ namespace svgio SvgGNode::~SvgGNode() { - if(mpaTransform) delete mpaTransform; + delete mpaTransform; } const SvgStyleAttributes* SvgGNode::getSvgStyleAttributes() const diff --git a/svgio/source/svgreader/svggradientnode.cxx b/svgio/source/svgreader/svggradientnode.cxx index 3bc72e5ef92a..c9ab440d3db9 100644 --- a/svgio/source/svgreader/svggradientnode.cxx +++ b/svgio/source/svgreader/svggradientnode.cxx @@ -59,7 +59,7 @@ namespace svgio SvgGradientNode::~SvgGradientNode() { - if(mpaGradientTransform) delete mpaGradientTransform; + delete mpaGradientTransform; // do NOT delete mpXLink, it's only referenced, not owned } diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index 5423e3beafe3..55f62dcfa588 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -57,7 +57,7 @@ namespace svgio SvgImageNode::~SvgImageNode() { - if(mpaTransform) delete mpaTransform; + delete mpaTransform; } const SvgStyleAttributes* SvgImageNode::getSvgStyleAttributes() const diff --git a/svgio/source/svgreader/svglinenode.cxx b/svgio/source/svgreader/svglinenode.cxx index dd71ee184f29..d9371a30ae73 100644 --- a/svgio/source/svgreader/svglinenode.cxx +++ b/svgio/source/svgreader/svglinenode.cxx @@ -40,7 +40,7 @@ namespace svgio SvgLineNode::~SvgLineNode() { - if(mpaTransform) delete mpaTransform; + delete mpaTransform; } const SvgStyleAttributes* SvgLineNode::getSvgStyleAttributes() const diff --git a/svgio/source/svgreader/svgmarkernode.cxx b/svgio/source/svgreader/svgmarkernode.cxx index e9a3085d072c..cabe6d0e6e0e 100644 --- a/svgio/source/svgreader/svgmarkernode.cxx +++ b/svgio/source/svgreader/svgmarkernode.cxx @@ -43,7 +43,7 @@ namespace svgio SvgMarkerNode::~SvgMarkerNode() { - if(mpViewBox) delete mpViewBox; + delete mpViewBox; } const SvgStyleAttributes* SvgMarkerNode::getSvgStyleAttributes() const diff --git a/svgio/source/svgreader/svgmasknode.cxx b/svgio/source/svgreader/svgmasknode.cxx index 9e467091a07f..6aed68a960c6 100644 --- a/svgio/source/svgreader/svgmasknode.cxx +++ b/svgio/source/svgreader/svgmasknode.cxx @@ -48,7 +48,7 @@ namespace svgio SvgMaskNode::~SvgMaskNode() { - if(mpaTransform) delete mpaTransform; + delete mpaTransform; } const SvgStyleAttributes* SvgMaskNode::getSvgStyleAttributes() const diff --git a/svgio/source/svgreader/svgpathnode.cxx b/svgio/source/svgreader/svgpathnode.cxx index 7b14b727d5cf..4e7b72ecfad6 100644 --- a/svgio/source/svgreader/svgpathnode.cxx +++ b/svgio/source/svgreader/svgpathnode.cxx @@ -37,8 +37,8 @@ namespace svgio SvgPathNode::~SvgPathNode() { - if(mpPolyPolygon) delete mpPolyPolygon; - if(mpaTransform) delete mpaTransform; + delete mpPolyPolygon; + delete mpaTransform; } const SvgStyleAttributes* SvgPathNode::getSvgStyleAttributes() const diff --git a/svgio/source/svgreader/svgpatternnode.cxx b/svgio/source/svgreader/svgpatternnode.cxx index 48e0bf03d0d6..7df26f609204 100644 --- a/svgio/source/svgreader/svgpatternnode.cxx +++ b/svgio/source/svgreader/svgpatternnode.cxx @@ -54,10 +54,10 @@ namespace svgio SvgPatternNode::~SvgPatternNode() { - if(mpViewBox) delete mpViewBox; - if(mpaPatternTransform) delete mpaPatternTransform; - if(mpPatternUnits) delete mpPatternUnits; - if(mpPatternContentUnits) delete mpPatternContentUnits; + delete mpViewBox; + delete mpaPatternTransform; + delete mpPatternUnits; + delete mpPatternContentUnits; } const SvgStyleAttributes* SvgPatternNode::getSvgStyleAttributes() const diff --git a/svgio/source/svgreader/svgpolynode.cxx b/svgio/source/svgreader/svgpolynode.cxx index 5edd74696dee..dfea1ea3976f 100644 --- a/svgio/source/svgreader/svgpolynode.cxx +++ b/svgio/source/svgreader/svgpolynode.cxx @@ -40,8 +40,8 @@ namespace svgio SvgPolyNode::~SvgPolyNode() { - if(mpaTransform) delete mpaTransform; - if(mpPolygon) delete mpPolygon; + delete mpaTransform; + delete mpPolygon; } const SvgStyleAttributes* SvgPolyNode::getSvgStyleAttributes() const diff --git a/svgio/source/svgreader/svgrectnode.cxx b/svgio/source/svgreader/svgrectnode.cxx index fa3f1ddff90c..2edf2838fc20 100644 --- a/svgio/source/svgreader/svgrectnode.cxx +++ b/svgio/source/svgreader/svgrectnode.cxx @@ -42,7 +42,7 @@ namespace svgio SvgRectNode::~SvgRectNode() { - if(mpaTransform) delete mpaTransform; + delete mpaTransform; } const SvgStyleAttributes* SvgRectNode::getSvgStyleAttributes() const diff --git a/svgio/source/svgreader/svgsvgnode.cxx b/svgio/source/svgreader/svgsvgnode.cxx index dcc0bf9ee823..f33961b396d6 100644 --- a/svgio/source/svgreader/svgsvgnode.cxx +++ b/svgio/source/svgreader/svgsvgnode.cxx @@ -106,7 +106,7 @@ namespace svgio SvgSvgNode::~SvgSvgNode() { - if(mpViewBox) delete mpViewBox; + delete mpViewBox; } const SvgStyleAttributes* SvgSvgNode::getSvgStyleAttributes() const diff --git a/svgio/source/svgreader/svgsymbolnode.cxx b/svgio/source/svgreader/svgsymbolnode.cxx index 78cbb4c75d2e..86ef1df59abd 100644 --- a/svgio/source/svgreader/svgsymbolnode.cxx +++ b/svgio/source/svgreader/svgsymbolnode.cxx @@ -37,7 +37,7 @@ namespace svgio SvgSymbolNode::~SvgSymbolNode() { - if(mpViewBox) delete mpViewBox; + delete mpViewBox; } const SvgStyleAttributes* SvgSymbolNode::getSvgStyleAttributes() const diff --git a/svgio/source/svgreader/svgtextnode.cxx b/svgio/source/svgreader/svgtextnode.cxx index e70f80ae6aee..0ad425cd4b10 100644 --- a/svgio/source/svgreader/svgtextnode.cxx +++ b/svgio/source/svgreader/svgtextnode.cxx @@ -42,7 +42,7 @@ namespace svgio SvgTextNode::~SvgTextNode() { - if(mpaTransform) delete mpaTransform; + delete mpaTransform; } const SvgStyleAttributes* SvgTextNode::getSvgStyleAttributes() const diff --git a/svgio/source/svgreader/svgusenode.cxx b/svgio/source/svgreader/svgusenode.cxx index 42d5c3111d25..04b0893efe7c 100644 --- a/svgio/source/svgreader/svgusenode.cxx +++ b/svgio/source/svgreader/svgusenode.cxx @@ -41,7 +41,7 @@ namespace svgio SvgUseNode::~SvgUseNode() { - if(mpaTransform) delete mpaTransform; + delete mpaTransform; } const SvgStyleAttributes* SvgUseNode::getSvgStyleAttributes() const diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx index d3c3c9a7c23c..4caaf7b7a28c 100644 --- a/svl/source/fsstor/fsstorage.cxx +++ b/svl/source/fsstor/fsstorage.cxx @@ -115,12 +115,9 @@ struct FSStorage_Impl FSStorage_Impl::~FSStorage_Impl() { - if ( m_pListenersContainer ) - delete m_pListenersContainer; - if ( m_pTypeCollection ) - delete m_pTypeCollection; - if ( m_pContent ) - delete m_pContent; + delete m_pListenersContainer; + delete m_pTypeCollection; + delete m_pContent; } FSStorage::FSStorage( const ::ucbhelper::Content& aContent, diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 3fe79c84a2ec..10fa19fac992 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -1520,8 +1520,7 @@ NameTranslator_Impl::NameTranslator_Impl( const INetURLObject& rActualFolder ) NameTranslator_Impl::~NameTranslator_Impl() { - if( mpActFolder ) - delete mpActFolder; + delete mpActFolder; } void NameTranslator_Impl::SetActualFolder( const INetURLObject& rActualFolder ) @@ -1798,7 +1797,7 @@ void SvtFileView_Impl::FilterFolderContent_Impl( const OUString &rFilter ) if( bDelete ) { // none of the filters did match - delete (*aContentLoop); + delete *aContentLoop; if ( maContent.begin() == aContentLoop ) { diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index a1f21fa35010..e4d83193bf18 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -1013,8 +1013,7 @@ void SvTreeListBox::EditText( const OUString& rStr, const Rectangle& rRect, void SvTreeListBox::EditText( const OUString& rStr, const Rectangle& rRect, const Selection& rSel, bool bMulti ) { - if( pEdCtrl ) - delete pEdCtrl; + delete pEdCtrl; nImpFlags |= SvTreeListBoxFlags::IN_EDT; nImpFlags &= ~SvTreeListBoxFlags::EDTEND_CALLED; HideFocus(); @@ -1040,8 +1039,6 @@ IMPL_LINK_NOARG(SvTreeListBox, TextEditEndedHdl_Impl) // that we don't call the selection handler in the GetFocus of the listbox // with the old entry text. pEdCtrl->Hide(); - // delete pEdCtrl; - // pEdCtrl = 0; nImpFlags &= (~SvTreeListBoxFlags::IN_EDT); GrabFocus(); return 0; diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx index f68514b54e47..af32fe4da4ad 100644 --- a/svtools/source/control/calendar.cxx +++ b/svtools/source/control/calendar.cxx @@ -1406,8 +1406,7 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt ) DoubleClick(); else { - if ( mpOldSelectTable ) - delete mpOldSelectTable; + delete mpOldSelectTable; maOldCurDate = maCurDate; mpOldSelectTable = new IntDateSet( *mpSelectTable ); @@ -1994,8 +1993,7 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const void Calendar::StartSelection() { - if ( mpOldSelectTable ) - delete mpOldSelectTable; + delete mpOldSelectTable; maOldCurDate = maCurDate; mpOldSelectTable = new IntDateSet( *mpSelectTable ); diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index 21aa7d7f10a2..fb1c9fa57219 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -778,11 +778,8 @@ sal_uLong GraphicDisplayCacheEntry::GetNeededSize( OutputDevice* pOut, const Poi GraphicDisplayCacheEntry::~GraphicDisplayCacheEntry() { - if( mpMtf ) - delete mpMtf; - - if( mpBmpEx ) - delete mpBmpEx; + delete mpMtf; + delete mpBmpEx; } void GraphicDisplayCacheEntry::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz ) const diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx index d0bb2cd9a12c..c3e09908153d 100644 --- a/svtools/source/misc/transfer2.cxx +++ b/svtools/source/misc/transfer2.cxx @@ -201,8 +201,7 @@ void SAL_CALL DropTargetHelper::DropTargetListener::dragOver( const DropTargetDr try { - if( mpLastDragOverEvent ) - delete mpLastDragOverEvent; + delete mpLastDragOverEvent; mpLastDragOverEvent = new AcceptDropEvent( rDTDE.DropAction & ~DNDConstants::ACTION_DEFAULT, Point( rDTDE.LocationX, rDTDE.LocationY ), rDTDE ); mpLastDragOverEvent->mbDefault = ( ( rDTDE.DropAction & DNDConstants::ACTION_DEFAULT ) != 0 ); diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index 79c3717b895c..529f7e27e91e 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -433,8 +433,7 @@ SvStream::~SvStream() if ( xLockBytes.Is() ) Flush(); - if( pRWBuf ) - delete[] pRWBuf; + delete[] pRWBuf; } void SvStream::ClearError() diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx index c8e5986daa6a..1a7ab56ab19e 100644 --- a/tools/source/stream/strmunx.cxx +++ b/tools/source/stream/strmunx.cxx @@ -302,8 +302,7 @@ SvFileStream::~SvFileStream() unlockFile( 0, 0, this ); - if (pInstanceData) - delete pInstanceData; + delete pInstanceData; } sal_Size SvFileStream::GetData( void* pData, sal_Size nSize ) diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx index dd49f6d2702f..6076205c12ac 100644 --- a/tools/source/stream/strmwnt.cxx +++ b/tools/source/stream/strmwnt.cxx @@ -129,8 +129,7 @@ SvFileStream::SvFileStream() SvFileStream::~SvFileStream() { Close(); - if (pInstanceData) - delete pInstanceData; + delete pInstanceData; } /// Does not check for EOF, makes isEof callable diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx index 5da8d6e7f0ba..6f14d0561414 100644 --- a/ucb/source/ucp/file/prov.cxx +++ b/ucb/source/ucp/file/prov.cxx @@ -93,8 +93,7 @@ FileProvider::FileProvider( const Reference< XComponentContext >& rxContext ) FileProvider::~FileProvider() { - if( m_pMyShell ) - delete m_pMyShell; + delete m_pMyShell; } // XInitialization diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index 8052d410e8a4..2439cd45c358 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -815,8 +815,7 @@ SvtLinguConfig::~SvtLinguConfig() if (--nCfgItemRefCount <= 0) { - if (pCfgItem) - delete pCfgItem; + delete pCfgItem; pCfgItem = 0; } } diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index da8321aa84af..a56347fed794 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -44,8 +44,7 @@ OTempFileService::OTempFileService(css::uno::Reference< css::uno::XComponentCont OTempFileService::~OTempFileService () { - if ( mpTempFile ) - delete mpTempFile; + delete mpTempFile; } // XInterface diff --git a/vcl/opengl/x11/salvd.cxx b/vcl/opengl/x11/salvd.cxx index 0b42c115ec2b..99abcddfdaab 100644 --- a/vcl/opengl/x11/salvd.cxx +++ b/vcl/opengl/x11/salvd.cxx @@ -61,8 +61,7 @@ X11OpenGLSalVirtualDevice::X11OpenGLSalVirtualDevice( SalGraphics* pGraphics, X11OpenGLSalVirtualDevice::~X11OpenGLSalVirtualDevice() { - if( mpGraphics ) - delete mpGraphics; + delete mpGraphics; } SalGraphics* X11OpenGLSalVirtualDevice::AcquireGraphics() diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx index a716ad719626..cd76e54303a6 100644 --- a/vcl/source/fontsubset/gsub.cxx +++ b/vcl/source/fontsubset/gsub.cxx @@ -319,8 +319,7 @@ bool ReadGSUB( struct _TrueTypeFont* pTTFile, void ReleaseGSUB(struct _TrueTypeFont* pTTFile) { GlyphSubstitution* pGlyphSubstitution = static_cast<GlyphSubstitution*>(pTTFile->pGSubstitution); - if( pGlyphSubstitution ) - delete pGlyphSubstitution; + delete pGlyphSubstitution; } int UseGSUB( struct _TrueTypeFont* pTTFile, int nGlyph ) diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 34637a251c1b..3d1231dbaf18 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -1646,8 +1646,7 @@ void ToolBox::dispose() mpFloatWin = NULL; // delete private data - if (mpData) - delete mpData; + delete mpData; mpData = NULL; // remove the lists when there are no more toolbox references to diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 4aa4269c6902..3e04d1b2ac44 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -77,8 +77,7 @@ ImplToolBoxPrivateData::ImplToolBoxPrivateData() : ImplToolBoxPrivateData::~ImplToolBoxPrivateData() { - if( m_pLayoutData ) - delete m_pLayoutData; + delete m_pLayoutData; delete mpMenu; } diff --git a/vcl/unx/generic/gdi/salvd.cxx b/vcl/unx/generic/gdi/salvd.cxx index b0caab71ae5d..f4bce82a0509 100644 --- a/vcl/unx/generic/gdi/salvd.cxx +++ b/vcl/unx/generic/gdi/salvd.cxx @@ -162,8 +162,7 @@ X11SalVirtualDevice::X11SalVirtualDevice(SalGraphics* pGraphics, long &nDX, long X11SalVirtualDevice::~X11SalVirtualDevice() { - if( pGraphics_ ) - delete pGraphics_; + delete pGraphics_; pGraphics_ = NULL; if( GetDrawable() && !bExternPixmap_ ) diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 463d9fe00ced..203ca4c83620 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -390,10 +390,8 @@ public: void NWPixmapCacheData::SetPixmap( GdkX11Pixmap* pPixmap, GdkX11Pixmap* pMask ) { - if( m_pixmap ) - delete m_pixmap; - if( m_mask ) - delete m_mask; + delete m_pixmap; + delete m_mask; m_pixmap = pPixmap; m_mask = pMask; diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx index e39e7682efaf..c67daeb7719c 100644 --- a/vcl/unx/gtk/window/gtksalframe.cxx +++ b/vcl/unx/gtk/window/gtksalframe.cxx @@ -881,8 +881,7 @@ GtkSalFrame::~GtkSalFrame() } #endif - if( m_pIMHandler ) - delete m_pIMHandler; + delete m_pIMHandler; if( m_pFixedContainer ) gtk_widget_destroy( GTK_WIDGET( m_pFixedContainer ) ); diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx index ed6b130bd50d..1fa06fd2a112 100644 --- a/vcl/unx/kde4/KDESalGraphics.cxx +++ b/vcl/unx/kde4/KDESalGraphics.cxx @@ -80,8 +80,7 @@ KDESalGraphics::KDESalGraphics() : KDESalGraphics::~KDESalGraphics() { - if (m_image) - delete m_image; + delete m_image; } bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart part ) @@ -249,9 +248,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, //if no image, or resized, make a new image if (!m_image || m_image->size() != widgetRect.size()) { - if (m_image) - delete m_image; - + delete m_image; m_image = new QImage( widgetRect.width(), widgetRect.height(), QImage::Format_ARGB32 ); diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx index 59895c9b2c3f..a5550fd4decb 100644 --- a/writerperfect/source/common/WPXSvInputStream.cxx +++ b/writerperfect/source/common/WPXSvInputStream.cxx @@ -817,8 +817,7 @@ WPXSvInputStream::WPXSvInputStream(Reference< XInputStream > xStream) : WPXSvInputStream::~WPXSvInputStream() { - if (mpImpl) - delete mpImpl; + delete mpImpl; } #define BUFFER_MAX 65536 diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index 3cd2dc09823d..46083c41febd 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -104,28 +104,18 @@ SchXMLImportHelper::SchXMLImportHelper() : SchXMLImportHelper::~SchXMLImportHelper() { - // delete token maps - if( mpChartDocElemTokenMap ) - delete mpChartDocElemTokenMap; - if( mpTableElemTokenMap ) - delete mpTableElemTokenMap; - if( mpChartElemTokenMap ) - delete mpChartElemTokenMap; - if( mpPlotAreaElemTokenMap ) - delete mpPlotAreaElemTokenMap; - if( mpSeriesElemTokenMap ) - delete mpSeriesElemTokenMap; - - if( mpChartAttrTokenMap ) - delete mpChartAttrTokenMap; - if( mpPlotAreaAttrTokenMap ) - delete mpPlotAreaAttrTokenMap; - if( mpAutoStyleAttrTokenMap ) - delete mpAutoStyleAttrTokenMap; - if( mpCellAttrTokenMap ) - delete mpCellAttrTokenMap; - if( mpSeriesAttrTokenMap ) - delete mpSeriesAttrTokenMap; + // delete token maps + delete mpChartDocElemTokenMap; + delete mpTableElemTokenMap; + delete mpChartElemTokenMap; + delete mpPlotAreaElemTokenMap; + delete mpSeriesElemTokenMap; + + delete mpChartAttrTokenMap; + delete mpPlotAreaAttrTokenMap; + delete mpAutoStyleAttrTokenMap; + delete mpCellAttrTokenMap; + delete mpSeriesAttrTokenMap; delete mpPropMappingAttrTokenMap; } diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx index f7df18e0938c..b38d117ca590 100644 --- a/xmloff/source/draw/sdxmlimp.cxx +++ b/xmloff/source/draw/sdxmlimp.cxx @@ -421,26 +421,16 @@ SdXMLImport::~SdXMLImport() throw () mpMasterStylesContext->ReleaseRef(); // delete all token maps - if(mpDocElemTokenMap) - delete mpDocElemTokenMap; - if(mpBodyElemTokenMap) - delete mpBodyElemTokenMap; - if(mpStylesElemTokenMap) - delete mpStylesElemTokenMap; - if(mpMasterPageElemTokenMap) - delete mpMasterPageElemTokenMap; - if(mpMasterPageAttrTokenMap) - delete mpMasterPageAttrTokenMap; - if(mpPageMasterAttrTokenMap) - delete mpPageMasterAttrTokenMap; - if(mpPageMasterStyleAttrTokenMap) - delete mpPageMasterStyleAttrTokenMap; - if(mpDrawPageAttrTokenMap) - delete mpDrawPageAttrTokenMap; - if(mpDrawPageElemTokenMap) - delete mpDrawPageElemTokenMap; - if(mpPresentationPlaceholderAttrTokenMap) - delete mpPresentationPlaceholderAttrTokenMap; + delete mpDocElemTokenMap; + delete mpBodyElemTokenMap; + delete mpStylesElemTokenMap; + delete mpMasterPageElemTokenMap; + delete mpMasterPageAttrTokenMap; + delete mpPageMasterAttrTokenMap; + delete mpPageMasterStyleAttrTokenMap; + delete mpDrawPageAttrTokenMap; + delete mpDrawPageElemTokenMap; + delete mpPresentationPlaceholderAttrTokenMap; } const SvXMLTokenMap& SdXMLImport::GetDocElemTokenMap() diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index c8dc20cade86..d86ee5094c3a 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -200,18 +200,18 @@ XMLShapeImportHelper::~XMLShapeImportHelper() mpPresPagePropsMapper = 0L; } - if(mpGroupShapeElemTokenMap) delete mpGroupShapeElemTokenMap; - if(mpFrameShapeElemTokenMap) delete mpFrameShapeElemTokenMap; - - if(mpPolygonShapeAttrTokenMap) delete mpPolygonShapeAttrTokenMap; - if(mpPathShapeAttrTokenMap) delete mpPathShapeAttrTokenMap; - if(mp3DSceneShapeElemTokenMap) delete mp3DSceneShapeElemTokenMap; - if(mp3DObjectAttrTokenMap) delete mp3DObjectAttrTokenMap; - if(mp3DPolygonBasedAttrTokenMap) delete mp3DPolygonBasedAttrTokenMap; - if(mp3DCubeObjectAttrTokenMap) delete mp3DCubeObjectAttrTokenMap; - if(mp3DSphereObjectAttrTokenMap) delete mp3DSphereObjectAttrTokenMap; - if(mp3DSceneShapeAttrTokenMap) delete mp3DSceneShapeAttrTokenMap; - if(mp3DLightAttrTokenMap) delete mp3DLightAttrTokenMap; + delete mpGroupShapeElemTokenMap; + delete mpFrameShapeElemTokenMap; + + delete mpPolygonShapeAttrTokenMap; + delete mpPathShapeAttrTokenMap; + delete mp3DSceneShapeElemTokenMap; + delete mp3DObjectAttrTokenMap; + delete mp3DPolygonBasedAttrTokenMap; + delete mp3DCubeObjectAttrTokenMap; + delete mp3DSphereObjectAttrTokenMap; + delete mp3DSceneShapeAttrTokenMap; + delete mp3DLightAttrTokenMap; // Styles or AutoStyles context? if(mpStylesContext) diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 316b37912a00..fac5f3bcdeba 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -2574,8 +2574,7 @@ SdXMLChartShapeContext::SdXMLChartShapeContext( SdXMLChartShapeContext::~SdXMLChartShapeContext() { - if( mpChartContext ) - delete mpChartContext; + delete mpChartContext; } void SdXMLChartShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList) diff --git a/xmloff/source/style/MarkerStyle.cxx b/xmloff/source/style/MarkerStyle.cxx index a2c138689009..864eedf889a8 100644 --- a/xmloff/source/style/MarkerStyle.cxx +++ b/xmloff/source/style/MarkerStyle.cxx @@ -136,8 +136,7 @@ bool XMLMarkerStyleImport::importXML( } } - if( pViewBox ) - delete pViewBox; + delete pViewBox; return bHasViewBox && bHasPathData; } |