summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-05-28 21:35:43 +0100
committerAndras Timar <andras.timar@collabora.com>2015-08-06 12:21:54 +0200
commit12278b37cea48e660d7068d67349701d1accbe97 (patch)
treef0da8cd9794888ae6b9da5f656f4b60b0ad823b5 /sd
parent7b45cd849f31637bf64f552cf58f9ef2d0a69831 (diff)
tdf#91702 - fix stack-based MessBox allocation.
Change-Id: I62dd164e281911d9db3de453789a5badc7cd5fd7 Reviewed-on: https://gerrit.libreoffice.org/15954 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/drawdoc3.cxx2
-rw-r--r--sd/source/ui/dlg/custsdlg.cxx4
-rw-r--r--sd/source/ui/func/fudraw.cxx2
-rw-r--r--sd/source/ui/view/drawview.cxx5
-rw-r--r--sd/source/ui/view/drviews2.cxx26
-rw-r--r--sd/source/ui/view/drviews4.cxx2
-rw-r--r--sd/source/ui/view/drviewse.cxx18
-rw-r--r--sd/source/ui/view/sdview4.cxx2
8 files changed, 30 insertions, 31 deletions
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 68535643f64e..3f966e8aaee9 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -461,7 +461,7 @@ bool SdDrawDocument::InsertBookmarkAsPage(
pBMPage->GetLwrBorder() != pRefPage->GetLwrBorder())
{
OUString aStr(SD_RESSTR(STR_SCALE_OBJECTS));
- sal_uInt16 nBut = QueryBox( NULL, WB_YES_NO_CANCEL, aStr).Execute();
+ sal_uInt16 nBut = ScopedVclPtr<QueryBox>::Create( nullptr, WB_YES_NO_CANCEL, aStr)->Execute();
bScaleObjects = nBut == RET_YES;
bContinue = nBut != RET_CANCEL;
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index dae2cd4f5a9e..27c3a8695408 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -515,8 +515,8 @@ IMPL_LINK_NOARG(SdDefineCustomShowDlg, OKHdl)
}
else
{
- WarningBox( this, WinBits( WB_OK ),
- SD_RESSTR( STR_WARN_NAME_DUPLICATE ) ).Execute();
+ ScopedVclPtr<WarningBox>::Create( 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 a00a513190ff..b50fe2c87836 100644
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -360,7 +360,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
{
if (mpView->IsPresObjSelected(false, true, false, true))
{
- InfoBox(mpWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) ).Execute();
+ ScopedVclPtr<InfoBox>::Create(mpWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute();
}
else
{
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index 179529c4645b..ae2f99c74e4f 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -434,9 +434,8 @@ bool DrawView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAtt
{
if (IsPresObjSelected(false, true))
{
-
- InfoBox(mpDrawViewShell->GetActiveWindow(),
- SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
+ ScopedVclPtr<InfoBox>::Create(mpDrawViewShell->GetActiveWindow(),
+ SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute();
bResult = false;
}
else
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index f281b69449a1..e9c5f008ab56 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -627,7 +627,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected() )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute();
}
else
{
@@ -672,7 +672,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected() )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute();
}
else
{
@@ -700,7 +700,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected(true,true,true) )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute();
}
else
{
@@ -1161,7 +1161,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected(false, true) )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute();
}
else
{
@@ -1347,7 +1347,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
#endif
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(nId)).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(nId))->Execute();
}
else
{
@@ -2061,7 +2061,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected( true, true, true ) )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute();
}
else
{
@@ -2180,7 +2180,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected() )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute();
}
else
{
@@ -2197,7 +2197,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected() )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute();
}
else
{
@@ -2217,7 +2217,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected() )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute();
}
else
{
@@ -2238,7 +2238,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected() )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute();
}
else
{
@@ -2259,7 +2259,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected() )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute();
}
else
{
@@ -2288,7 +2288,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected() )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE))->Execute();
}
else
{
@@ -2380,7 +2380,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected() )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
+ ScopedVclPtr<InfoBox>::Create(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 e87de5b09b68..548dbf4e314f 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -106,7 +106,7 @@ void DrawViewShell::DeleteActualLayer()
// replace placeholder
aString = aString.replaceFirst("$", rName);
- if (QueryBox(GetActiveWindow(), WB_YES_NO, aString).Execute() == RET_YES)
+ if (ScopedVclPtr<QueryBox>::Create(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 5b945c5a39b5..d7bc78f8b75a 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -331,11 +331,11 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected() )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) ).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute();
}
- else if ( QueryBox(GetActiveWindow(), WB_YES_NO,
+ else if ( ScopedVclPtr<QueryBox>::Create(GetActiveWindow(), WB_YES_NO,
SD_RESSTR(STR_ASK_FOR_CONVERT_TO_BEZIER)
- ).Execute() == RET_YES )
+ )->Execute() == RET_YES )
{
// implicit transformation into bezier
WaitObject aWait( (Window*)GetActiveWindow() );
@@ -368,11 +368,11 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected() )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) ).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute();
}
- else if ( QueryBox(GetActiveWindow(), WB_YES_NO,
+ else if ( ScopedVclPtr<QueryBox>::Create(GetActiveWindow(), WB_YES_NO,
SD_RESSTR(STR_ASK_FOR_CONVERT_TO_BEZIER)
- ).Execute() == RET_YES )
+ )->Execute() == RET_YES )
{
// implicit transformation into bezier
WaitObject aWait( (Window*)GetActiveWindow() );
@@ -676,7 +676,7 @@ void DrawViewShell::FuDeleteSelectedObjects()
if (mpDrawView->IsPresObjSelected(false, true, false, true))
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) ).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute();
bConsumed = true;
}
@@ -812,7 +812,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected(false, true, false, true) )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) ).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute();
}
else
{
@@ -834,7 +834,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected(false, true, false, true) )
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) ).Execute();
+ ScopedVclPtr<InfoBox>::Create(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 0395499284c1..1bfe74cec694 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -591,7 +591,7 @@ IMPL_LINK_NOARG_TYPED(View, DropInsertFileHdl, Idle *, void)
*/
IMPL_LINK_NOARG_TYPED(View, DropErrorHdl, Idle *, void)
{
- InfoBox( mpViewSh ? mpViewSh->GetActiveWindow() : 0, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) ).Execute();
+ ScopedVclPtr<InfoBox>::Create( mpViewSh ? mpViewSh->GetActiveWindow() : 0, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute();
}
/**