diff options
author | Noel Grandin <noel@peralex.com> | 2015-02-11 14:42:23 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-09 22:17:00 +0100 |
commit | 00f2787a4a68633206635743298926bf2e65a8fa (patch) | |
tree | efc3a4f02b3d8acd69d25071499be5a475cb0338 /sfx2/source/appl | |
parent | b3dcb2996b70caabda1939c9e85545c97d78404a (diff) |
vclwidgets: wrap all vcl::Window subclasses allocated on stack in VclPtr
Change-Id: Ia8b0d84bbf69f9d8f85505d019acdded14e25133
Conflicts:
sw/qa/tiledrendering/tiledrendering.cxx
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r-- | sfx2/source/appl/appopen.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/appl/impldde.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/appl/newhelp.cxx | 24 | ||||
-rw-r--r-- | sfx2/source/appl/opengrf.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/openuriexternally.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/appl/sfxhelp.cxx | 4 |
7 files changed, 35 insertions, 35 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 582a4b8e935d..a307e81cfe37 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -462,8 +462,8 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq ) bool bNewWin = false; vcl::Window* pTopWin = GetTopWindow(); - SfxTemplateManagerDlg aTemplDlg; - int nRet = aTemplDlg.Execute(); + VclPtr<SfxTemplateManagerDlg> aTemplDlg(new SfxTemplateManagerDlg); + int nRet = aTemplDlg->Execute(); if ( nRet == RET_OK ) { rReq.Done(); @@ -831,11 +831,11 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) SolarMutexGuard aGuard; vcl::Window *pWindow = SfxGetpApp()->GetTopWindow(); - MessageDialog aSecurityWarningBox(pWindow, + VclPtr<MessageDialog> aSecurityWarningBox(new MessageDialog(pWindow, SfxResId(STR_SECURITY_WARNING_NO_HYPERLINKS), - VCL_MESSAGE_WARNING); - aSecurityWarningBox.SetText( SfxResId(RID_SECURITY_WARNING_TITLE).toString() ); - aSecurityWarningBox.Execute(); + VCL_MESSAGE_WARNING)); + aSecurityWarningBox->SetText( SfxResId(RID_SECURITY_WARNING_TITLE).toString() ); + aSecurityWarningBox->Execute(); return; } diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index e9b32c56697a..6fece61c4f78 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -451,8 +451,8 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) case SID_SHOW_LICENSE: { - LicenseDialog aDialog; - aDialog.Execute(); + VclPtr<LicenseDialog> aDialog(new LicenseDialog); + aDialog->Execute(); break; } @@ -539,16 +539,16 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) case SID_TEMPLATE_MANAGER: { - SfxTemplateManagerDlg dlg; - dlg.Execute(); + VclPtr<SfxTemplateManagerDlg> dlg(new SfxTemplateManagerDlg); + dlg->Execute(); bDone = true; break; } case SID_TEMPLATE_ADDRESSBOKSOURCE: { - svt::AddressBookSourceDialog aDialog(GetTopWindow(), ::comphelper::getProcessComponentContext()); - aDialog.Execute(); + VclPtr<svt::AddressBookSourceDialog> aDialog(new svt::AddressBookSourceDialog(GetTopWindow(), ::comphelper::getProcessComponentContext())); + aDialog->Execute(); bDone = true; break; } diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index 4a3c0be1e6b7..f66a2b0a3d6e 100644 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -255,10 +255,10 @@ bool SvDDEObject::Connect( SvBaseLink * pSvLink ) void SvDDEObject::Edit( vcl::Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link& rEndEditHdl ) { - SvDDELinkEditDialog aDlg( pParent, pBaseLink ); - if ( RET_OK == aDlg.Execute() && rEndEditHdl.IsSet() ) + VclPtr<SvDDELinkEditDialog> aDlg(new SvDDELinkEditDialog(pParent, pBaseLink) ); + if ( RET_OK == aDlg->Execute() && rEndEditHdl.IsSet() ) { - OUString sCommand = aDlg.GetCmd(); + OUString sCommand = aDlg->GetCmd(); rEndEditHdl.Call( &sCommand ); } } diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index eb800ba69e84..9a80a2e0df55 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1048,8 +1048,8 @@ IMPL_LINK_NOARG(SearchTabPage_Impl, SearchHdl) if ( aFactories.empty() ) { - MessageDialog aBox( this, SfxResId( STR_INFO_NOSEARCHRESULTS ), VCL_MESSAGE_INFO ); - aBox.Execute(); + VclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId( STR_INFO_NOSEARCHRESULTS ), VCL_MESSAGE_INFO) ); + aBox->Execute(); } } return 0; @@ -1194,15 +1194,15 @@ void BookmarksBox_Impl::DoAction( sal_uInt16 nAction ) sal_Int32 nPos = GetSelectEntryPos(); if ( nPos != LISTBOX_ENTRY_NOTFOUND ) { - SfxAddHelpBookmarkDialog_Impl aDlg( this, true ); - aDlg.SetTitle( GetEntry( nPos ) ); - if ( aDlg.Execute() == RET_OK ) + VclPtr<SfxAddHelpBookmarkDialog_Impl> aDlg(new SfxAddHelpBookmarkDialog_Impl(this, true)); + aDlg->SetTitle( GetEntry( nPos ) ); + if ( aDlg->Execute() == RET_OK ) { OUString* pURL = static_cast<OUString*>(GetEntryData( nPos )); RemoveEntry( nPos ); OUString aImageURL = IMAGE_URL; aImageURL += INetURLObject( *pURL ).GetHost(); - nPos = InsertEntry( aDlg.GetTitle(), SvFileInformationManager::GetImage( INetURLObject(aImageURL), false ) ); + nPos = InsertEntry( aDlg->GetTitle(), SvFileInformationManager::GetImage( INetURLObject(aImageURL), false ) ); SetEntryData( nPos, new OUString( *pURL ) ); SelectEntryPos( nPos ); delete pURL; @@ -2288,8 +2288,8 @@ IMPL_LINK( SfxHelpTextWindow_Impl, FindHdl, sfx2::SearchDialog*, pDlg ) else { DBG_ASSERT( pSrchDlg, "no search dialog" ); - MessageDialog aBox( pSrchDlg, SfxResId( STR_INFO_NOSEARCHTEXTFOUND ), VCL_MESSAGE_INFO ); - aBox.Execute(); + VclPtr<MessageDialog> aBox(new MessageDialog(pSrchDlg, SfxResId( STR_INFO_NOSEARCHTEXTFOUND ), VCL_MESSAGE_INFO) ); + aBox->Execute(); pSrchDlg->SetFocusOnEdit(); } } @@ -3167,11 +3167,11 @@ void SfxHelpWindow_Impl::DoAction( sal_uInt16 nActionId ) if ( aAny >>= aValue ) { OUString aTitle( aValue ); - SfxAddHelpBookmarkDialog_Impl aDlg( this, false ); - aDlg.SetTitle( aTitle ); - if ( aDlg.Execute() == RET_OK ) + VclPtr<SfxAddHelpBookmarkDialog_Impl> aDlg(new SfxAddHelpBookmarkDialog_Impl(this, false)); + aDlg->SetTitle( aTitle ); + if ( aDlg->Execute() == RET_OK ) { - aTitle = aDlg.GetTitle(); + aTitle = aDlg->GetTitle(); pIndexWin->AddBookmarks( aTitle, aURL ); } } diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index 2a533bb29ed8..10c4d705d734 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -158,8 +158,8 @@ short SvxOpenGraphicDialog::Execute() // could not load? if ( nFound == USHRT_MAX ) { - WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, SfxResId( SvxOpenGrfErr2ResId(nImpRet) ).toString() ); - bQuitLoop = aWarningBox.Execute()==RET_RETRY ? sal_False : sal_True; + VclPtr<WarningBox> aWarningBox(new WarningBox(NULL, WB_3DLOOK | WB_RETRY_CANCEL, SfxResId( SvxOpenGrfErr2ResId(nImpRet) ).toString()) ); + bQuitLoop = aWarningBox->Execute() != RET_RETRY; } else { diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx index ecc347eddd27..7394b8fb8d72 100644 --- a/sfx2/source/appl/openuriexternally.cxx +++ b/sfx2/source/appl/openuriexternally.cxx @@ -44,10 +44,10 @@ bool sfx2::openUriExternally( "unexpected IllegalArgumentException: " + e.Message); } SolarMutexGuard g; - MessageDialog eb( - SfxGetpApp()->GetTopWindow(), SfxResId(STR_NO_ABS_URI_REF)); - eb.set_primary_text(eb.get_primary_text().replaceFirst("$(ARG1)", uri)); - eb.Execute(); + VclPtr<MessageDialog> eb(new MessageDialog( + SfxGetpApp()->GetTopWindow(), SfxResId(STR_NO_ABS_URI_REF))); + eb->set_primary_text(eb->get_primary_text().replaceFirst("$(ARG1)", uri)); + eb->Execute(); } catch (css::system::SystemShellExecuteException &) { if (!handleSystemShellExecuteException) { throw; diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 247e80e140af..ac82b98815f1 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -605,8 +605,8 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const if ( impl_showOnlineHelp( aHelpURL ) ) return true; - NoHelpErrorBox aErrBox( const_cast< vcl::Window* >( pWindow ) ); - aErrBox.Execute(); + VclPtr<NoHelpErrorBox> aErrBox(new NoHelpErrorBox(const_cast< vcl::Window* >( pWindow )) ); + aErrBox->Execute(); return false; } |