cui/source/dialogs/hltpbase.cxx | 142 ++++-------------------------- cui/source/tabpages/chardlg.cxx | 3 forms/source/xforms/xpathlib/xpathlib.cxx | 4 sfx2/inc/sfx2/bindings.hxx | 3 starmath/source/parse.cxx | 4 svx/source/dialog/rubydialog.cxx | 1 ucb/source/ucp/tdoc/tdoc_datasupplier.cxx | 22 ---- 7 files changed, 34 insertions(+), 145 deletions(-)
New commits: commit aa8091bc25b67189dd7a43ff85ef3ae11df0971b Author: Markus Mohrhard <[email protected]> Date: Thu Feb 28 10:06:05 2013 +0100 remove useless comment lines Change-Id: I884a97d36ff2ed2f4526cf96af9cac214af4db31 diff --git a/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx b/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx index 6c33708..f356e99 100644 --- a/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx +++ b/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx @@ -107,14 +107,7 @@ DataSupplier_Impl::~DataSupplier_Impl() } -//========================================================================= -//========================================================================= -// // DataSupplier Implementation. -// -//========================================================================= -//========================================================================= - ResultSetDataSupplier::ResultSetDataSupplier( const uno::Reference< uno::XComponentContext >& rxContext, const rtl::Reference< Content >& rContent, @@ -123,14 +116,12 @@ ResultSetDataSupplier::ResultSetDataSupplier( { } -//========================================================================= // virtual ResultSetDataSupplier::~ResultSetDataSupplier() { delete m_pImpl; } -//========================================================================= // virtual rtl::OUString ResultSetDataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) @@ -155,7 +146,6 @@ ResultSetDataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) return rtl::OUString(); } -//========================================================================= // virtual uno::Reference< ucb::XContentIdentifier > ResultSetDataSupplier::queryContentIdentifier( sal_uInt32 nIndex ) @@ -184,7 +174,6 @@ ResultSetDataSupplier::queryContentIdentifier( sal_uInt32 nIndex ) return uno::Reference< ucb::XContentIdentifier >(); } -//========================================================================= // virtual uno::Reference< ucb::XContent > ResultSetDataSupplier::queryContent( sal_uInt32 nIndex ) @@ -221,7 +210,6 @@ ResultSetDataSupplier::queryContent( sal_uInt32 nIndex ) return uno::Reference< ucb::XContent >(); } -//========================================================================= // virtual sal_Bool ResultSetDataSupplier::getResult( sal_uInt32 nIndex ) { @@ -292,7 +280,6 @@ sal_Bool ResultSetDataSupplier::getResult( sal_uInt32 nIndex ) return bFound; } -//========================================================================= // virtual sal_uInt32 ResultSetDataSupplier::totalCount() { @@ -343,21 +330,18 @@ sal_uInt32 ResultSetDataSupplier::totalCount() return m_pImpl->m_aResults.size(); } -//========================================================================= // virtual sal_uInt32 ResultSetDataSupplier::currentCount() { return m_pImpl->m_aResults.size(); } -//========================================================================= // virtual sal_Bool ResultSetDataSupplier::isCountFinal() { return m_pImpl->m_bCountFinal; } -//========================================================================= // virtual uno::Reference< sdbc::XRow > ResultSetDataSupplier::queryPropertyValues( sal_uInt32 nIndex ) @@ -388,7 +372,6 @@ ResultSetDataSupplier::queryPropertyValues( sal_uInt32 nIndex ) return uno::Reference< sdbc::XRow >(); } -//========================================================================= // virtual void ResultSetDataSupplier::releasePropertyValues( sal_uInt32 nIndex ) { @@ -398,13 +381,11 @@ void ResultSetDataSupplier::releasePropertyValues( sal_uInt32 nIndex ) m_pImpl->m_aResults[ nIndex ]->xRow = uno::Reference< sdbc::XRow >(); } -//========================================================================= // virtual void ResultSetDataSupplier::close() { } -//========================================================================= // virtual void ResultSetDataSupplier::validate() throw( ucb::ResultSetException ) @@ -413,7 +394,6 @@ void ResultSetDataSupplier::validate() throw ucb::ResultSetException(); } -//========================================================================= bool ResultSetDataSupplier::queryNamesOfChildren() { osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); @@ -440,7 +420,6 @@ bool ResultSetDataSupplier::queryNamesOfChildren() return true; } -//========================================================================= ::rtl::OUString ResultSetDataSupplier::assembleChildURL( const ::rtl::OUString& aName ) { commit f6a3bcdc109d6e6a37221c7f40d5b8423efc95ca Author: Markus Mohrhard <[email protected]> Date: Thu Feb 28 10:04:55 2013 +0100 coverity#705769: fix memory leak Change-Id: I77454dd6c33c8309991108343a2895792095f95d diff --git a/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx b/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx index 65daafd..6c33708 100644 --- a/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx +++ b/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx @@ -428,6 +428,7 @@ bool ResultSetDataSupplier::queryNamesOfChildren() *pNamesOfChildren ) ) { OSL_FAIL( "Got no list of children!" ); + delete pNamesOfChildren; m_pImpl->m_bThrowException = sal_True; return false; } commit baaf3ed1296038a4eda09bf41b1d8b210a41edf2 Author: Markus Mohrhard <[email protected]> Date: Thu Feb 28 08:50:04 2013 +0100 coverity#705729: fix memory leak Change-Id: I978d0a34b3f94e66f9ebc5ff0ed8d3068ed4fc12 diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index da49fde..aa62fd7 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -293,6 +293,7 @@ void SvxRubyDialog::Activate() SfxPoolItem* pState = 0; SfxItemState eState = pBindings->QueryState( SID_STYLE_DESIGNER, pState ); sal_Bool bEnable = (eState < SFX_ITEM_AVAILABLE) || !pState || !((SfxBoolItem*)pState)->GetValue(); + delete pState; m_pStylistPB->Enable(bEnable); //get selection from current view frame SfxViewFrame* pCurFrm = SfxViewFrame::Current(); commit 33cf5700cfd0f1645d015f9f32abc4337e9bd330 Author: Markus Mohrhard <[email protected]> Date: Thu Feb 28 08:34:34 2013 +0100 coverity#705726: fix memory leak Change-Id: I8ccbd73a937e7506a64ae1925ca20d420117fb73 diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index dbd4505..95bda3b 100644 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -1052,7 +1052,9 @@ void SmParser::Align() // allow for just one align statement in 5.0 if (CONVERT_40_TO_50 != GetConversion() && TokenInGroup(TGALIGN)) - { Error(PE_DOUBLE_ALIGN); + { + Error(PE_DOUBLE_ALIGN); + delete pSNode; return; } } commit 821ef2bb05cb6bddda65d2214ff4d80e7d872664 Author: Markus Mohrhard <[email protected]> Date: Thu Feb 28 08:20:01 2013 +0100 coverity#705651: fix memory leak Change-Id: I1f0c8ac963f16fb4bd0d101c6a62996d9aebab78 diff --git a/forms/source/xforms/xpathlib/xpathlib.cxx b/forms/source/xforms/xpathlib/xpathlib.cxx index 7ba0dcb..8a915c4 100644 --- a/forms/source/xforms/xpathlib/xpathlib.cxx +++ b/forms/source/xforms/xpathlib/xpathlib.cxx @@ -392,7 +392,11 @@ static sal_Bool parseDuration(const xmlChar* aString, sal_Bool& bNegative, sal_I } if (pString[0] != 'P') + { + rtl_freeMemory(pString0); return sal_False; + } + pString++; char* pToken = pString; while(pToken[0] != 0) commit b65335564647705092d58dc0e9de92fb01c6262a Author: Markus Mohrhard <[email protected]> Date: Thu Feb 28 08:15:52 2013 +0100 coverity#705637: fix memory leak and add documentation Change-Id: If06ef8c78a7d3910be3f3d46dca090a4568b5fe7 diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 7048be1..b7f0e7f 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -1359,7 +1359,7 @@ void SvxCharEffectsPage::Initialize() m_pFontColorLB->SetUpdateMode( sal_False ); { - SfxPoolItem* pDummy; + SfxPoolItem* pDummy = NULL; SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocSh ); if ( !pFrame || SFX_ITEM_DEFAULT > pFrame->GetBindings().QueryState( SID_ATTR_AUTO_COLOR_INVALID, pDummy ) ) @@ -1368,6 +1368,7 @@ void SvxCharEffectsPage::Initialize() m_pOverlineColorLB->InsertAutomaticEntryColor( Color( COL_AUTO ) ); m_pFontColorLB->InsertAutomaticEntryColor( Color( COL_AUTO ) ); } + delete pDummy; } for ( long i = 0; i < pColorTable->Count(); i++ ) { diff --git a/sfx2/inc/sfx2/bindings.hxx b/sfx2/inc/sfx2/bindings.hxx index a134975..73fce08 100644 --- a/sfx2/inc/sfx2/bindings.hxx +++ b/sfx2/inc/sfx2/bindings.hxx @@ -151,6 +151,9 @@ public: const SfxSlot* GetSlot( sal_uInt16 nMsgId ); SfxStateCache* GetStateCache( sal_uInt16 nId, sal_uInt16 *pPos = 0 ); SAL_DLLPRIVATE SfxStateCache* GetAnyStateCache_Impl( sal_uInt16 nId ); + /** + * @param rpState the caller has to delete the pointer + */ SfxItemState QueryState( sal_uInt16 nSID, SfxPoolItem* &rpState ); const SfxPoolItem* ExecuteSynchron( sal_uInt16 nSlot, commit f4bb6d7cb5751c22bcba99ffe926d7b645902ae2 Author: Markus Mohrhard <[email protected]> Date: Thu Feb 28 08:09:34 2013 +0100 remove unnecessary ascii arts Change-Id: I4b76249ad29ed0ef4a35e2e2bffbf98508bad327 diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index 89e37b5..1b83736 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -34,11 +34,7 @@ using namespace ::ucbhelper; -//######################################################################## -//# # //# ComboBox-Control, which is filled with all current framenames # -//# # -//######################################################################## /************************************************************************* |* @@ -76,17 +72,8 @@ SvxFramesComboBox::SvxFramesComboBox ( Window* pParent, const ResId& rResId, SvxFramesComboBox::~SvxFramesComboBox () { } -//######################################################################## -//# # -//# ComboBox-Control for URL's with History and Autocompletion # -//# # -//######################################################################## -/************************************************************************* -|* -|* Contructor / Destructor -|* -|************************************************************************/ +//# ComboBox-Control for URL's with History and Autocompletion # SvxHyperURLBox::SvxHyperURLBox( Window* pParent, INetProtocol eSmart ) : SvtURLBox ( pParent, eSmart ), @@ -131,17 +118,7 @@ long SvxHyperURLBox::PreNotify( NotifyEvent& rNEvt ) return SvtURLBox::PreNotify( rNEvt ); } -//######################################################################## -//# # //# Hyperlink-Dialog: Tabpages-Baseclass # -//# # -//######################################################################## - -/************************************************************************* -|* -|* Con/Destructor, Initialize -|* -\************************************************************************/ SvxHyperlinkTabPageBase::SvxHyperlinkTabPageBase ( Window *pParent, const ResId &rResId, @@ -227,12 +204,7 @@ void SvxHyperlinkTabPageBase::InitStdControls () mbStdControlsInit = sal_True; } -/************************************************************************* -|* -|* Move Extra-Window -|* -\************************************************************************/ - +// Move Extra-Window sal_Bool SvxHyperlinkTabPageBase::MoveToExtraWnd( Point aNewPos, sal_Bool bDisConnectDlg ) { sal_Bool bReturn = mpMarkWnd->MoveTo ( aNewPos ); @@ -243,12 +215,7 @@ sal_Bool SvxHyperlinkTabPageBase::MoveToExtraWnd( Point aNewPos, sal_Bool bDisCo return ( !bReturn && IsMarkWndVisible() ); } -/************************************************************************* -|* -|* Show Extra-Window -|* -\************************************************************************/ - +// Show Extra-Window void SvxHyperlinkTabPageBase::ShowMarkWnd () { ( ( Window* ) mpMarkWnd )->Show(); @@ -289,12 +256,7 @@ void SvxHyperlinkTabPageBase::ShowMarkWnd () mpMarkWnd->SetSizePixel( Size( aExtraWndSize.Width(), aDlgSize.Height() ) ); } -/************************************************************************* -|* -|* Fill Dialogfields -|* -\************************************************************************/ - +// Fill Dialogfields void SvxHyperlinkTabPageBase::FillStandardDlgFields ( SvxHyperlinkItem* pHyperlinkItem ) { // Frame @@ -333,91 +295,51 @@ void SvxHyperlinkTabPageBase::FillStandardDlgFields ( SvxHyperlinkItem* pHyperli mpBtScript->Enable(); } -/************************************************************************* -|* -|* Any action to do after apply-button is pressed -|* -\************************************************************************/ - +// Any action to do after apply-button is pressed void SvxHyperlinkTabPageBase::DoApply () { // default-implemtation : do nothing } -/************************************************************************* -|* -|* Ask page whether an insert is possible -|* -\************************************************************************/ - +// Ask page whether an insert is possible sal_Bool SvxHyperlinkTabPageBase::AskApply () { // default-implementation return sal_True; } -/************************************************************************* -|* -|* This method would be called from bookmark-window to set new mark-string -|* -\************************************************************************/ - +// This method would be called from bookmark-window to set new mark-string void SvxHyperlinkTabPageBase::SetMarkStr ( String& /*aStrMark*/ ) { // default-implemtation : do nothing } -/************************************************************************* -|* -|* This method will be called from the dialog-class if the state off -|* the online-mode has changed. -|* -\************************************************************************/ - +// This method will be called from the dialog-class if the state off +// the online-mode has changed. void SvxHyperlinkTabPageBase::SetOnlineMode( sal_Bool /*bEnable*/ ) { // default-implemtation : do nothing } -/************************************************************************* -|* -|* Set initial focus -|* -|************************************************************************/ - +// Set initial focus void SvxHyperlinkTabPageBase::SetInitFocus() { GrabFocus(); } -/************************************************************************* -|* -|* Ask dialog whether the curretn doc is a HTML-doc -|* -|************************************************************************/ - +// Ask dialog whether the curretn doc is a HTML-doc sal_Bool SvxHyperlinkTabPageBase::IsHTMLDoc() const { return ((SvxHpLinkDlg*)mpDialog)->IsHTMLDoc(); } -/************************************************************************* -|* -|* retrieve dispatcher -|* -|************************************************************************/ - +// retrieve dispatcher SfxDispatcher* SvxHyperlinkTabPageBase::GetDispatcher() const { return ((SvxHpLinkDlg*)mpDialog)->GetDispatcher(); } -/************************************************************************* -|* -|* Click on imagebutton : Script -|* -|************************************************************************/ - +// Click on imagebutton : Script IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl) { SvxHyperlinkItem *pHyperlinkItem = (SvxHyperlinkItem *) @@ -480,12 +402,7 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl) return( 0L ); } -/************************************************************************* -|* -|* Get Macro-Infos -|* -|************************************************************************/ - +// Get Macro-Infos sal_uInt16 SvxHyperlinkTabPageBase::GetMacroEvents() { SvxHyperlinkItem *pHyperlinkItem = (SvxHyperlinkItem *) @@ -502,12 +419,7 @@ SvxMacroTableDtor* SvxHyperlinkTabPageBase::GetMacroTable() return ( (SvxMacroTableDtor*)pHyperlinkItem->GetMacroTbl() ); } -/************************************************************************* -|* -|* try to detect the current protocol that is used in aStrURL -|* -|************************************************************************/ - +// try to detect the current protocol that is used in aStrURL String SvxHyperlinkTabPageBase::GetSchemeFromURL( String aStrURL ) { String aStrScheme; @@ -559,12 +471,7 @@ void SvxHyperlinkTabPageBase::GetDataFromCommonFields( String& aStrName, eMode = (SvxLinkInsertMode) ( sal_uInt16(eMode) | HLINK_HTMLMODE ); } -/************************************************************************* -|* -|* reset dialog-fields -|* -|************************************************************************/ - +// reset dialog-fields void SvxHyperlinkTabPageBase::Reset( const SfxItemSet& rItemSet) { /////////////////////////////////////// @@ -587,12 +494,7 @@ void SvxHyperlinkTabPageBase::Reset( const SfxItemSet& rItemSet) } } -/************************************************************************* -|* -|* Fill output-ItemSet -|* -|************************************************************************/ - +// Fill output-ItemSet sal_Bool SvxHyperlinkTabPageBase::FillItemSet( SfxItemSet& rOut) { String aStrURL, aStrName, aStrIntName, aStrFrame; @@ -640,12 +542,7 @@ String SvxHyperlinkTabPageBase::CreateUiNameFromURL( const String& aStrURL ) return aStrUiURL; } -/************************************************************************* -|* -|* Activate / Deactivate Tabpage -|* -|************************************************************************/ - +// Activate / Deactivate Tabpage void SvxHyperlinkTabPageBase::ActivatePage( const SfxItemSet& rItemSet ) { /////////////////////////////////////// commit 32fcb0c4f56deb8813340d88d0638e1960851a06 Author: Markus Mohrhard <[email protected]> Date: Thu Feb 28 07:57:57 2013 +0100 coverity#705636: fix memory leak Change-Id: Iabb4922aedd6f2897e005797e6d2ae1fea11ac4a diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index 1d040b4..89e37b5 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -30,6 +30,7 @@ #include "macroass.hxx" #include <svx/svxdlg.hxx> #include <cuires.hrc> +#include <boost/scoped_ptr.hpp> using namespace ::ucbhelper; @@ -49,11 +50,11 @@ SvxFramesComboBox::SvxFramesComboBox ( Window* pParent, const ResId& rResId, SfxDispatcher* pDispatch ) : ComboBox (pParent, rResId) { - TargetList* pList = new TargetList; SfxViewFrame* pViewFrame = pDispatch ? pDispatch->GetFrame() : 0; SfxFrame* pFrame = pViewFrame ? &pViewFrame->GetTopFrame() : 0; if ( pFrame ) { + boost::scoped_ptr<TargetList> pList(new TargetList); pFrame->GetTargetList(*pList); if( !pList->empty() ) { _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
