[Libreoffice-commits] core.git: Branch 'feature/vclptr' - desktop/source

Michael Meeks michael.meeks at collabora.com
Fri Apr 17 03:19:52 PDT 2015


 desktop/source/deployment/gui/dp_gui_dialog2.cxx           |    6 +++---
 desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx |    8 +++-----
 desktop/source/deployment/gui/dp_gui_extlistbox.cxx        |    4 ++--
 desktop/source/deployment/gui/dp_gui_service.cxx           |    5 ++---
 desktop/source/deployment/gui/dp_gui_theextmgr.cxx         |    4 ++--
 desktop/source/deployment/gui/dp_gui_updatedialog.cxx      |    2 +-
 desktop/source/deployment/gui/license_dialog.cxx           |    3 ++-
 desktop/source/splash/splash.cxx                           |    2 +-
 8 files changed, 16 insertions(+), 18 deletions(-)

New commits:
commit 0703fc22519b391cece54f9d67012cffd9867765
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Apr 17 11:22:09 2015 +0100

    desktop: convert new to ::Create.
    
    Change-Id: I114ab23302970ce0abe551ffd693e92b0f4ae8c5

diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 1313475..63d0986 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -166,9 +166,9 @@ void ExtBoxWithBtns_Impl::InitFromDialog(ExtMgrDialog *pParentDialog)
 
     m_pParent = pParentDialog;
 
-    m_pOptionsBtn = new PushButton( this, WB_TABSTOP );
-    m_pEnableBtn = new PushButton( this, WB_TABSTOP );
-    m_pRemoveBtn = new PushButton( this, WB_TABSTOP );
+    m_pOptionsBtn = VclPtr<PushButton>::Create( this, WB_TABSTOP );
+    m_pEnableBtn = VclPtr<PushButton>::Create( this, WB_TABSTOP );
+    m_pRemoveBtn = VclPtr<PushButton>::Create( this, WB_TABSTOP );
 
     SetHelpId( HID_EXTENSION_MANAGER_LISTBOX );
     m_pOptionsBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_OPTIONS );
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index 1b2136d..29d3c90 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -814,7 +814,7 @@ void ExtensionCmdQueue::Thread::execute()
 
                 const SolarMutexGuard guard;
                 ScopedVclPtr<MessageDialog> box(
-                    new MessageDialog(currentCmdEnv->activeDialog(), msg));
+                    VclPtr<MessageDialog>::Create(currentCmdEnv->activeDialog(), msg));
                 if ( m_pDialogHelper )
                     box->SetText( m_pDialogHelper->getWindow()->GetText() );
                 box->Execute();
@@ -923,12 +923,10 @@ void ExtensionCmdQueue::Thread::_removeExtension( ::rtl::Reference< ProgressCmdE
 void ExtensionCmdQueue::Thread::_checkForUpdates(
     const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList )
 {
-    ScopedVclPtr<UpdateDialog> pUpdateDialog;
-    std::vector< UpdateData > vData;
-
     const SolarMutexGuard guard;
 
-    pUpdateDialog = new UpdateDialog( m_xContext, m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, vExtensionList, &vData );
+    std::vector< UpdateData > vData;
+    ScopedVclPtrInstance<UpdateDialog> pUpdateDialog( m_xContext, m_pDialogHelper? m_pDialogHelper->getWindow() : nullptr, vExtensionList, &vData );
 
     pUpdateDialog->notifyMenubar( true, false ); // prepare the checking, if there updates to be notified via menu bar icon
 
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 6eef818..50d5156 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -201,7 +201,7 @@ void ExtensionBox_Impl::Init()
 {
     SetHelpId( HID_EXTENSION_MANAGER_LISTBOX );
 
-    m_pScrollBar = new ScrollBar( this, WB_VERT );
+    m_pScrollBar = VclPtr<ScrollBar>::Create( this, WB_VERT );
     m_pScrollBar->SetScrollHdl( LINK( this, ExtensionBox_Impl, ScrollHdl ) );
     m_pScrollBar->EnableDrag();
 
@@ -544,7 +544,7 @@ void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl& rEnt
     // Init publisher link here
     if ( !rEntry->m_pPublisher && !rEntry->m_sPublisher.isEmpty() )
     {
-        rEntry->m_pPublisher = new FixedHyperlink( this );
+        rEntry->m_pPublisher = VclPtr<FixedHyperlink>::Create( this );
         rEntry->m_pPublisher->SetBackground();
         rEntry->m_pPublisher->SetPaintTransparent( true );
         rEntry->m_pPublisher->SetURL( rEntry->m_sPublisherURL );
diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx
index badb58f..f07042d 100644
--- a/desktop/source/deployment/gui/dp_gui_service.cxx
+++ b/desktop/source/deployment/gui/dp_gui_service.cxx
@@ -223,9 +223,8 @@ void ServiceImpl::startExecuteModal(
         catch (const Exception & exc) {
             if (bAppUp) {
                 const SolarMutexGuard guard;
-                VclPtr<MessageDialog> box(
-                    new MessageDialog(Application::GetActiveTopWindow(),
-                                      exc.Message));
+                ScopedVclPtrInstance<MessageDialog> box(
+                        Application::GetActiveTopWindow(), exc.Message);
                 box->Execute();
             }
             throw;
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index 53b5380..3980a23 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -112,7 +112,7 @@ void TheExtensionManager::createDialog( const bool bCreateUpdDlg )
     {
         if ( !m_pUpdReqDialog )
         {
-            m_pUpdReqDialog = new UpdateRequiredDialog( NULL, this );
+            m_pUpdReqDialog = VclPtr<UpdateRequiredDialog>::Create( nullptr, this );
             delete m_pExecuteCmdQueue;
             m_pExecuteCmdQueue = new ExtensionCmdQueue( (DialogHelper*) m_pUpdReqDialog, this, m_xContext );
             createPackageList();
@@ -120,7 +120,7 @@ void TheExtensionManager::createDialog( const bool bCreateUpdDlg )
     }
     else if ( !m_pExtMgrDialog )
     {
-        m_pExtMgrDialog = new ExtMgrDialog( m_pParent, this );
+        m_pExtMgrDialog = VclPtr<ExtMgrDialog>::Create( m_pParent, this );
         delete m_pExecuteCmdQueue;
         m_pExecuteCmdQueue = new ExtensionCmdQueue( (DialogHelper*) m_pExtMgrDialog, this, m_xContext );
         m_pExtMgrDialog->setGetExtensionsURL( m_sGetExtensionsURL );
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index a7372e2..8e75bd0 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -520,7 +520,7 @@ UpdateDialog::UpdateDialog(
     get(m_pthrobber, "THROBBER");
     get(m_pUpdate, "UPDATE_LABEL");
     get(m_pContainer, "UPDATES_CONTAINER");
-    m_pUpdates = new UpdateDialog::CheckListBox(m_pContainer, *this);
+    m_pUpdates = VclPtr<UpdateDialog::CheckListBox>::Create(m_pContainer, *this);
     Size aSize(LogicToPixel(Size(240, 51), MAP_APPFONT));
     m_pUpdates->set_width_request(aSize.Width());
     m_pUpdates->set_height_request(aSize.Height());
diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx
index 2054b44..710052f 100644
--- a/desktop/source/deployment/gui/license_dialog.cxx
+++ b/desktop/source/deployment/gui/license_dialog.cxx
@@ -330,7 +330,8 @@ sal_Int16 LicenseDialog::execute() throw (RuntimeException, std::exception)
 sal_Int16 LicenseDialog::solar_execute()
 {
     VclPtr<LicenseDialogImpl> dlg(
-        new LicenseDialogImpl(
+        VclPtr<LicenseDialogImpl>::Create(
+
             VCLUnoHelper::GetWindow(m_parent),
             m_xComponentContext, m_sExtensionName, m_sLicenseText));
 
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index ae80ddc..1e858ca 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.cxx
@@ -131,7 +131,7 @@ public:
 SplashScreenWindow::SplashScreenWindow(SplashScreen *pSplash)
     : IntroWindow()
     , pSpl( pSplash )
-    , _vdev(new VirtualDevice(*this))
+    , _vdev(VclPtr<VirtualDevice>::Create(*this))
 {
     _vdev->EnableRTL(IsRTLEnabled());
 }


More information about the Libreoffice-commits mailing list