diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-20 11:27:10 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 12:37:44 +0100 |
commit | 61b224f392eb856bf4cfa0c04c68202a463cbdbf (patch) | |
tree | 77a28e38763bc5f9d95e2c278601d31dc6fbf65d /desktop | |
parent | f1d9eef4163e88a3cb6360178b52ce441e65d8ae (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 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 4 | ||||
-rw-r--r-- | desktop/source/app/lockfile2.cxx | 2 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_dialog2.cxx | 12 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx | 10 | ||||
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_misc.cxx | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 177d6241db1a..db6dbd6b497b 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -708,7 +708,7 @@ void Desktop::HandleBootstrapPathErrors( ::utl::Bootstrap::Status aBootstrapStat OUString const aMessage(aDiagnosticMessage + "\n"); - VclPtr<MessageDialog> aBootstrapFailedBox(new MessageDialog(NULL, aMessage)); + ScopedVclPtr<MessageDialog> aBootstrapFailedBox(new MessageDialog(NULL, aMessage)); aBootstrapFailedBox->SetText( aProductKey ); aBootstrapFailedBox->Execute(); } @@ -2354,7 +2354,7 @@ void Desktop::OpenClients() ResMgr* pDtResMgr = GetDesktopResManager(); if( pDtResMgr ) { - VclPtr<MessageDialog> aBox(new MessageDialog(NULL, ResId(STR_ERR_PRINTDISABLED, *pDtResMgr))); + ScopedVclPtr<MessageDialog> aBox(new MessageDialog(NULL, ResId(STR_ERR_PRINTDISABLED, *pDtResMgr))); aBox->Execute(); } } diff --git a/desktop/source/app/lockfile2.cxx b/desktop/source/app/lockfile2.cxx index 7b9a2590b1fd..679258c88dd3 100644 --- a/desktop/source/app/lockfile2.cxx +++ b/desktop/source/app/lockfile2.cxx @@ -38,7 +38,7 @@ bool Lockfile_execWarning( Lockfile * that ) OString aTime = aConfig.ReadKey( LOCKFILE_TIMEKEY ); // display warning and return response - VclPtr<MessageDialog> aBox(new MessageDialog(NULL, DesktopResId(STR_QUERY_USERDATALOCKED), + ScopedVclPtr<MessageDialog> aBox(new MessageDialog(NULL, DesktopResId(STR_QUERY_USERDATALOCKED), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); // set box title OUString aTitle = OUString( DesktopResId( STR_TITLE_USERDATALOCKED )); diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index ad92ddd86b14..fdfcf89dd133 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -408,7 +408,7 @@ void ExtBoxWithBtns_Impl::MouseButtonDown( const MouseEvent& rMEvt ) break; case CMD_SHOW_LICENSE: { - VclPtr<ShowLicenseDialog> aLicenseDlg(new ShowLicenseDialog( m_pParent, GetEntryData( nPos )->m_xPackage )); + ScopedVclPtr<ShowLicenseDialog> aLicenseDlg(new ShowLicenseDialog( m_pParent, GetEntryData( nPos )->m_xPackage )); aLicenseDlg->Execute(); break; } @@ -595,7 +595,7 @@ bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment:: if ( !bHadWarning && IsSharedPkgMgr( xPackage ) ) { const SolarMutexGuard guard; - VclPtr<MessageDialog> aInfoBox(new MessageDialog(pParent, getResId(nResID), + ScopedVclPtr<MessageDialog> aInfoBox(new MessageDialog(pParent, getResId(nResID), VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL)); bHadWarning = true; @@ -627,7 +627,7 @@ void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle 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(); } @@ -636,7 +636,7 @@ void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const { const SolarMutexGuard guard; - VclPtr<MessageDialog> aInfo(new MessageDialog(m_pVCLWindow, getResId(RID_STR_WARNING_INSTALL_EXTENSION), + ScopedVclPtr<MessageDialog> aInfo(new MessageDialog(m_pVCLWindow, getResId(RID_STR_WARNING_INSTALL_EXTENSION), VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL)); OUString sText(aInfo->get_primary_text()); @@ -649,7 +649,7 @@ bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const bool DialogHelper::installForAllUsers( bool &bInstallForAll ) const { const SolarMutexGuard guard; - VclPtr<MessageDialog> aQuery(new MessageDialog(m_pVCLWindow, "InstallForAllDialog", + ScopedVclPtr<MessageDialog> aQuery(new MessageDialog(m_pVCLWindow, "InstallForAllDialog", "desktop/ui/installforalldialog.ui")); short nRet = aQuery->Execute(); @@ -794,7 +794,7 @@ void ExtMgrDialog::checkEntries() bool ExtMgrDialog::removeExtensionWarn( const OUString &rExtensionName ) const { const SolarMutexGuard guard; - VclPtr<MessageDialog> aInfo(new MessageDialog(const_cast<ExtMgrDialog*>(this), getResId(RID_STR_WARNING_REMOVE_EXTENSION), + ScopedVclPtr<MessageDialog> aInfo(new MessageDialog(const_cast<ExtMgrDialog*>(this), getResId(RID_STR_WARNING_REMOVE_EXTENSION), VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL)); OUString sText(aInfo->get_primary_text()); diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx index efea15426e6d..64480b14fc04 100644 --- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx +++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx @@ -451,7 +451,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & verExc.Deployed->getDisplayName()); { SolarMutexGuard guard; - VclPtr<MessageDialog> box(new MessageDialog(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, + ScopedVclPtr<MessageDialog> box(new MessageDialog(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, ResId(id, *DeploymentGuiResMgr::get()), VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL)); OUString s; if (bEqualNames) @@ -506,7 +506,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & SolarMutexGuard guard; OUString sMsg(ResId(RID_STR_UNSUPPORTED_PLATFORM, *DeploymentGuiResMgr::get()).toString()); sMsg = sMsg.replaceAll("%Name", platExc.package->getDisplayName()); - VclPtr<MessageDialog> box(new MessageDialog(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, sMsg)); + ScopedVclPtr<MessageDialog> box(new MessageDialog(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, sMsg)); box->Execute(); approve = true; } @@ -571,7 +571,7 @@ void ProgressCmdEnv::update_( uno::Any const & rStatus ) text = ::comphelper::anyToString( rStatus ); // fallback const SolarMutexGuard aGuard; - VclPtr<MessageDialog> aBox(new MessageDialog(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, text)); + ScopedVclPtr<MessageDialog> aBox(new MessageDialog(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, text)); aBox->Execute(); } ++m_nCurrentProgress; @@ -813,7 +813,7 @@ void ExtensionCmdQueue::Thread::execute() msg = ::comphelper::anyToString(exc); const SolarMutexGuard guard; - VclPtr<MessageDialog> box( + ScopedVclPtr<MessageDialog> box( new MessageDialog(currentCmdEnv->activeDialog(), msg)); if ( m_pDialogHelper ) box->SetText( m_pDialogHelper->getWindow()->GetText() ); @@ -923,7 +923,7 @@ void ExtensionCmdQueue::Thread::_removeExtension( ::rtl::Reference< ProgressCmdE void ExtensionCmdQueue::Thread::_checkForUpdates( const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList ) { - VclPtr<UpdateDialog> pUpdateDialog; + ScopedVclPtr<UpdateDialog> pUpdateDialog; std::vector< UpdateData > vData; const SolarMutexGuard guard; diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index 31a99d93b53a..a7e4789929ac 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -472,7 +472,7 @@ Reference<XComponentContext> getUNO( if ( ! InitVCL() ) throw RuntimeException( "Cannot initialize VCL!" ); { - VclPtr<WarningBox> warn(new WarningBox(NULL, WB_OK | WB_DEF_OK, sMsg)); + ScopedVclPtr<WarningBox> warn(new WarningBox(NULL, WB_OK | WB_DEF_OK, sMsg)); warn->SetText(utl::ConfigManager::getProductName()); warn->SetIcon(0); warn->Execute(); |