Kaydet (Commit) ba81e5c6 authored tarafından Michael Meeks's avatar Michael Meeks

tdf#91702 - fix stack-based MessBox allocation.

Change-Id: I62dd164e281911d9db3de453789a5badc7cd5fd7
Reviewed-on: https://gerrit.libreoffice.org/15954Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst 5fe011ae
......@@ -483,7 +483,7 @@ bool EditorWindow::ImpCanModify()
{
// If in Trace-mode, abort the trace or refuse input
// Remove markers in the modules in Notify at Basic::Stoped
if ( QueryBox( 0, WB_OK_CANCEL, IDEResId(RID_STR_WILLSTOPPRG).toString() ).Execute() == RET_OK )
if ( ScopedVclPtr<QueryBox>::Create( nullptr, WB_OK_CANCEL, IDEResId(RID_STR_WILLSTOPPRG).toString() )->Execute() == RET_OK )
{
rModulWindow.GetBasicStatus().bIsRunning = false;
StopBasic();
......
......@@ -97,7 +97,7 @@ void Shell::ExecuteCurrent( SfxRequest& rReq )
nActModWindows++;
}
if ( nActModWindows <= 1 || ( !rSearchItem.GetSelection() && QueryBox( pCurWin, WB_YES_NO|WB_DEF_YES, IDEResId(RID_STR_SEARCHALLMODULES).toString() ).Execute() == RET_YES ) )
if ( nActModWindows <= 1 || ( !rSearchItem.GetSelection() && ScopedVclPtr<QueryBox>::Create( pCurWin, WB_YES_NO|WB_DEF_YES, IDEResId(RID_STR_SEARCHALLMODULES).toString() )->Execute() == RET_YES ) )
{
for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
{
......@@ -110,7 +110,7 @@ void Shell::ExecuteCurrent( SfxRequest& rReq )
OUString aReplStr(IDE_RESSTR(RID_STR_SEARCHREPLACES));
aReplStr = aReplStr.replaceAll("XX", OUString::number(nFound));
InfoBox( pCurWin, aReplStr ).Execute();
ScopedVclPtr<InfoBox>::Create( pCurWin, aReplStr )->Execute();
}
else
{
......@@ -177,7 +177,7 @@ void Shell::ExecuteCurrent( SfxRequest& rReq )
SetCurWindow( pWin, true );
}
if ( !nFound && !bCanceled )
InfoBox( pCurWin, IDEResId(RID_STR_SEARCHNOTFOUND).toString() ).Execute();
ScopedVclPtr<InfoBox>::Create( pCurWin, IDEResId(RID_STR_SEARCHNOTFOUND).toString() )->Execute();
}
rReq.Done();
......
......@@ -396,7 +396,7 @@ bool Shell::PrepareClose( bool bUI )
if( bUI )
{
vcl::Window *pParent = &GetViewFrame()->GetWindow();
InfoBox( pParent, IDE_RESSTR(RID_STR_CANNOTCLOSE)).Execute();
ScopedVclPtr<InfoBox>::Create( pParent, IDE_RESSTR(RID_STR_CANNOTCLOSE))->Execute();
}
return false;
}
......
......@@ -98,7 +98,7 @@ void BasicDLL::BasicBreak()
{
bJustStopping = true;
StarBASIC::Stop();
InfoBox( 0, BasResId(IDS_SBERR_TERMINATED).toString() ).Execute();
ScopedVclPtr<InfoBox>::Create( nullptr, BasResId(IDS_SBERR_TERMINATED).toString() )->Execute();
bJustStopping = false;
}
}
......
......@@ -1004,9 +1004,10 @@ void SbiIoSystem::WriteCon(const OUString& rText)
}
{
SolarMutexGuard aSolarGuard;
if( !MessBox( Application::GetDefDialogParent(),
if( !ScopedVclPtr<MessBox>::Create(
Application::GetDefDialogParent(),
WinBits( WB_OK_CANCEL | WB_DEF_OK ),
OUString(), s ).Execute() )
OUString(), s )->Execute() )
{
nError = SbERR_USER_ABORT;
}
......
......@@ -136,8 +136,8 @@ void SeriesHeaderEdit::MouseButtonDown( const MouseEvent& rMEvt )
Edit::MouseButtonDown( rMEvt );
if( m_bShowWarningBox )
WarningBox(this, WinBits( WB_OK ),
SCH_RESSTR(STR_INVALID_NUMBER)).Execute();
ScopedVclPtr<WarningBox>::Create(this, WinBits( WB_OK ),
SCH_RESSTR(STR_INVALID_NUMBER))->Execute();
}
class SeriesHeader
......@@ -767,8 +767,8 @@ void DataBrowser::MouseButtonDown( const BrowserMouseEvent& rEvt )
void DataBrowser::ShowWarningBox()
{
WarningBox(this, WinBits( WB_OK ),
SCH_RESSTR(STR_INVALID_NUMBER)).Execute();
ScopedVclPtr<WarningBox>::Create(this, WinBits( WB_OK ),
SCH_RESSTR(STR_INVALID_NUMBER))->Execute();
}
bool DataBrowser::ShowQueryBox()
......
......@@ -621,7 +621,7 @@ bool ScaleTabPage::ShowWarning( sal_uInt16 nResIdMessage, Control* pControl /* =
if( nResIdMessage == 0 )
return false;
WarningBox( this, WinBits( WB_OK ), SCH_RESSTR( nResIdMessage ) ).Execute();
ScopedVclPtr<WarningBox>::Create( this, WinBits( WB_OK ), SCH_RESSTR( nResIdMessage ) )->Execute();
if( pControl )
{
pControl->GrabFocus();
......
......@@ -1536,7 +1536,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
if( ! bReturn )
{
SolarMutexGuard aGuard;
InfoBox( m_pChartWindow, SCH_RESSTR( STR_ACTION_NOTPOSSIBLE )).Execute();
ScopedVclPtr<InfoBox>::Create( m_pChartWindow, SCH_RESSTR( STR_ACTION_NOTPOSSIBLE ))->Execute();
}
}
......
......@@ -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 ));
......
......@@ -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
{
......
......@@ -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)
......
......@@ -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 ) )
......
......@@ -689,7 +689,7 @@ namespace dbaui
{
OUString sFile = ModuleRes( STR_FILE_DOES_NOT_EXIST );
sFile = sFile.replaceFirst("$file$", aTransformer.get(OFileNotation::N_SYSTEM));
OSQLWarningBox( this, sFile ).Execute();
ScopedVclPtr<OSQLWarningBox>::Create( this, sFile )->Execute();
setURLNoPrefix(sOldPath);
SetRoadmapStateValue(false);
callModifiedHdl();
......
......@@ -941,7 +941,7 @@ bool appendToFilter(const Reference<XConnection>& _xConnection,
if(! ::dbaui::checkDataSourceAvailable(::comphelper::getString(xProp->getPropertyValue(PROPERTY_NAME)),_rxContext))
{
OUString aMessage(ModuleRes(STR_TABLEDESIGN_DATASOURCE_DELETED));
OSQLWarningBox( _pParent, aMessage ).Execute();
ScopedVclPtr<OSQLWarningBox>::Create( _pParent, aMessage )->Execute();
bRet = false;
}
else
......
......@@ -524,7 +524,7 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon
m_pVisibleCell->GetBox().EnableInput(false);
OUString aMessage(ModuleRes(STR_QRY_ORDERBY_UNRELATED));
OQueryDesignView* paDView = getDesignView();
InfoBox(paDView, aMessage).Execute();
ScopedVclPtr<InfoBox>::Create(paDView, aMessage)->Execute();
}
} break;
case BROW_ORDER_ROW:
......@@ -614,7 +614,7 @@ bool OSelectionBrowseBox::fillColumnRef(const OUString& _sColumnName, const OUSt
{
OUString sErrorMsg(ModuleRes(RID_STR_FIELD_DOESNT_EXIST));
sErrorMsg = sErrorMsg.replaceFirst("$name$",_sColumnName);
OSQLErrorBox( this, sErrorMsg ).Execute();
ScopedVclPtr<OSQLErrorBox>::Create( this, sErrorMsg )->Execute();
bError = true;
}
else
......@@ -719,7 +719,7 @@ bool OSelectionBrowseBox::saveField(OUString& _sFieldName ,OTableFieldDescRef& _
// something different which we have to check
OUString sErrorMessage( ModuleRes( STR_QRY_COLUMN_NOT_FOUND ) );
sErrorMessage = sErrorMessage.replaceFirst("$name$",_sFieldName);
OSQLErrorBox( this, sErrorMessage ).Execute();
ScopedVclPtr<OSQLErrorBox>::Create( this, sErrorMessage )->Execute();
return true;
}
......@@ -876,7 +876,7 @@ bool OSelectionBrowseBox::saveField(OUString& _sFieldName ,OTableFieldDescRef& _
{ // the field could not be inserted
OUString sErrorMessage( ModuleRes( RID_STR_FIELD_DOESNT_EXIST ) );
sErrorMessage = sErrorMessage.replaceFirst("$name$",aSelEntry->GetField());
OSQLErrorBox( this, sErrorMessage ).Execute();
ScopedVclPtr<OSQLErrorBox>::Create( this, sErrorMessage )->Execute();
bError = true;
}
}
......@@ -1143,7 +1143,7 @@ bool OSelectionBrowseBox::SaveModified()
{
if ( !m_bDisableErrorBox )
{
OSQLWarningBox( this, aErrorMsg ).Execute();
ScopedVclPtr<OSQLWarningBox>::Create( this, aErrorMsg )->Execute();
}
bError = true;
}
......@@ -1152,7 +1152,7 @@ bool OSelectionBrowseBox::SaveModified()
{
if ( !m_bDisableErrorBox )
{
OSQLWarningBox( this, aErrorMsg ).Execute();
ScopedVclPtr<OSQLWarningBox>::Create( this, aErrorMsg )->Execute();
}
bError = true;
}
......
......@@ -1425,7 +1425,7 @@ bool OQueryController::doSaveAsDoc(bool _bSaveAs)
if ( !editingCommand() && !haveDataSource() )
{
OUString aMessage(ModuleRes(STR_DATASOURCE_DELETED));
OSQLWarningBox( getView(), aMessage ).Execute();
ScopedVclPtr<OSQLWarningBox>::Create( getView(), aMessage )->Execute();
return false;
}
......
......@@ -160,7 +160,7 @@ void ORelationController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue
if(!::dbaui::checkDataSourceAvailable(::comphelper::getString(getDataSource()->getPropertyValue(PROPERTY_NAME)), getORB()))
{
OUString aMessage(ModuleRes(STR_DATASOURCE_DELETED));
OSQLWarningBox( getView(), aMessage ).Execute();
ScopedVclPtr<OSQLWarningBox>::Create( getView(), aMessage )->Execute();
}
else
{
......
......@@ -483,7 +483,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, bool bInfoBox )
}
fclose( fp );
if ( bInfoBox )
InfoBox(0, OUString( "D:\\DEBUG.LOG !" ) ).Execute();
ScopedVclPtr<InfoBox>::Create(nullptr, OUString( "D:\\DEBUG.LOG !" ) )->Execute();
}
#endif
......
......@@ -1038,7 +1038,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v
bDebugPaint = !bDebugPaint;
OStringBuffer aInfo("DebugPaint: ");
aInfo.append(bDebugPaint ? "On" : "Off");
InfoBox(NULL, OStringToOUString(aInfo.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US)).Execute();
ScopedVclPtr<InfoBox>::Create(nullptr, OStringToOUString(aInfo.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US))->Execute();
}
bDone = false;
}
......
......@@ -836,7 +836,7 @@ short SvxDicError( vcl::Window *pParent, linguistic::DictionaryError nError )
nRid = RID_SVXSTR_DIC_ERR_UNKNOWN;
SAL_WARN("editeng", "unexpected case");
}
nRes = InfoBox( pParent, EE_RESSTR( nRid ) ).Execute();
nRes = ScopedVclPtr<InfoBox>::Create( pParent, EE_RESSTR( nRid ) )->Execute();
}
return nRes;
}
......
......@@ -1412,7 +1412,7 @@ namespace pcr
}
catch(const PropertyVetoException& eVetoException)
{
InfoBox(m_pView, eVetoException.Message).Execute();
ScopedVclPtr<InfoBox>::Create(m_pView, eVetoException.Message)->Execute();
PropertyHandlerRef handler = impl_getHandlerForProperty_throw( rName );
Any aNormalizedValue = handler->getPropertyValue( rName );
getPropertyBox().SetPropertyValue( rName, aNormalizedValue, false );
......
......@@ -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
{
......
......@@ -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
......
......@@ -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 );
}
......
......@@ -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);
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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 );
}
......
......@@ -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();
......
......@@ -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();
......
......@@ -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;
......
......@@ -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 );
}
......
......@@ -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()
......
......@@ -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 )
{
......
......@@ -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 )
{
......
......@@ -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;
......
......@@ -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();
}
......
......@@ -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
{
......
......@@ -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
......
......@@ -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();
}
</