summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-05-28 21:35:43 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-05-29 12:16:28 +0000
commitba81e5c6bd420b41a84ade6ccd774011a8089f7f (patch)
tree554d0904466549cf2ba630e361e457fdcec22c98 /sw
parent5fe011ae025d7d354ca0647189524843a444ffba (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 'sw')
-rw-r--r--sw/source/ui/misc/bookmark.cxx2
-rw-r--r--sw/source/uibase/app/docsh.cxx6
-rw-r--r--sw/source/uibase/app/docsh2.cxx2
-rw-r--r--sw/source/uibase/dochdl/gloshdl.cxx2
-rw-r--r--sw/source/uibase/lingu/hyp.cxx2
-rw-r--r--sw/source/uibase/uiview/viewling.cxx4
-rw-r--r--sw/source/uibase/uiview/viewprt.cxx2
-rw-r--r--sw/source/uibase/uiview/viewsrch.cxx2
-rw-r--r--sw/source/uibase/utlui/unotools.cxx2
9 files changed, 12 insertions, 12 deletions
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index f3c55975a86a..fb980579f171 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -53,7 +53,7 @@ IMPL_LINK( SwInsertBookmarkDlg, ModifyHdl, BookmarkCombo *, pBox )
if(sTmp.getLength() != nLen)
{
pBox->SetText(sTmp);
- InfoBox(this, sRemoveWarning+sMsg).Execute();
+ ScopedVclPtr<InfoBox>::Create(this, sRemoveWarning+sMsg)->Execute();
}
}
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index a614c854a7af..ff621d35cc78 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -173,7 +173,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,
{
if(!bAPICall)
{
- InfoBox( 0, SW_RESSTR(STR_CANTOPEN)).Execute();
+ ScopedVclPtr<InfoBox>::Create( nullptr, SW_RESSTR(STR_CANTOPEN))->Execute();
}
return 0;
}
@@ -519,8 +519,8 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium )
SwReaderWriter::GetWriter( pFlt->GetUserData(), rMedium.GetBaseURL( true ), xWriter );
if( !xWriter.Is() )
{ // Filter not available
- InfoBox( 0,
- SW_RESSTR(STR_DLLNOTFOUND) ).Execute();
+ ScopedVclPtr<InfoBox>::Create( nullptr,
+ SW_RESSTR(STR_DLLNOTFOUND) )->Execute();
return false;
}
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 60b8c0e3c769..d75d1604e91a 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -1098,7 +1098,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
if( !bDone && !rReq.IsAPI() )
{
- InfoBox( 0, SW_RESSTR( STR_CANTCREATE )).Execute();
+ ScopedVclPtr<InfoBox>::Create( nullptr, SW_RESSTR( STR_CANTCREATE ))->Execute();
}
}
}
diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx
index 844f6b6ab6af..7f0067250974 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -486,7 +486,7 @@ bool SwGlossaryHdl::Expand( const OUString& rShortName,
}
OUString aTmp( SW_RES(STR_NOGLOS));
aTmp = aTmp.replaceFirst("%1", aShortName);
- InfoBox( pWrtShell->GetView().GetWindow(), aTmp ).Execute();
+ ScopedVclPtr<InfoBox>::Create( pWrtShell->GetView().GetWindow(), aTmp )->Execute();
}
return false;
diff --git a/sw/source/uibase/lingu/hyp.cxx b/sw/source/uibase/lingu/hyp.cxx
index cdf801558f4a..057bd69d14f2 100644
--- a/sw/source/uibase/lingu/hyp.cxx
+++ b/sw/source/uibase/lingu/hyp.cxx
@@ -123,7 +123,7 @@ SwHyphWrapper::~SwHyphWrapper()
if( nPageCount )
::EndProgress( pView->GetDocShell() );
if( bInfoBox )
- InfoBox( &pView->GetEditWin(), SW_RESSTR(STR_HYP_OK) ).Execute();
+ ScopedVclPtr<InfoBox>::Create( &pView->GetEditWin(), SW_RESSTR(STR_HYP_OK) )->Execute();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index a6aae3ec7510..f074cbf7e896 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -419,8 +419,8 @@ void SwView::HyphenateDocument()
// do not hyphenate if interactive hyphenation is active elsewhere
if (SwEditShell::HasHyphIter())
{
- MessBox( 0, WB_OK, OUString( SW_RES( STR_HYPH_TITLE ) ),
- OUString( SW_RES( STR_MULT_INTERACT_HYPH_WARN ) ) ).Execute();
+ ScopedVclPtr<MessBox>::Create( nullptr, WB_OK, OUString( SW_RES( STR_HYPH_TITLE ) ),
+ OUString( SW_RES( STR_MULT_INTERACT_HYPH_WARN ) ) )->Execute();
return;
}
diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx
index 012e0dd26042..281567a2fa5d 100644
--- a/sw/source/uibase/uiview/viewprt.cxx
+++ b/sw/source/uibase/uiview/viewprt.cxx
@@ -217,7 +217,7 @@ void SwView::ExecutePrint(SfxRequest& rReq)
{
if( ( pSh->IsSelection() || pSh->IsFrmSelected() || pSh->IsObjSelected() ) )
{
- short nBtn = SvxPrtQryBox(&GetEditWin()).Execute();
+ short nBtn = ScopedVclPtr<SvxPrtQryBox>::Create(&GetEditWin())->Execute();
if( RET_CANCEL == nBtn )
return;
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index dbd792b61be8..a4951ef44e71 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -355,7 +355,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
OUString aText( SW_RES( STR_NB_REPLACED ) );
aText = aText.replaceFirst("XX", OUString::number( nFound ));
vcl::Window* pParentWindow = GetParentWindow( m_pSrchDlg );
- InfoBox( pParentWindow, aText ).Execute();
+ ScopedVclPtr<InfoBox>::Create( pParentWindow, aText )->Execute();
}
}
#if HAVE_FEATURE_DESKTOP
diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx
index 6d870cfabed9..785eba8bdff4 100644
--- a/sw/source/uibase/utlui/unotools.cxx
+++ b/sw/source/uibase/utlui/unotools.cxx
@@ -96,7 +96,7 @@ void SwOneExampleFrame::CreateErrorMessage(vcl::Window* pParent)
{
OUString sInfo(SW_RES(STR_SERVICE_UNAVAILABLE));
sInfo += OUString(cFrameControl);
- InfoBox(pParent, sInfo).Execute();
+ ScopedVclPtr<InfoBox>::Create(pParent, sInfo)->Execute();
SwOneExampleFrame::bShowServiceNotAvailableMessage = false;
}
}