diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-07-26 10:21:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-07-26 11:26:52 +0100 |
commit | a860df25dd7bf62ecb6b3d3ed38803b981f56d52 (patch) | |
tree | 591e39d4fc9b3da4d3b84882e69baf88baa05507 /sd | |
parent | 87e2b0142a1724b9075f31acfc44011082ce8e12 (diff) |
masses of MessBoxes not being disposed promptly
since...
commit ba81e5c6bd420b41a84ade6ccd774011a8089f7f
Date: Thu May 28 21:35:43 2015 +0100
tdf#91702 - fix stack-based MessBox allocation.
There is no special ScopedVclPtr<X>::Create or
ScopedVclPtrInstance<X>::Create just
VclPtr<X>::Create and a raw VclPtr<X>::Create()->foo
doesn't call dispose on the owned X
Change-Id: Ifacc8d5e742820701307c3c37b9b86487667d84f
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/drawdoc3.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/app/sdmod1.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/custsdlg.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fudraw.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/futhes.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drawview.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 26 | ||||
-rw-r--r-- | sd/source/ui/view/drviews4.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drviewse.cxx | 14 | ||||
-rw-r--r-- | sd/source/ui/view/sdview4.cxx | 2 |
10 files changed, 29 insertions, 29 deletions
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index b371fe7a71a0..b736595418a3 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -466,7 +466,7 @@ bool SdDrawDocument::InsertBookmarkAsPage( pBMPage->GetLwrBorder() != pRefPage->GetLwrBorder()) { OUString aStr(SD_RESSTR(STR_SCALE_OBJECTS)); - sal_uInt16 nBut = ScopedVclPtr<QueryBox>::Create( nullptr, WB_YES_NO_CANCEL, aStr)->Execute(); + sal_uInt16 nBut = ScopedVclPtrInstance<QueryBox>(nullptr, WB_YES_NO_CANCEL, aStr)->Execute(); bScaleObjects = nBut == RET_YES; bContinue = nBut != RET_CANCEL; diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 7ecdbe5c14fc..b3349c396094 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -234,7 +234,7 @@ void SdModule::Execute(SfxRequest& rReq) } else { - ScopedVclPtrInstance<MessageDialog>::Create(nullptr, SD_RESSTR(STR_CANT_PERFORM_IN_LIVEMODE))->Execute(); + ScopedVclPtrInstance<MessageDialog>(nullptr, SD_RESSTR(STR_CANT_PERFORM_IN_LIVEMODE))->Execute(); const SfxLinkItem* pLinkItem = rReq.GetArg<SfxLinkItem>(SID_DONELINK); if( pLinkItem ) diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index f3671b5628e5..ea6efb81f1bc 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -531,7 +531,7 @@ IMPL_LINK_NOARG_TYPED(SdDefineCustomShowDlg, OKHdl, Button*, void) } else { - ScopedVclPtr<WarningBox>::Create( this, WinBits( WB_OK ), + ScopedVclPtrInstance<WarningBox>( this, WinBits( WB_OK ), SD_RESSTR( STR_WARN_NAME_DUPLICATE ) )->Execute(); m_pEdtName->GrabFocus(); diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 926161743aa6..8d773a940e48 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -340,7 +340,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) { if (mpView->IsPresObjSelected(false, true, false, true)) { - ScopedVclPtr<InfoBox>::Create(mpWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute(); + ScopedVclPtrInstance<InfoBox>(mpWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); } else { diff --git a/sd/source/ui/func/futhes.cxx b/sd/source/ui/func/futhes.cxx index f9680f0ad320..ddc34a850764 100644 --- a/sd/source/ui/func/futhes.cxx +++ b/sd/source/ui/func/futhes.cxx @@ -112,7 +112,7 @@ void FuThesaurus::DoExecute( SfxRequest& ) if (eState == EE_SPELL_NOLANGUAGE) { - ScopedVclPtrInstance<MessageDialog>::Create(mpWindow, SD_RESSTR(STR_NOLANGUAGE))->Execute(); + ScopedVclPtrInstance<MessageDialog>(mpWindow, SD_RESSTR(STR_NOLANGUAGE))->Execute(); } } } @@ -139,7 +139,7 @@ void FuThesaurus::DoExecute( SfxRequest& ) if (eState == EE_SPELL_NOLANGUAGE) { - ScopedVclPtrInstance<MessageDialog>::Create(mpWindow, SD_RESSTR(STR_NOLANGUAGE))->Execute(); + ScopedVclPtrInstance<MessageDialog>(mpWindow, SD_RESSTR(STR_NOLANGUAGE))->Execute(); } } } diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx index 4343113ddcc8..df01fde9d11d 100644 --- a/sd/source/ui/view/drawview.cxx +++ b/sd/source/ui/view/drawview.cxx @@ -433,7 +433,7 @@ bool DrawView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAtt { if (IsPresObjSelected(false)) { - ScopedVclPtr<InfoBox>::Create(mpDrawViewShell->GetActiveWindow(), + ScopedVclPtrInstance<InfoBox>(mpDrawViewShell->GetActiveWindow(), SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); bResult = false; } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 829ee91607be..214cc7351fb1 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -604,7 +604,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected() ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); } else { @@ -649,7 +649,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected() ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); } else { @@ -677,7 +677,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected(true,true,true) ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); } else { @@ -1160,7 +1160,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected(false) ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); } else { @@ -1344,7 +1344,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) #endif ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(nId))->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(nId))->Execute(); } else { @@ -2051,7 +2051,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected( true, true, true ) ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); } else { @@ -2170,7 +2170,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected() ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); } else { @@ -2187,7 +2187,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected() ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); } else { @@ -2207,7 +2207,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected() ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); } else { @@ -2228,7 +2228,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected() ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); } else { @@ -2249,7 +2249,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected() ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); } else { @@ -2291,7 +2291,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected() ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); } else { @@ -2383,7 +2383,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected() ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); } else { diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index fc2360803384..c390ffaf244e 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -107,7 +107,7 @@ void DrawViewShell::DeleteActualLayer() // replace placeholder aString = aString.replaceFirst("$", rName); - if (ScopedVclPtr<QueryBox>::Create(GetActiveWindow(), WB_YES_NO, aString)->Execute() == RET_YES) + if (ScopedVclPtrInstance<QueryBox>(GetActiveWindow(), WB_YES_NO, aString)->Execute() == RET_YES) { const SdrLayer* pLayer = rAdmin.GetLayer(rName, false); mpDrawView->DeleteLayer( pLayer->GetName() ); diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 4bfe80539068..d156e48f4a9d 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -327,9 +327,9 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected() ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute(); } - else if ( ScopedVclPtr<QueryBox>::Create(GetActiveWindow(), WB_YES_NO, + else if ( ScopedVclPtrInstance<QueryBox>(GetActiveWindow(), WB_YES_NO, SD_RESSTR(STR_ASK_FOR_CONVERT_TO_BEZIER) )->Execute() == RET_YES ) { @@ -364,9 +364,9 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected() ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute(); } - else if ( ScopedVclPtr<QueryBox>::Create(GetActiveWindow(), WB_YES_NO, + else if ( ScopedVclPtrInstance<QueryBox>(GetActiveWindow(), WB_YES_NO, SD_RESSTR(STR_ASK_FOR_CONVERT_TO_BEZIER) )->Execute() == RET_YES ) { @@ -672,7 +672,7 @@ void DrawViewShell::FuDeleteSelectedObjects() if (mpDrawView->IsPresObjSelected(false, true, false, true)) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute(); bConsumed = true; } @@ -782,7 +782,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected(false, true, false, true) ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); } else { @@ -804,7 +804,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) if ( mpDrawView->IsPresObjSelected(false, true, false, true) ) { ::sd::Window* pWindow = GetActiveWindow(); - ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute(); + ScopedVclPtrInstance<InfoBox>(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute(); } else { diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index b76b8717892a..d9147c711cd8 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -584,7 +584,7 @@ IMPL_LINK_NOARG_TYPED(View, DropInsertFileHdl, Idle *, void) */ IMPL_LINK_NOARG_TYPED(View, DropErrorHdl, Idle *, void) { - ScopedVclPtr<InfoBox>::Create( mpViewSh ? mpViewSh->GetActiveWindow() : nullptr, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute(); + ScopedVclPtrInstance<InfoBox>( mpViewSh ? mpViewSh->GetActiveWindow() : nullptr, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute(); } /** |