summaryrefslogtreecommitdiff
path: root/desktop
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
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')
-rw-r--r--desktop/source/app/app.cxx10
-rw-r--r--desktop/source/app/lockfile2.cxx12
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx42
-rw-r--r--desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx14
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_misc.cxx8
5 files changed, 43 insertions, 43 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index d0e5324e0165..177d6241db1a 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -708,9 +708,9 @@ void Desktop::HandleBootstrapPathErrors( ::utl::Bootstrap::Status aBootstrapStat
OUString const aMessage(aDiagnosticMessage + "\n");
- MessageDialog aBootstrapFailedBox(NULL, aMessage);
- aBootstrapFailedBox.SetText( aProductKey );
- aBootstrapFailedBox.Execute();
+ VclPtr<MessageDialog> aBootstrapFailedBox(new MessageDialog(NULL, aMessage));
+ aBootstrapFailedBox->SetText( aProductKey );
+ aBootstrapFailedBox->Execute();
}
}
@@ -2354,8 +2354,8 @@ void Desktop::OpenClients()
ResMgr* pDtResMgr = GetDesktopResManager();
if( pDtResMgr )
{
- MessageDialog aBox(NULL, ResId(STR_ERR_PRINTDISABLED, *pDtResMgr));
- aBox.Execute();
+ VclPtr<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 c590ab7cf799..7b9a2590b1fd 100644
--- a/desktop/source/app/lockfile2.cxx
+++ b/desktop/source/app/lockfile2.cxx
@@ -38,22 +38,22 @@ bool Lockfile_execWarning( Lockfile * that )
OString aTime = aConfig.ReadKey( LOCKFILE_TIMEKEY );
// display warning and return response
- MessageDialog aBox(NULL, DesktopResId(STR_QUERY_USERDATALOCKED),
- VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ VclPtr<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 ));
- aBox.SetText( aTitle );
+ aBox->SetText( aTitle );
// insert values...
- OUString aMsgText = aBox.get_primary_text();
+ OUString aMsgText = aBox->get_primary_text();
aMsgText = aMsgText.replaceFirst(
"$u", OStringToOUString( aUser, RTL_TEXTENCODING_ASCII_US) );
aMsgText = aMsgText.replaceFirst(
"$h", OStringToOUString( aHost, RTL_TEXTENCODING_ASCII_US) );
aMsgText = aMsgText.replaceFirst(
"$t", OStringToOUString( aTime, RTL_TEXTENCODING_ASCII_US) );
- aBox.set_primary_text(aMsgText);
+ aBox->set_primary_text(aMsgText);
// do it
- return aBox.Execute( ) == RET_YES;
+ return aBox->Execute( ) == RET_YES;
}
}
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;
}
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index b4ab62a5a309..31a99d93b53a 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -472,10 +472,10 @@ Reference<XComponentContext> getUNO(
if ( ! InitVCL() )
throw RuntimeException( "Cannot initialize VCL!" );
{
- WarningBox warn(NULL, WB_OK | WB_DEF_OK, sMsg);
- warn.SetText(utl::ConfigManager::getProductName());
- warn.SetIcon(0);
- warn.Execute();
+ VclPtr<WarningBox> warn(new WarningBox(NULL, WB_OK | WB_DEF_OK, sMsg));
+ warn->SetText(utl::ConfigManager::getProductName());
+ warn->SetIcon(0);
+ warn->Execute();
}
DeInitVCL();
}