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 /sc/source/ui | |
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 'sc/source/ui')
-rw-r--r-- | sc/source/ui/dbgui/consdlg.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/dbgui/scendlg.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/dbdocfun.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/crnrdlg.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/scuiautofmt.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/navipi/scenwnd.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/optdlg/tpusrlst.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh3.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/dbfunc.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/dbfunc3.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/spelleng.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshf.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 4 |
14 files changed, 28 insertions, 28 deletions
diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx index 03fb45ce8d04..675b089032b9 100644 --- a/sc/source/ui/dbgui/consdlg.cxx +++ b/sc/source/ui/dbgui/consdlg.cxx @@ -34,7 +34,7 @@ #include "consdlg.hxx" #include <vcl/msgbox.hxx> -#define INFOBOX(id) InfoBox(this, ScGlobal::GetRscString(id)).Execute() +#define INFOBOX(id) ScopedVclPtr<InfoBox>::Create(this, ScGlobal::GetRscString(id))->Execute() class ScAreaData { diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx index bbe8b6c4e5e5..0403320279dc 100644 --- a/sc/source/ui/dbgui/scendlg.cxx +++ b/sc/source/ui/dbgui/scendlg.cxx @@ -171,12 +171,12 @@ IMPL_LINK_NOARG(ScNewScenarioDlg, OkHdl) if ( !ScDocument::ValidTabName( aName ) ) { - InfoBox( this, ScGlobal::GetRscString( STR_INVALIDTABNAME ) ).Execute(); + ScopedVclPtr<InfoBox>::Create( this, ScGlobal::GetRscString( STR_INVALIDTABNAME ) )->Execute(); m_pEdName->GrabFocus(); } else if ( !bIsEdit && !pDoc->ValidNewTabName( aName ) ) { - InfoBox( this, ScGlobal::GetRscString( STR_NEWTABNAMENOTUNIQUE ) ).Execute(); + ScopedVclPtr<InfoBox>::Create( this, ScGlobal::GetRscString( STR_NEWTABNAMENOTUNIQUE ) )->Execute(); m_pEdName->GrabFocus(); } else diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 95f33cf9882b..567e10084462 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -987,10 +987,10 @@ bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam, if (rParam.bReplace) if (rDoc.TestRemoveSubTotals( nTab, rParam )) { - bOk = ( MessBox( ScDocShell::GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + bOk = ( ScopedVclPtr<MessBox>::Create( ScDocShell::GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), // "StarCalc" "Daten loeschen?" ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), - ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_1 ) ).Execute() + ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_1 ) )->Execute() == RET_YES ); } diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 91f1c4bb9170..1245ef562de5 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -395,8 +395,8 @@ bool ScDocFunc::DetectiveMarkInvalid(SCTAB nTab) aModificator.SetDocumentModified(); if ( bOverflow ) { - InfoBox( NULL, - ScGlobal::GetRscString( STR_DETINVALID_OVERFLOW ) ).Execute(); + ScopedVclPtr<InfoBox>::Create( nullptr, + ScGlobal::GetRscString( STR_DETINVALID_OVERFLOW ) )->Execute(); } } else @@ -4920,9 +4920,9 @@ void ScDocFunc::CreateOneName( ScRangeName& rList, aMessage += aName; aMessage += aTemplate.getToken( 1, '#' ); - short nResult = QueryBox( ScDocShell::GetActiveDialogParent(), + short nResult = ScopedVclPtr<QueryBox>::Create( ScDocShell::GetActiveDialogParent(), WinBits(WB_YES_NO_CANCEL | WB_DEF_YES), - aMessage ).Execute(); + aMessage )->Execute(); if ( nResult == RET_YES ) { rList.erase(*pOld); diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx index 8772dc0b5004..9bfa8571f08c 100644 --- a/sc/source/ui/miscdlgs/crnrdlg.cxx +++ b/sc/source/ui/miscdlgs/crnrdlg.cxx @@ -26,8 +26,8 @@ #include <vcl/msgbox.hxx> #include <boost/scoped_array.hpp> -#define ERRORBOX(s) ScopedVclPtrInstance<MessageDialog>::Create(this, s)->Execute() -#define QUERYBOX(m) ScopedVclPtrInstance<QueryBox>::Create(this,WinBits(WB_YES_NO|WB_DEF_YES),m)->Execute() +#define ERRORBOX(s) ScopedVclPtr<MessageDialog>::Create(this, s)->Execute() +#define QUERYBOX(m) ScopedVclPtr<QueryBox>::Create(this,WinBits(WB_YES_NO|WB_DEF_YES),m)->Execute() const sal_uLong nEntryDataCol = 0; const sal_uLong nEntryDataRow = 1; diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx index 8a5d071342de..773169d21ef6 100644 --- a/sc/source/ui/miscdlgs/scuiautofmt.cxx +++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx @@ -293,7 +293,7 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RemoveHdl) aMsg += aStrDelMsg.getToken( 1, '#' ); if ( RET_YES == - QueryBox( this, WinBits( WB_YES_NO | WB_DEF_YES ), aMsg ).Execute() ) + ScopedVclPtr<QueryBox>::Create( this, WinBits( WB_YES_NO | WB_DEF_YES ), aMsg )->Execute() ) { m_pLbFormat->RemoveEntry( nIndex ); m_pLbFormat->SelectEntryPos( nIndex-1 ); diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx index 22ebb99c5eca..eedca0337742 100644 --- a/sc/source/ui/navipi/scenwnd.cxx +++ b/sc/source/ui/navipi/scenwnd.cxx @@ -188,7 +188,7 @@ void ScScenarioListBox::EditScenario() void ScScenarioListBox::DeleteScenario( bool bQueryBox ) { if( GetSelectEntryCount() > 0 ) - if( !bQueryBox || (::QueryBox( 0, WinBits( WB_YES_NO | WB_DEF_YES ), ScGlobal::GetRscString( STR_QUERY_DELSCENARIO ) ).Execute() == RET_YES) ) + if( !bQueryBox || (ScopedVclPtr<QueryBox>::Create( nullptr, WinBits( WB_YES_NO | WB_DEF_YES ), ScGlobal::GetRscString( STR_QUERY_DELSCENARIO ) )->Execute() == RET_YES) ) ExecuteScenarioSlot( SID_DELETE_SCENARIO ); } diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx index fa1611d17310..0815c1322b51 100644 --- a/sc/source/ui/optdlg/tpusrlst.cxx +++ b/sc/source/ui/optdlg/tpusrlst.cxx @@ -425,7 +425,7 @@ void ScTpUserLists::CopyListFromArea( const ScRefAddress& rStartPos, if ( bValueIgnored ) { - InfoBox( this, aStrCopyErr ).Execute(); + ScopedVclPtr<InfoBox>::Create( this, aStrCopyErr )->Execute(); } } @@ -622,10 +622,10 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, PushButton*, pBtn ) aMsg += mpLbLists->GetEntry( nRemovePos ); aMsg += aStrQueryRemove.getToken( 1, '#' ); - if ( RET_YES == QueryBox( this, + if ( RET_YES == ScopedVclPtr<QueryBox>::Create( this, WinBits( WB_YES_NO | WB_DEF_YES ), aMsg - ).Execute() ) + )->Execute() ) { RemoveList( nRemovePos ); UpdateUserListBox(); diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index 77be8cf171a4..6c12d034440a 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -412,8 +412,8 @@ void ScCellShell::Execute( SfxRequest& rReq ) { if ( rReq.IsAPI() || RET_YES == - QueryBox( pTabViewShell->GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), - ScGlobal::GetRscString(STR_UPDATE_SCENARIO) ). + ScopedVclPtr<QueryBox>::Create( pTabViewShell->GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + ScGlobal::GetRscString(STR_UPDATE_SCENARIO) )-> Execute() ) { pTabViewShell->ExtendScenario(); diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx index 83224c957fbb..2b05d3c12b3e 100644 --- a/sc/source/ui/view/dbfunc.cxx +++ b/sc/source/ui/view/dbfunc.cxx @@ -354,10 +354,10 @@ void ScDBFunc::ToggleAutoFilter() { if (!bHeader) { - if ( MessBox( GetViewData().GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + if ( ScopedVclPtr<MessBox>::Create( GetViewData().GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), // "StarCalc" ScGlobal::GetRscString( STR_MSSG_MAKEAUTOFILTER_0 ) // header from first row? - ).Execute() == RET_YES ) + )->Execute() == RET_YES ) { pDBData->SetHeader( true ); //! Undo ?? bHeader = true; diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index e05dab480b3e..d22ec1031b2d 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -397,10 +397,10 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, bool bRecord, if (rParam.bReplace) if (rDoc.TestRemoveSubTotals( nTab, rParam )) { - bOk = ( MessBox( GetViewData().GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + bOk = ( ScopedVclPtr<MessBox>::Create( GetViewData().GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), // "StarCalc" "Daten loeschen?" ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), - ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_1 ) ).Execute() + ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_1 ) )->Execute() == RET_YES ); } diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx index 41604f9f6182..a8e0fca5a7e7 100644 --- a/sc/source/ui/view/spelleng.cxx +++ b/sc/source/ui/view/spelleng.cxx @@ -287,7 +287,7 @@ void ScSpellingEngine::ConvertAll( EditView& rEditView ) { vcl::Window* pParent = GetDialogParent(); ScWaitCursorOff aWaitOff( pParent ); - InfoBox( pParent, ScGlobal::GetRscString( STR_NOLANGERR ) ).Execute(); + ScopedVclPtr<InfoBox>::Create( pParent, ScGlobal::GetRscString( STR_NOLANGERR ) )->Execute(); } } @@ -315,7 +315,7 @@ void ScSpellingEngine::ShowFinishDialog() { vcl::Window* pParent = GetDialogParent(); ScWaitCursorOff aWaitOff( pParent ); - InfoBox( pParent, ScGlobal::GetRscString( STR_SPELLING_STOP_OK ) ).Execute(); + ScopedVclPtr<InfoBox>::Create( pParent, ScGlobal::GetRscString( STR_SPELLING_STOP_OK ) )->Execute(); } vcl::Window* ScSpellingEngine::GetDialogParent() diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index 570bf9a7dd8c..29cfc5fe6990 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -568,10 +568,10 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) // source isn't basic -> ask again bDoIt = ( RET_YES == - QueryBox( GetDialogParent(), + ScopedVclPtr<QueryBox>::Create( GetDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ), ScGlobal::GetRscString(STR_QUERY_DELTAB) - ).Execute() ); + )->Execute() ); } if( bDoIt ) { diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index da021a2c9e56..3783473fdd90 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -441,9 +441,9 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, { OUString aMessage( ScResId( SCSTR_FORMULA_AUTOCORRECTION ) ); aMessage += aCorrectedFormula; - nResult = QueryBox( GetViewData().GetDialogParent(), + nResult = ScopedVclPtr<QueryBox>::Create( GetViewData().GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), - aMessage ).Execute(); + aMessage )->Execute(); } if ( nResult == RET_YES ) { |