summaryrefslogtreecommitdiff
path: root/desktop/source/deployment/gui
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-02-11 14:42:23 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-04-09 22:17:00 +0100
commit00f2787a4a68633206635743298926bf2e65a8fa (patch)
treeefc3a4f02b3d8acd69d25071499be5a475cb0338 /desktop/source/deployment/gui
parentb3dcb2996b70caabda1939c9e85545c97d78404a (diff)
vclwidgets: wrap all vcl::Window subclasses allocated on stack in VclPtr
Change-Id: Ia8b0d84bbf69f9d8f85505d019acdded14e25133 Conflicts: sw/qa/tiledrendering/tiledrendering.cxx
Diffstat (limited to 'desktop/source/deployment/gui')
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx42
-rw-r--r--desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx14
2 files changed, 28 insertions, 28 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 75b7803ced88..b3a7195507da 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -407,8 +407,8 @@ void ExtBoxWithBtns_Impl::MouseButtonDown( const MouseEvent& rMEvt )
break;
case CMD_SHOW_LICENSE:
{
- ShowLicenseDialog aLicenseDlg( m_pParent, GetEntryData( nPos )->m_xPackage );
- aLicenseDlg.Execute();
+ VclPtr<ShowLicenseDialog> aLicenseDlg(new ShowLicenseDialog( m_pParent, GetEntryData( nPos )->m_xPackage ));
+ aLicenseDlg->Execute();
break;
}
}
@@ -594,12 +594,12 @@ bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment::
if ( !bHadWarning && IsSharedPkgMgr( xPackage ) )
{
const SolarMutexGuard guard;
- MessageDialog aInfoBox(pParent, getResId(nResID),
- VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
+ VclPtr<MessageDialog> aInfoBox(new MessageDialog(pParent, getResId(nResID),
+ VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL));
bHadWarning = true;
- if ( RET_OK == aInfoBox.Execute() )
+ if ( RET_OK == aInfoBox->Execute() )
return true;
else
return false;
@@ -626,32 +626,32 @@ void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle
uno::Any exc( ::cppu::getCaughtException() );
OUString msg( ::comphelper::anyToString( exc ) );
const SolarMutexGuard guard;
- MessageDialog aErrorBox(NULL, msg);
- aErrorBox.SetText( sTitle );
- aErrorBox.Execute();
+ VclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, msg));
+ aErrorBox->SetText( sTitle );
+ aErrorBox->Execute();
}
}
bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const
{
const SolarMutexGuard guard;
- MessageDialog aInfo(m_pVCLWindow, getResId(RID_STR_WARNING_INSTALL_EXTENSION),
- VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
+ VclPtr<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());
+ OUString sText(aInfo->get_primary_text());
sText = sText.replaceAll("%NAME", rExtensionName);
- aInfo.set_primary_text(sText);
+ aInfo->set_primary_text(sText);
- return ( RET_OK == aInfo.Execute() );
+ return ( RET_OK == aInfo->Execute() );
}
bool DialogHelper::installForAllUsers( bool &bInstallForAll ) const
{
const SolarMutexGuard guard;
- MessageDialog aQuery(m_pVCLWindow, "InstallForAllDialog",
- "desktop/ui/installforalldialog.ui");
+ VclPtr<MessageDialog> aQuery(new MessageDialog(m_pVCLWindow, "InstallForAllDialog",
+ "desktop/ui/installforalldialog.ui"));
- short nRet = aQuery.Execute();
+ short nRet = aQuery->Execute();
if (nRet == RET_CANCEL)
return false;
@@ -782,14 +782,14 @@ void ExtMgrDialog::checkEntries()
bool ExtMgrDialog::removeExtensionWarn( const OUString &rExtensionName ) const
{
const SolarMutexGuard guard;
- MessageDialog aInfo(const_cast<ExtMgrDialog*>(this), getResId(RID_STR_WARNING_REMOVE_EXTENSION),
- VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
+ VclPtr<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());
+ OUString sText(aInfo->get_primary_text());
sText = sText.replaceAll("%NAME", rExtensionName);
- aInfo.set_primary_text(sText);
+ aInfo->set_primary_text(sText);
- return ( RET_OK == aInfo.Execute() );
+ return ( RET_OK == aInfo->Execute() );
}
bool ExtMgrDialog::enablePackage( const uno::Reference< deployment::XPackage > &xPackage,
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index 203c061ff315..a0758913e469 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -451,12 +451,12 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
verExc.Deployed->getDisplayName());
{
SolarMutexGuard guard;
- MessageDialog box(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL,
- ResId(id, *DeploymentGuiResMgr::get()), VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
+ VclPtr<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)
{
- s = box.get_primary_text();
+ s = box->get_primary_text();
}
else if (id == RID_STR_WARNING_VERSION_EQUAL)
{
@@ -477,8 +477,8 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
s = s.replaceAll("$OLDNAME", verExc.Deployed->getDisplayName());
s = s.replaceAll("$NEW", getVersion(verExc.NewVersion));
s = s.replaceAll("$DEPLOYED", getVersion(verExc.Deployed));
- box.set_primary_text(s);
- approve = box.Execute() == RET_OK;
+ box->set_primary_text(s);
+ approve = box->Execute() == RET_OK;
abort = !approve;
}
}
@@ -506,8 +506,8 @@ 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());
- MessageDialog box(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, sMsg);
- box.Execute();
+ VclPtr<MessageDialog> box(new MessageDialog(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, sMsg));
+ box->Execute();
approve = true;
}