summaryrefslogtreecommitdiff
path: root/cui/source/dialogs
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-20 11:27:10 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-04-10 12:37:44 +0100
commit61b224f392eb856bf4cfa0c04c68202a463cbdbf (patch)
tree77a28e38763bc5f9d95e2c278601d31dc6fbf65d /cui/source/dialogs
parentf1d9eef4163e88a3cb6360178b52ce441e65d8ae (diff)
vclwidget: fixup locally allocated vcl::Window objects
They need to be wrapped in ScopedVclPtr in order to be disposed properly. Change-Id: Ib64dba353774f54711e4de7f5d15d859c6a4dc7e
Diffstat (limited to 'cui/source/dialogs')
-rw-r--r--cui/source/dialogs/SpellDialog.cxx2
-rw-r--r--cui/source/dialogs/about.cxx2
-rw-r--r--cui/source/dialogs/colorpicker.cxx2
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx2
-rw-r--r--cui/source/dialogs/hangulhanjadlg.cxx6
-rw-r--r--cui/source/dialogs/hldocntp.cxx4
-rw-r--r--cui/source/dialogs/hltpbase.cxx2
-rw-r--r--cui/source/dialogs/linkdlg.cxx4
-rw-r--r--cui/source/dialogs/passwdomdlg.cxx4
-rw-r--r--cui/source/dialogs/scriptdlg.cxx8
10 files changed, 18 insertions, 18 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index eba3a2a15979..0cee25dad2db 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -2055,7 +2055,7 @@ IMPL_LINK( SpellDialog, HandleHyperlink, FixedHyperlink*, pHyperlink )
uno::Any exc( ::cppu::getCaughtException() );
OUString msg( ::comphelper::anyToString( exc ) );
const SolarMutexGuard guard;
- VclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, msg));
+ ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, msg));
aErrorBox->SetText(sTitle);
aErrorBox->Execute();
}
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index cfbdd3ca64e4..40239ca9b15e 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -143,7 +143,7 @@ IMPL_LINK( AboutDialog, HandleClick, PushButton*, pButton )
Any exc( ::cppu::getCaughtException() );
OUString msg( ::comphelper::anyToString( exc ) );
const SolarMutexGuard guard;
- VclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, msg));
+ ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, msg));
aErrorBox->SetText( GetText() );
aErrorBox->Execute();
}
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index 4cb968d3c6de..593db194ce85 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -1541,7 +1541,7 @@ void SAL_CALL ColorPicker::setTitle( const OUString& sTitle ) throw (RuntimeExce
sal_Int16 SAL_CALL ColorPicker::execute( ) throw (RuntimeException, std::exception)
{
- VclPtr<ColorPickerDialog> aDlg(new ColorPickerDialog( VCLUnoHelper::GetWindow( mxParent ), mnColor, mnMode ));
+ ScopedVclPtr<ColorPickerDialog> aDlg(new ColorPickerDialog( VCLUnoHelper::GetWindow( mxParent ), mnColor, mnMode ));
sal_Int16 ret = aDlg->Execute();
if( ret )
mnColor = aDlg->GetColor();
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 4b9763be3c85..9811a85b6b07 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -611,7 +611,7 @@ IMPL_LINK_NOARG(GalleryIdDialog, ClickOkHdl)
aStr += pInfo->GetThemeName();
aStr += ")";
- VclPtr<InfoBox> aBox(new InfoBox( this, aStr ));
+ ScopedVclPtr<InfoBox> aBox(new InfoBox( this, aStr ));
aBox->Execute();
m_pLbResName->GrabFocus();
bDifferentThemeExists = true;
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index 0652c8b0f3a0..6d1a69a8b076 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -761,7 +761,7 @@ namespace svx
IMPL_LINK_NOARG( HangulHanjaConversionDialog, OnOption )
{
- VclPtr<HangulHanjaOptionsDialog> aOptDlg( new HangulHanjaOptionsDialog(this) );
+ ScopedVclPtr<HangulHanjaOptionsDialog> aOptDlg( new HangulHanjaOptionsDialog(this) );
aOptDlg->Execute();
m_aOptionsChangedLink.Call( this );
return 0L;
@@ -1041,7 +1041,7 @@ namespace svx
IMPL_LINK_NOARG(HangulHanjaOptionsDialog, NewDictHdl)
{
OUString aName;
- VclPtr<HangulHanjaNewDictDialog> aNewDlg( new HangulHanjaNewDictDialog(this) );
+ ScopedVclPtr<HangulHanjaNewDictDialog> aNewDlg( new HangulHanjaNewDictDialog(this) );
aNewDlg->Execute();
if( aNewDlg->GetName( aName ) )
{
@@ -1077,7 +1077,7 @@ namespace svx
DBG_ASSERT( pEntry, "+HangulHanjaEditDictDialog::EditDictHdl(): call of edit should not be possible with no selection!" );
if( pEntry )
{
- VclPtr<HangulHanjaEditDictDialog> aEdDlg( new HangulHanjaEditDictDialog(this, m_aDictList, m_pDictsLB->GetSelectEntryPos()) );
+ ScopedVclPtr<HangulHanjaEditDictDialog> aEdDlg( new HangulHanjaEditDictDialog(this, m_aDictList, m_pDictsLB->GetSelectEntryPos()) );
aEdDlg->Execute();
}
return 0L;
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index f08098b2a74f..85e7f27fd7ce 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -271,7 +271,7 @@ bool SvxHyperlinkNewDocTp::AskApply()
bool bRet = ImplGetURLObject( m_pCbbPath->GetText(), m_pCbbPath->GetBaseURL(), aINetURLObject );
if ( !bRet )
{
- VclPtr<WarningBox> aWarning(new WarningBox( this, WB_OK, CUI_RESSTR(RID_SVXSTR_HYPDLG_NOVALIDFILENAME) ) );
+ ScopedVclPtr<WarningBox> aWarning(new WarningBox( this, WB_OK, CUI_RESSTR(RID_SVXSTR_HYPDLG_NOVALIDFILENAME) ) );
aWarning->Execute();
}
return bRet;
@@ -321,7 +321,7 @@ void SvxHyperlinkNewDocTp::DoApply ()
if( bOk )
{
- VclPtr<WarningBox> aWarning(new WarningBox( this, WB_YES_NO, CUI_RESSTR(RID_SVXSTR_HYPERDLG_QUERYOVERWRITE) ));
+ ScopedVclPtrInstance<WarningBox> aWarning( this, WB_YES_NO, CUI_RESSTR(RID_SVXSTR_HYPERDLG_QUERYOVERWRITE) );
bCreate = aWarning->Execute() == RET_YES;
}
}
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 072dedd1baa3..d341bc6e142b 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -333,7 +333,7 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl)
bool bIsInputEnabled = GetParent()->IsInputEnabled();
if ( bIsInputEnabled )
GetParent()->EnableInput( false );
- VclPtr<SfxMacroAssignDlg> aDlg(new SfxMacroAssignDlg( this, mxDocumentFrame, *pItemSet ));
+ ScopedVclPtr<SfxMacroAssignDlg> aDlg(new SfxMacroAssignDlg( this, mxDocumentFrame, *pItemSet ));
// add events
SfxMacroTabPage *pMacroPage = static_cast<SfxMacroTabPage*>( aDlg->GetTabPage() );
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index e9811ab59977..5a83bbe4192f 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -444,7 +444,7 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
if( !xLink.Is() )
return 0;
- VclPtr<QueryBox> aBox(new QueryBox( this, WB_YES_NO | WB_DEF_YES, Closelinkmsg() ));
+ ScopedVclPtr<QueryBox> aBox(new QueryBox( this, WB_YES_NO | WB_DEF_YES, Closelinkmsg() ));
if( RET_YES == aBox->Execute() )
{
@@ -475,7 +475,7 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
}
else
{
- VclPtr<QueryBox> aBox(new QueryBox( this, WB_YES_NO | WB_DEF_YES, CloselinkmsgMulti() ));
+ ScopedVclPtr<QueryBox> aBox(new QueryBox( this, WB_YES_NO | WB_DEF_YES, CloselinkmsgMulti() ));
if( RET_YES == aBox->Execute() )
{
diff --git a/cui/source/dialogs/passwdomdlg.cxx b/cui/source/dialogs/passwdomdlg.cxx
index 5d161aef4972..e59e58183181 100644
--- a/cui/source/dialogs/passwdomdlg.cxx
+++ b/cui/source/dialogs/passwdomdlg.cxx
@@ -101,7 +101,7 @@ IMPL_LINK( PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, OKButton *, EMPTYARG
m_pPasswdToModifyED->GetText().isEmpty();
if (bInvalidState)
{
- VclPtr<MessageDialog> aErrorBox(new MessageDialog(m_pParent,
+ ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(m_pParent,
m_bIsPasswordToModify? m_aInvalidStateForOkButton : m_aInvalidStateForOkButton_v2));
aErrorBox->Execute();
}
@@ -112,7 +112,7 @@ IMPL_LINK( PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, OKButton *, EMPTYARG
const int nMismatch = (bToOpenMatch? 0 : 1) + (bToModifyMatch? 0 : 1);
if (nMismatch > 0)
{
- VclPtr<MessageDialog> aErrorBox(new MessageDialog(m_pParent, nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch));
+ ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(m_pParent, nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch));
aErrorBox->Execute();
Edit* pEdit = !bToOpenMatch ? m_pPasswdToOpenED : m_pPasswdToModifyED;
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 5bf6d6d21e42..c4c5b0df039c 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -922,7 +922,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
bValid = false;
OUString aError( m_createErrStr );
aError += m_createDupStr;
- VclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), aError));
+ ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), aError));
aErrorBox->SetText( m_createErrTitleStr );
aErrorBox->Execute();
xNewDlg->SetObjectName( aNewName );
@@ -1004,7 +1004,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
{
//ISSUE L10N & message from exception?
OUString aError( m_createErrStr );
- VclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), aError));
+ ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), aError));
aErrorBox->SetText( m_createErrTitleStr );
aErrorBox->Execute();
}
@@ -1080,7 +1080,7 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry )
{
//ISSUE L10N & message from exception?
OUString aError( m_renameErrStr );
- VclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), aError));
+ ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), aError));
aErrorBox->SetText( m_renameErrTitleStr );
aErrorBox->Execute();
}
@@ -1126,7 +1126,7 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
else
{
//ISSUE L10N & message from exception?
- VclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), m_delErrStr));
+ ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), m_delErrStr));
aErrorBox->SetText( m_delErrTitleStr );
aErrorBox->Execute();
}