summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-07-26 10:21:41 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-07-26 11:26:52 +0100
commita860df25dd7bf62ecb6b3d3ed38803b981f56d52 (patch)
tree591e39d4fc9b3da4d3b84882e69baf88baa05507 /cui
parent87e2b0142a1724b9075f31acfc44011082ce8e12 (diff)
masses of MessBoxes not being disposed promptly
since... commit ba81e5c6bd420b41a84ade6ccd774011a8089f7f Date: Thu May 28 21:35:43 2015 +0100 tdf#91702 - fix stack-based MessBox allocation. There is no special ScopedVclPtr<X>::Create or ScopedVclPtrInstance<X>::Create just VclPtr<X>::Create and a raw VclPtr<X>::Create()->foo doesn't call dispose on the owned X Change-Id: Ifacc8d5e742820701307c3c37b9b86487667d84f
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/cfg.cxx10
-rw-r--r--cui/source/dialogs/cuifmsearch.cxx2
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx2
-rw-r--r--cui/source/dialogs/insdlg.cxx6
-rw-r--r--cui/source/dialogs/multipat.cxx4
-rw-r--r--cui/source/options/optdict.cxx2
-rw-r--r--cui/source/options/optinet2.cxx2
-rw-r--r--cui/source/options/optjava.cxx4
-rw-r--r--cui/source/options/treeopt.cxx2
-rw-r--r--cui/source/tabpages/page.cxx2
-rw-r--r--cui/source/tabpages/tparea.cxx2
-rw-r--r--cui/source/tabpages/tpcolor.cxx6
-rw-r--r--cui/source/tabpages/tplnedef.cxx6
-rw-r--r--cui/source/tabpages/tplneend.cxx6
14 files changed, 28 insertions, 28 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 5595e6bd7316..ada85afcbdd1 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2346,9 +2346,9 @@ SvTreeListEntry* SvxConfigPage::InsertEntryIntoUI(
IMPL_LINK_NOARG_TYPED( SvxConfigPage, AsyncInfoMsg, void*, void )
{
// Asynchronous msg because of D&D
- ScopedVclPtr<MessageDialog>::Create( this,
+ ScopedVclPtrInstance<MessageDialog>(this,
CUI_RES( RID_SVXSTR_MNUCFG_ALREADY_INCLUDED ),
- VclMessageType::Info )->Execute();
+ VclMessageType::Info)->Execute();
}
IMPL_LINK_TYPED( SvxConfigPage, MoveHdl, Button *, pButton, void )
@@ -5233,7 +5233,7 @@ IMPL_LINK_NOARG_TYPED( SvxIconSelectorDialog, ImportHdl, Button *, void)
IMPL_LINK_NOARG_TYPED( SvxIconSelectorDialog, DeleteHdl, Button *, void )
{
OUString message = CUI_RES( RID_SVXSTR_DELETE_ICON_CONFIRM );
- if ( ScopedVclPtr<WarningBox>::Create( this, WinBits(WB_OK_CANCEL), message )->Execute() == RET_OK )
+ if (ScopedVclPtrInstance<WarningBox>(this, WinBits(WB_OK_CANCEL), message)->Execute() == RET_OK)
{
sal_uInt16 nCount = pTbSymbol->GetItemCount();
@@ -5355,7 +5355,7 @@ void SvxIconSelectorDialog::ImportGraphics(
{
aIndex = rPaths[0].lastIndexOf( '/' );
aIconName = rPaths[0].copy( aIndex+1 );
- ret = ScopedVclPtr<SvxIconReplacementDialog>::Create( this, aIconName )->ShowDialog();
+ ret = ScopedVclPtrInstance<SvxIconReplacementDialog>(this, aIconName)->ShowDialog();
if ( ret == 2 )
{
ReplaceGraphicItem( rPaths[0] );
@@ -5383,7 +5383,7 @@ void SvxIconSelectorDialog::ImportGraphics(
{
aIndex = rPaths[i].lastIndexOf( '/' );
aIconName = rPaths[i].copy( aIndex+1 );
- ret = ScopedVclPtr<SvxIconReplacementDialog>::Create( this, aIconName, true )->ShowDialog();
+ ret = ScopedVclPtrInstance<SvxIconReplacementDialog>(this, aIconName, true)->ShowDialog();
if ( ret == 2 )
{
ReplaceGraphicItem( aPath );
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index e0b944498af0..7fcc94334679 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -736,7 +736,7 @@ IMPL_LINK_TYPED(FmSearchDialog, OnSearchProgress, const FmSearchProgress*, pProg
sal_uInt16 nErrorId = (FmSearchProgress::STATE_ERROR == pProgress->aSearchState)
? RID_STR_SEARCH_GENERAL_ERROR
: RID_STR_SEARCH_NORECORD;
- ScopedVclPtrInstance<MessageDialog>::Create(this, CUI_RES(nErrorId))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, CUI_RES(nErrorId))->Execute();
SAL_FALLTHROUGH;
}
case FmSearchProgress::STATE_CANCELED:
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index ca99ba88756c..9e6c715a106d 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -986,7 +986,7 @@ IMPL_LINK_NOARG_TYPED(TPGalleryThemeProperties, SelectFileTypeHdl, ComboBox&, vo
{
aLastFilterName = aText;
- if( ScopedVclPtrInstance<MessageDialog>::Create( this, "QueryUpdateFileListDialog","cui/ui/queryupdategalleryfilelistdialog.ui" )->Execute() == RET_YES )
+ if( ScopedVclPtrInstance<MessageDialog>( this, "QueryUpdateFileListDialog","cui/ui/queryupdategalleryfilelistdialog.ui" )->Execute() == RET_YES )
SearchFiles();
}
}
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index c98baa8943cd..9c0b5a596274 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -284,7 +284,7 @@ short SvInsertOleDlg::Execute()
// global Resource from svtools (former so3 resource)
OUString aErr( impl_getSvtResString( STR_ERROR_OBJNOCREATE_FROM_FILE ) );
aErr = aErr.replaceFirst( "%", aFileName );
- ScopedVclPtrInstance<MessageDialog>::Create(this, aErr)->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, aErr)->Execute();
}
else
{
@@ -292,7 +292,7 @@ short SvInsertOleDlg::Execute()
// global Resource from svtools (former so3 resource)
OUString aErr( impl_getSvtResString( STR_ERROR_OBJNOCREATE ) );
aErr = aErr.replaceFirst( "%", aServerName );
- ScopedVclPtrInstance<MessageDialog>::Create(this, aErr)->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, aErr)->Execute();
}
}
}
@@ -333,7 +333,7 @@ short SvInsertOleDlg::Execute()
// global Resource from svtools (former so3 resource)
OUString aErr( impl_getSvtResString( STR_ERROR_OBJNOCREATE_FROM_FILE ) );
aErr = aErr.replaceFirst( "%", aFileName );
- ScopedVclPtrInstance<MessageDialog>::Create(this, aErr)->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, aErr)->Execute();
}
}
}
diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx
index 39624134b669..bd4e9ade7028 100644
--- a/cui/source/dialogs/multipat.cxx
+++ b/cui/source/dialogs/multipat.cxx
@@ -92,7 +92,7 @@ IMPL_LINK_NOARG_TYPED(SvxMultiPathDialog, AddHdl_Impl, Button*, void)
{
OUString sMsg( CUI_RES( RID_MULTIPATH_DBL_ERR ) );
sMsg = sMsg.replaceFirst( "%1", sInsPath );
- ScopedVclPtr<InfoBox>::Create( this, sMsg )->Execute();
+ ScopedVclPtrInstance<InfoBox>(this, sMsg)->Execute();
}
SelectHdl_Impl( nullptr );
@@ -116,7 +116,7 @@ IMPL_LINK_NOARG_TYPED(SvxPathSelectDialog, AddHdl_Impl, Button*, void)
{
OUString sMsg( CUI_RES( RID_MULTIPATH_DBL_ERR ) );
sMsg = sMsg.replaceFirst( "%1", sInsPath );
- ScopedVclPtr<InfoBox>::Create( this, sMsg )->Execute();
+ ScopedVclPtrInstance<InfoBox>(this, sMsg)->Execute();
}
else
{
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index a4d6b7948ed1..40ab495e6774 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -152,7 +152,7 @@ IMPL_LINK_NOARG_TYPED(SvxNewDictionaryDialog, OKHdl_Impl, Button*, void)
if ( bFound )
{
// duplicate names?
- ScopedVclPtrInstance<MessageDialog>::Create(this, CUI_RESSTR(RID_SVXSTR_OPT_DOUBLE_DICTS), VclMessageType::Info)->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, CUI_RESSTR(RID_SVXSTR_OPT_DOUBLE_DICTS), VclMessageType::Info)->Execute();
pNameEdit->GrabFocus();
return;
}
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index b52418d9d918..fc817a31d4b8 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -132,7 +132,7 @@ void SvxNoSpaceEdit::Modify()
if ( !comphelper::string::isdigitAsciiString(aValue) || (long)aValue.toInt32() > USHRT_MAX )
// the maximum value of a port number is USHRT_MAX
- ScopedVclPtrInstance<MessageDialog>::Create( this, CUI_RES( RID_SVXSTR_OPT_PROXYPORTS ) )->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, CUI_RES( RID_SVXSTR_OPT_PROXYPORTS))->Execute();
}
}
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 20a651b600c0..9fba0a917e05 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -1024,7 +1024,7 @@ IMPL_LINK_NOARG_TYPED(SvxJavaClassPathDlg, AddArchiveHdl_Impl, Button*, void)
{
OUString sMsg( CUI_RES( RID_SVXSTR_MULTIFILE_DBL_ERR ) );
sMsg = sMsg.replaceFirst( "%1", sFile );
- ScopedVclPtrInstance<MessageDialog>::Create(this, sMsg)->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, sMsg)->Execute();
}
}
EnableRemoveButton();
@@ -1059,7 +1059,7 @@ IMPL_LINK_NOARG_TYPED(SvxJavaClassPathDlg, AddPathHdl_Impl, Button*, void)
{
OUString sMsg( CUI_RES( RID_SVXSTR_MULTIFILE_DBL_ERR ) );
sMsg = sMsg.replaceFirst( "%1", sNewFolder );
- ScopedVclPtrInstance<MessageDialog>::Create(this, sMsg)->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, sMsg)->Execute();
}
}
EnableRemoveButton();
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index d61a661d2ce8..4c4c62fd20f6 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1008,7 +1008,7 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
if(!pGroupInfo->m_pModule)
{
pGroupInfo->m_bLoadError = true;
- ScopedVclPtr<InfoBox>::Create(pBox, sNotLoadedError)->Execute();
+ ScopedVclPtrInstance<InfoBox>(pBox, sNotLoadedError)->Execute();
return;
}
if(bIdentical)
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 65bc2d1ddc96..f6fea2903635 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -1429,7 +1429,7 @@ DeactivateRC SvxPageDescPage::DeactivatePage( SfxItemSet* _pSet )
if ( ePaper != PAPER_SCREEN_4_3 && ePaper != PAPER_SCREEN_16_9 && ePaper != PAPER_SCREEN_16_10 && IsMarginOutOfRange() )
{
- if ( ScopedVclPtr<QueryBox>::Create( this, WB_YES_NO | WB_DEF_NO, m_pPrintRangeQueryText->GetText() )->Execute() == RET_NO )
+ if (ScopedVclPtrInstance<QueryBox>(this, WB_YES_NO | WB_DEF_NO, m_pPrintRangeQueryText->GetText())->Execute() == RET_NO)
{
MetricField* pField = nullptr;
if ( IsPrinterRangeOverflow( *m_pLeftMarginEdit, nFirstLeftMargin, nLastLeftMargin, MARGIN_LEFT ) )
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 87155bc1a3fe..6f425521dbf3 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -1468,7 +1468,7 @@ IMPL_LINK_NOARG_TYPED( SvxAreaTabPage, ClickImportHdl_Impl, Button*, void )
else
{
// graphic could not be loaded
- ScopedVclPtrInstance<MessageDialog>::Create (this, OUString(ResId(RID_SVXSTR_READ_DATA_ERROR, rMgr)))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, OUString(ResId(RID_SVXSTR_READ_DATA_ERROR, rMgr)))->Execute();
}
}
}
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 00d1a7b35248..82599b085282 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -125,7 +125,7 @@ IMPL_LINK_NOARG_TYPED(SvxColorTabPage, ClickLoadHdl_Impl, Button*, void)
if( IsModified() && GetList()->Count() > 0 )
{
- nReturn = ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog()
+ nReturn = ScopedVclPtrInstance<MessageDialog>(GetParentDialog()
,"AskSaveList"
,"cui/ui/querysavelistdialog.ui")->Execute();
@@ -179,7 +179,7 @@ IMPL_LINK_NOARG_TYPED(SvxColorTabPage, ClickLoadHdl_Impl, Button*, void)
}
else
{
- ScopedVclPtrInstance<MessageDialog>::Create( mpTopDlg
+ ScopedVclPtrInstance<MessageDialog>(mpTopDlg
,"NoLoadedFileDialog"
,"cui/ui/querynoloadedfiledialog.ui")->Execute();
}
@@ -247,7 +247,7 @@ IMPL_LINK_NOARG_TYPED(SvxColorTabPage, ClickSaveHdl_Impl, Button*, void)
}
else
{
- ScopedVclPtrInstance<MessageDialog>::Create( mpTopDlg
+ ScopedVclPtrInstance<MessageDialog>(mpTopDlg
,"NoSaveFileDialog"
,"cui/ui/querynosavefiledialog.ui")->Execute();
}
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 52ea9ddf390b..499dfb54fa20 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -726,7 +726,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineDefTabPage, ClickLoadHdl_Impl, Button*, void)
if ( *pnDashListState & ChangeType::MODIFIED )
{
- nReturn = ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog()
+ nReturn = ScopedVclPtrInstance<MessageDialog>(GetParentDialog()
,"AskSaveList"
,"cui/ui/querysavelistdialog.ui")->Execute();
@@ -778,7 +778,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineDefTabPage, ClickLoadHdl_Impl, Button*, void)
}
else
//aIStream.Close();
- ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog()
+ ScopedVclPtrInstance<MessageDialog>(GetParentDialog()
,"NoLoadedFileDialog"
,"cui/ui/querynoloadedfiledialog.ui")->Execute();
}
@@ -845,7 +845,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineDefTabPage, ClickSaveHdl_Impl, Button*, void)
}
else
{
- ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog()
+ ScopedVclPtrInstance<MessageDialog>(GetParentDialog()
,"NoSaveFileDialog"
,"cui/ui/querynosavefiledialog.ui")->Execute();
}
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index e2d039e41c88..511b973870a4 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -540,7 +540,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, ClickLoadHdl_Impl, Button*, void)
if ( *pnLineEndListState & ChangeType::MODIFIED )
{
- nReturn = ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog()
+ nReturn = ScopedVclPtrInstance<MessageDialog>(GetParentDialog()
,"AskSaveList"
,"cui/ui/querysavelistdialog.ui")->Execute();
@@ -593,7 +593,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, ClickLoadHdl_Impl, Button*, void)
*pnLineEndListState &= ~ChangeType::MODIFIED;
}
else
- ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog()
+ ScopedVclPtrInstance<MessageDialog>(GetParentDialog()
,"NoLoadedFileDialog"
,"cui/ui/querynoloadedfiledialog.ui")->Execute();
}
@@ -660,7 +660,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, ClickSaveHdl_Impl, Button*, void)
}
else
{
- ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog()
+ ScopedVclPtrInstance<MessageDialog>(GetParentDialog()
,"NoSaveFileDialog"
,"cui/ui/querynosavefiledialog.ui")->Execute();
}