summaryrefslogtreecommitdiff
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-06-04 16:45:17 +0100
commit07074e0e072f33fe8954eded5cd2495822f5f0e4 (patch)
tree5d8ea28f63974fda098fb8514a25c22f5244817c
parent0ae00643fc87ca30ddf788df9f31cec8dae4e544 (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>
-rw-r--r--basctl/source/basicide/baside2b.cxx2
-rw-r--r--basctl/source/basicide/basides1.cxx6
-rw-r--r--basctl/source/basicide/basidesh.cxx2
-rw-r--r--basic/source/runtime/basrdll.cxx2
-rw-r--r--basic/source/runtime/iosys.cxx5
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx8
-rw-r--r--chart2/source/controller/dialogs/tp_Scale.cxx2
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx2
-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
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.cxx2
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx12
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx2
-rw-r--r--dbaccess/source/ui/relationdesign/RelationController.cxx2
-rw-r--r--editeng/source/editeng/editdbg.cxx2
-rw-r--r--editeng/source/editeng/editeng.cxx2
-rw-r--r--editeng/source/misc/unolingu.cxx2
-rw-r--r--extensions/source/propctrlr/propcontroller.cxx2
-rw-r--r--sc/source/ui/dbgui/consdlg.cxx2
-rw-r--r--sc/source/ui/dbgui/scendlg.cxx4
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx4
-rw-r--r--sc/source/ui/docshell/docfunc.cxx8
-rw-r--r--sc/source/ui/miscdlgs/crnrdlg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/scuiautofmt.cxx2
-rw-r--r--sc/source/ui/navipi/scenwnd.cxx2
-rw-r--r--sc/source/ui/optdlg/tpusrlst.cxx6
-rw-r--r--sc/source/ui/view/cellsh3.cxx4
-rw-r--r--sc/source/ui/view/dbfunc.cxx4
-rw-r--r--sc/source/ui/view/dbfunc3.cxx4
-rw-r--r--sc/source/ui/view/spelleng.cxx4
-rw-r--r--sc/source/ui/view/tabvwshf.cxx4
-rw-r--r--sc/source/ui/view/viewfunc.cxx4
-rw-r--r--sd/source/core/drawdoc3.cxx2
-rw-r--r--sd/source/ui/dlg/custsdlg.cxx4
-rw-r--r--sd/source/ui/func/fudraw.cxx2
-rw-r--r--sd/source/ui/view/drawview.cxx5
-rw-r--r--sd/source/ui/view/drviews2.cxx26
-rw-r--r--sd/source/ui/view/drviews4.cxx2
-rw-r--r--sd/source/ui/view/drviewse.cxx18
-rw-r--r--sd/source/ui/view/sdview4.cxx2
-rw-r--r--sfx2/source/appl/linkmgr2.cxx2
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx4
-rw-r--r--sfx2/source/dialog/securitypage.cxx2
-rw-r--r--svx/source/svdraw/svdedtv1.cxx2
-rw-r--r--svx/source/svdraw/svdedxv.cxx2
-rw-r--r--svx/source/svdraw/svdpntv.cxx2
-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
-rw-r--r--xmlsecurity/workben/signaturetest.cxx2
59 files changed, 115 insertions, 116 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 68592f41a180..459449a5ed5f 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -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();
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index f99f7bba0f5b..783c4c0e5c17 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -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();
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index e337fdf8699f..661a667f1034 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -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;
}
diff --git a/basic/source/runtime/basrdll.cxx b/basic/source/runtime/basrdll.cxx
index a1ad75ab7191..e02c0f6798a0 100644
--- a/basic/source/runtime/basrdll.cxx
+++ b/basic/source/runtime/basrdll.cxx
@@ -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;
}
}
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index 2e666ea04128..40fb2f63be77 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -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;
}
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 8f0f979c0eff..e39213f77bf3 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -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()
diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx
index 0e1265170368..f27f8e8cf64c 100644
--- a/chart2/source/controller/dialogs/tp_Scale.cxx
+++ b/chart2/source/controller/dialogs/tp_Scale.cxx
@@ -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();
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 5ee102575377..1da4e2cd8735 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -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();
}
}
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 ) )
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index 8bf6989c9ab9..9a3ac81a97d4 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -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();
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index 71df15d4e64c..c207e30087fb 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -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
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 4cddc7d595a9..4db452c88486 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -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;
}
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 841dc331e973..3b85887911a2 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -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;
}
diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx
index 6a88ef2f5417..063fe310989a 100644
--- a/dbaccess/source/ui/relationdesign/RelationController.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationController.cxx
@@ -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
{
diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx
index d59654f713e5..70cf4b66267b 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -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
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index a119b58dc8dc..4629ba56f1c3 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -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;
}
diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx
index 9208677eba2b..c85eda2586df 100644
--- a/editeng/source/misc/unolingu.cxx
+++ b/editeng/source/misc/unolingu.cxx
@@ -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;
}
diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx
index dc85415a63fa..7236a9ba557f 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -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 );
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 )
{
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 68535643f64e..3f966e8aaee9 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -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;
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index dae2cd4f5a9e..27c3a8695408 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -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();
}
diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index a00a513190ff..b50fe2c87836 100644
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -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
{
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index 179529c4645b..ae2f99c74e4f 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -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
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index f281b69449a1..e9c5f008ab56 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -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();
}
else
{
@@ -2259,7 +2259,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
{
@@ -2288,7 +2288,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
{
@@ -2380,7 +2380,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
{
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index e87de5b09b68..548dbf4e314f 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -106,7 +106,7 @@ void DrawViewShell::DeleteActualLayer()
// replace placeholder
aString = aString.replaceFirst("$", rName);
- if (QueryBox(GetActiveWindow(), WB_YES_NO, aString).Execute() == RET_YES)
+ if (ScopedVclPtr<QueryBox>::Create(GetActiveWindow(), WB_YES_NO, aString)->Execute() == RET_YES)
{
const SdrLayer* pLayer = rAdmin.GetLayer(rName, false);
mpDrawView->DeleteLayer( pLayer->GetName() );
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 5b945c5a39b5..d7bc78f8b75a 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -331,11 +331,11 @@ void DrawViewShell::FuPermanent(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 if ( QueryBox(GetActiveWindow(), WB_YES_NO,
+ else if ( ScopedVclPtr<QueryBox>::Create(GetActiveWindow(), WB_YES_NO,
SD_RESSTR(STR_ASK_FOR_CONVERT_TO_BEZIER)
- ).Execute() == RET_YES )
+ )->Execute() == RET_YES )
{
// implicit transformation into bezier
WaitObject aWait( (Window*)GetActiveWindow() );
@@ -368,11 +368,11 @@ void DrawViewShell::FuPermanent(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 if ( QueryBox(GetActiveWindow(), WB_YES_NO,
+ else if ( ScopedVclPtr<QueryBox>::Create(GetActiveWindow(), WB_YES_NO,
SD_RESSTR(STR_ASK_FOR_CONVERT_TO_BEZIER)
- ).Execute() == RET_YES )
+ )->Execute() == RET_YES )
{
// implicit transformation into bezier
WaitObject aWait( (Window*)GetActiveWindow() );
@@ -676,7 +676,7 @@ void DrawViewShell::FuDeleteSelectedObjects()
if (mpDrawView->IsPresObjSelected(false, true, false, true))
{
::sd::Window* pWindow = GetActiveWindow();
- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) ).Execute();
+ ScopedVclPtr<InfoBox>::Create(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute();
bConsumed = true;
}
@@ -812,7 +812,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected(false, true, 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
{
@@ -834,7 +834,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
if ( mpDrawView->IsPresObjSelected(false, true, 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
{
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 0395499284c1..1bfe74cec694 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -591,7 +591,7 @@ IMPL_LINK_NOARG_TYPED(View, DropInsertFileHdl, Idle *, void)
*/
IMPL_LINK_NOARG_TYPED(View, DropErrorHdl, Idle *, void)
{
- InfoBox( mpViewSh ? mpViewSh->GetActiveWindow() : 0, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) ).Execute();
+ ScopedVclPtr<InfoBox>::Create( mpViewSh ? mpViewSh->GetActiveWindow() : 0, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute();
}
/**
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index b39ab71d1e1e..c3e25657c08e 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -327,7 +327,7 @@ void LinkManager::UpdateAllLinks(
if( bAskUpdate )
{
- int nRet = QueryBox( pParentWin, WB_YES_NO | WB_DEF_YES, SfxResId( STR_QUERY_UPDATE_LINKS ).toString() ).Execute();
+ int nRet = ScopedVclPtr<QueryBox>::Create( pParentWin, WB_YES_NO | WB_DEF_YES, SfxResId( STR_QUERY_UPDATE_LINKS ).toString() )->Execute();
if( RET_YES != nRet )
{
SfxObjectShell* pShell = pLink->GetLinkManager()->GetPersist();
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 713634552312..48bf28dfdbc8 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -540,7 +540,7 @@ bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter )
{
#ifdef DBG_UTIL
// Start Setup
- InfoBox( NULL, "Here should the Setup now be starting!" ).Execute();
+ ScopedVclPtr<InfoBox>::Create( nullptr, "Here should the Setup now be starting!" )->Execute();
#endif
// Installation must still give feedback if it worked or not,
// then the Filterflag be deleted
@@ -552,7 +552,7 @@ bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter )
{
OUString aText( SfxResId(STR_FILTER_CONSULT_SERVICE).toString() );
aText = aText.replaceFirst( "$(FILTER)", pFilter->GetUIName() );
- InfoBox ( NULL, aText ).Execute();
+ ScopedVclPtr<InfoBox>::Create( nullptr, aText )->Execute();
return false;
}
else
diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx
index e5de1d3c99c5..2af8ef50e1ff 100644
--- a/sfx2/source/dialog/securitypage.cxx
+++ b/sfx2/source/dialog/securitypage.cxx
@@ -126,7 +126,7 @@ static bool lcl_IsPasswordCorrect( const OUString &rPassword )
if (SvPasswordHelper::CompareHashPassword( aPasswordHash, rPassword ))
bRes = true; // password was correct
else
- InfoBox( NULL, SFX2_RESSTR(RID_SVXSTR_INCORRECT_PASSWORD) ).Execute();
+ ScopedVclPtr<InfoBox>::Create( nullptr, SFX2_RESSTR(RID_SVXSTR_INCORRECT_PASSWORD) )->Execute();
return bRes;
}
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 26e4b32da9ee..8b5e0f35be47 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -993,7 +993,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll)
if(bHasEEFeatureItems)
{
OUString aMessage("SdrEditView::SetAttrToMarked(): Setting EE_FEATURE items at the SdrView does not make sense! It only leads to overhead and unreadable documents.");
- InfoBox(NULL, aMessage).Execute();
+ ScopedVclPtr<InfoBox>::Create(nullptr, aMessage)->Execute();
}
}
#endif
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 8e5b31dd72d6..e06571a86aaf 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1517,7 +1517,7 @@ bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
if(bHasEEFeatureItems)
{
OUString aMessage("SdrObjEditView::SetAttributes(): Setting EE_FEATURE items at the SdrView does not make sense! It only leads to overhead and unreadable documents.");
- InfoBox(NULL, aMessage).Execute();
+ ScopedVclPtr<InfoBox>::Create(nullptr, aMessage)->Execute();
}
}
#endif
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 775da2f42a79..17e2b9dda5c3 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -1048,7 +1048,7 @@ void SdrPaintView::SetDefaultAttr(const SfxItemSet& rAttr, bool bReplaceAll)
if(bHasEEFeatureItems)
{
OUString aMessage("SdrPaintView::SetDefaultAttr(): Setting EE_FEATURE items at the SdrView does not make sense! It only leads to overhead and unreadable documents.");
- InfoBox(NULL, aMessage).Execute();
+ ScopedVclPtr<InfoBox>::Create(nullptr, aMessage)->Execute();
}
}
#endif
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 94b987aa0aa3..28fc2c920ac3 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;
}
}
diff --git a/xmlsecurity/workben/signaturetest.cxx b/xmlsecurity/workben/signaturetest.cxx
index 77e665f76ed5..e97e6f33c633 100644
--- a/xmlsecurity/workben/signaturetest.cxx
+++ b/xmlsecurity/workben/signaturetest.cxx
@@ -301,7 +301,7 @@ IMPL_LINK_NOARG(MyWin, VerifyDigitalSignaturesHdl)
if ( !rInf.SignatureIsValid )
aText.append( "NOT " );
aText.append( "valid" );
- InfoBox( this, aText ).Execute();
+ ScopedVclPtr<InfoBox>::Create( this, aText )->Execute();
}
return 0;