summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-07-26 10:21:41 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-08-03 09:47:42 +0000
commit0b21f434b45c350cd9cc5b820226245d6824bf86 (patch)
tree2db24f59783e6a91bee55fb2cd75421836f6dd60 /cui
parentc4c30cfac570aeb0f8ac91b36b986e438e2811bc (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 (cherry picked from commit a860df25dd7bf62ecb6b3d3ed38803b981f56d52) Change-Id: Ifacc8d5e742820701307c3c37b9b86487667d84f Reviewed-on: https://gerrit.libreoffice.org/27537 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/cfg.cxx8
-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, 27 insertions, 27 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 7b0178b8dc55..ee111f790ad9 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2347,7 +2347,7 @@ 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 ),
VCL_MESSAGE_INFO )->Execute();
}
@@ -5235,7 +5235,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();
@@ -5357,7 +5357,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] );
@@ -5385,7 +5385,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 c9207f9ad8d8..ccf9127327ec 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 5468c9e4b5c0..dce482bd228f 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), VCL_MESSAGE_INFO)->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, CUI_RESSTR(RID_SVXSTR_OPT_DOUBLE_DICTS), VCL_MESSAGE_INFO)->Execute();
pNameEdit->GrabFocus();
return;
}
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 2dc815a8d8a7..51bd7a7bd24b 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 6cf6e03deea8..36d64cb1f388 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1009,7 +1009,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 0fa0782bf304..56be39bf89db 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -1465,7 +1465,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 ( 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 4ab7c8ec911a..b65c3d4583b9 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -1695,7 +1695,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 de4366432e8b..25d44420edf3 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 3eab7dea9f19..0fd06c5918dc 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 3364d3e9de9c..34f3020cd112 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();
}