summaryrefslogtreecommitdiff
path: root/cui
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 /cui
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 'cui')
-rw-r--r--cui/source/customize/cfg.cxx9
-rw-r--r--cui/source/dialogs/multipat.cxx4
-rw-r--r--cui/source/options/treeopt.cxx2
-rw-r--r--cui/source/tabpages/page.cxx2
4 files changed, 8 insertions, 9 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 7eadd5a16952..bbf8d43b2a9f 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -5081,7 +5081,7 @@ IMPL_LINK( SvxIconSelectorDialog, DeleteHdl, PushButton *, pButton )
(void)pButton;
OUString message = CUI_RES( RID_SVXSTR_DELETE_ICON_CONFIRM );
- if ( WarningBox( this, WinBits(WB_OK_CANCEL), message ).Execute() == RET_OK )
+ if ( ScopedVclPtr<WarningBox>::Create( this, WinBits(WB_OK_CANCEL), message )->Execute() == RET_OK )
{
sal_uInt16 nCount = pTbSymbol->GetItemCount();
@@ -5206,7 +5206,7 @@ void SvxIconSelectorDialog::ImportGraphics(
{
aIndex = rPaths[0].lastIndexOf( '/' );
aIconName = rPaths[0].copy( aIndex+1 );
- ret = SvxIconReplacementDialog( this, aIconName ).ShowDialog();
+ ret = ScopedVclPtr<SvxIconReplacementDialog>::Create( this, aIconName )->ShowDialog();
if ( ret == 2 )
{
ReplaceGraphicItem( rPaths[0] );
@@ -5234,7 +5234,7 @@ void SvxIconSelectorDialog::ImportGraphics(
{
aIndex = rPaths[i].lastIndexOf( '/' );
aIconName = rPaths[i].copy( aIndex+1 );
- ret = SvxIconReplacementDialog( this, aIconName, true ).ShowDialog();
+ ret = ScopedVclPtr<SvxIconReplacementDialog>::Create( this, aIconName, true )->ShowDialog();
if ( ret == 2 )
{
ReplaceGraphicItem( aPath );
@@ -5390,8 +5390,7 @@ MessBox( pWindow, WB_DEF_YES, CUI_RES( RID_SVXSTR_REPLACE_ICON_CONFIRM ), CUI_R
SvxIconReplacementDialog :: SvxIconReplacementDialog(
vcl::Window *pWindow, const OUString& aMessage )
- :
-MessBox( pWindow, WB_YES_NO_CANCEL, CUI_RES( RID_SVXSTR_REPLACE_ICON_CONFIRM ), CUI_RES( RID_SVXSTR_REPLACE_ICON_WARNING ) )
+ : MessBox( pWindow, WB_YES_NO_CANCEL, CUI_RES( RID_SVXSTR_REPLACE_ICON_CONFIRM ), CUI_RES( RID_SVXSTR_REPLACE_ICON_WARNING ) )
{
SetImage( WarningBox::GetStandardImage() );
SetMessText( ReplaceIconName( aMessage ));
diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx
index 8cdc64439efa..7c6920efe8fc 100644
--- a/cui/source/dialogs/multipat.cxx
+++ b/cui/source/dialogs/multipat.cxx
@@ -92,7 +92,7 @@ IMPL_LINK_NOARG(SvxMultiPathDialog, AddHdl_Impl)
{
OUString sMsg( CUI_RES( RID_MULTIPATH_DBL_ERR ) );
sMsg = sMsg.replaceFirst( "%1", sInsPath );
- InfoBox( this, sMsg ).Execute();
+ ScopedVclPtr<InfoBox>::Create( this, sMsg )->Execute();
}
SelectHdl_Impl( NULL );
@@ -117,7 +117,7 @@ IMPL_LINK_NOARG(SvxPathSelectDialog, AddHdl_Impl)
{
OUString sMsg( CUI_RES( RID_MULTIPATH_DBL_ERR ) );
sMsg = sMsg.replaceFirst( "%1", sInsPath );
- InfoBox( this, sMsg ).Execute();
+ ScopedVclPtr<InfoBox>::Create( this, sMsg )->Execute();
}
else
{
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 6146c5db89b8..5691393f3da1 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1016,7 +1016,7 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
if(!pGroupInfo->m_pModule)
{
pGroupInfo->m_bLoadError = true;
- InfoBox(pBox, sNotLoadedError).Execute();
+ ScopedVclPtr<InfoBox>::Create(pBox, sNotLoadedError)->Execute();
return;
}
if(bIdentical)
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 89c0641e92f1..65c28c798561 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -1493,7 +1493,7 @@ SfxTabPage::sfxpg SvxPageDescPage::DeactivatePage( SfxItemSet* _pSet )
if ( ePaper != PAPER_SCREEN_4_3 && ePaper != PAPER_SCREEN_16_9 && ePaper != PAPER_SCREEN_16_10 && IsMarginOutOfRange() )
{
- if ( QueryBox( this, WB_YES_NO | WB_DEF_NO, m_pPrintRangeQueryText->GetText() ).Execute() == RET_NO )
+ if ( ScopedVclPtr<QueryBox>::Create( this, WB_YES_NO | WB_DEF_NO, m_pPrintRangeQueryText->GetText() )->Execute() == RET_NO )
{
MetricField* pField = NULL;
if ( IsPrinterRangeOverflow( *m_pLeftMarginEdit, nFirstLeftMargin, nLastLeftMargin, MARGIN_LEFT ) )