[Libreoffice-commits] core.git: desktop/source

Caolán McNamara caolanm at redhat.com
Wed Apr 29 02:47:33 PDT 2015


 desktop/source/deployment/gui/dp_gui_theextmgr.cxx |    4 ++--
 desktop/source/deployment/gui/dp_gui_theextmgr.hxx |   14 ++++++++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 501b1f5c77bf0b5409048470262bd99b818e7720
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 29 10:19:25 2015 +0100

    fix dubious casts post VclPtr-ing
    
    Change-Id: I6269eacb7ed1eb5ebd03a9a1b549a3e25e5f00c3

diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index 3980a23..3cad803 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -114,7 +114,7 @@ void TheExtensionManager::createDialog( const bool bCreateUpdDlg )
         {
             m_pUpdReqDialog = VclPtr<UpdateRequiredDialog>::Create( nullptr, this );
             delete m_pExecuteCmdQueue;
-            m_pExecuteCmdQueue = new ExtensionCmdQueue( (DialogHelper*) m_pUpdReqDialog, this, m_xContext );
+            m_pExecuteCmdQueue = new ExtensionCmdQueue( m_pUpdReqDialog.get(), this, m_xContext );
             createPackageList();
         }
     }
@@ -122,7 +122,7 @@ void TheExtensionManager::createDialog( const bool bCreateUpdDlg )
     {
         m_pExtMgrDialog = VclPtr<ExtMgrDialog>::Create( m_pParent, this );
         delete m_pExecuteCmdQueue;
-        m_pExecuteCmdQueue = new ExtensionCmdQueue( (DialogHelper*) m_pExtMgrDialog, this, m_xContext );
+        m_pExecuteCmdQueue = new ExtensionCmdQueue( m_pExtMgrDialog.get(), this, m_xContext );
         m_pExtMgrDialog->setGetExtensionsURL( m_sGetExtensionsURL );
         createPackageList();
     }
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
index 9281dde..39d41b2 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
@@ -70,8 +70,18 @@ public:
     void createDialog( const bool bCreateUpdDlg );
     sal_Int16 execute();
 
-    Dialog* getDialog() { return m_pExtMgrDialog ? (Dialog*) m_pExtMgrDialog : (Dialog*) m_pUpdReqDialog; }
-    DialogHelper* getDialogHelper() { return m_pExtMgrDialog ? (DialogHelper*) m_pExtMgrDialog : (DialogHelper*) m_pUpdReqDialog; }
+    Dialog* getDialog()
+    {
+        if (m_pExtMgrDialog)
+            return m_pExtMgrDialog.get();
+        return m_pUpdReqDialog.get();
+    }
+    DialogHelper* getDialogHelper()
+    {
+        if (m_pExtMgrDialog)
+            return m_pExtMgrDialog.get();
+        return m_pUpdReqDialog.get();
+    }
     ExtensionCmdQueue* getCmdQueue() const { return m_pExecuteCmdQueue; }
 
     void SetText( const OUString &rTitle );


More information about the Libreoffice-commits mailing list