diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-05-28 21:35:43 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-05-29 12:16:28 +0000 |
commit | ba81e5c6bd420b41a84ade6ccd774011a8089f7f (patch) | |
tree | 554d0904466549cf2ba630e361e457fdcec22c98 /cui | |
parent | 5fe011ae025d7d354ca0647189524843a444ffba (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.cxx | 9 | ||||
-rw-r--r-- | cui/source/dialogs/multipat.cxx | 4 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/page.cxx | 2 |
4 files changed, 8 insertions, 9 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index b5ebf1a217e4..c5a1e7aa31dc 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -5079,7 +5079,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(); @@ -5204,7 +5204,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] ); @@ -5232,7 +5232,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 ); @@ -5388,8 +5388,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 75c8b8896030..b8b5b04a7202 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 a3d1b90e06ee..5aeaafbae998 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 ) ) |