[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - 2 commits - desktop/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 13 20:17:12 UTC 2019


 desktop/source/deployment/gui/dp_gui_dialog2.cxx      |   12 +++---
 desktop/source/deployment/gui/dp_gui_extlistbox.cxx   |    4 +-
 desktop/source/deployment/gui/dp_gui_extlistbox.hxx   |   31 ++++--------------
 desktop/source/deployment/gui/dp_gui_updatedialog.cxx |   11 ------
 4 files changed, 16 insertions(+), 42 deletions(-)

New commits:
commit f3dc36beb9fb8b6b9875fd4567fad8a2d52fbe76
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jun 13 11:28:49 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jun 13 22:16:47 2019 +0200

    no need for awt::Toolkit::create in UpdateDialog
    
    since...
    
    commit bb3daa7351f0b07e6f4331c19837081e6c3e30b8
    Author: Frank Schoenheit [fs] <frank.schoenheit at sun.com>
    Date:   Thu Oct 7 13:54:14 2010 +0200
    
        dba34b: #i112779# no need to use a UNO control/peer for the throbber - it exists as VCL control now
    
    Change-Id: I561642d78d76ab970ee12b6b2b2fbdd0be2850e5
    Reviewed-on: https://gerrit.libreoffice.org/73955
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index cfcf3e300106..def6a263fdb3 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -32,7 +32,6 @@
 #include <com/sun/star/awt/WindowAttribute.hpp>
 #include <com/sun/star/awt/WindowClass.hpp>
 #include <com/sun/star/awt/WindowDescriptor.hpp>
-#include <com/sun/star/awt/Toolkit.hpp>
 #include <com/sun/star/awt/XWindow.hpp>
 #include <com/sun/star/awt/XWindowPeer.hpp>
 #include <com/sun/star/beans/NamedValue.hpp>
@@ -504,16 +503,6 @@ UpdateDialog::UpdateDialog(
 
     m_xExtensionManager = deployment::ExtensionManager::get( context );
 
-    uno::Reference< awt::XToolkit2 > toolkit;
-    try {
-        toolkit = awt::Toolkit::create(m_context);
-    } catch (const uno::RuntimeException &) {
-        throw;
-    } catch (const uno::Exception & e) {
-        css::uno::Any anyEx = cppu::getCaughtException();
-        throw css::lang::WrappedTargetRuntimeException( e.Message,
-                        e.Context, anyEx );
-    }
     m_xUpdates->connect_changed(LINK(this, UpdateDialog, selectionHandler));
     m_xUpdates->connect_toggled(LINK(this, UpdateDialog, entryToggled));
     m_xAll->connect_toggled(LINK(this, UpdateDialog, allHandler));
commit 68034f4f4f4187ba66adf8f5ea8064643671f324
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jun 12 13:52:32 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jun 13 22:16:33 2019 +0200

    drop intermediate IExtensionListBox class
    
    Change-Id: I415645fd61113577deef404cceb02d72d541291d
    Reviewed-on: https://gerrit.libreoffice.org/73974
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index cff9f7b5feb0..778b141ee671 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -172,7 +172,7 @@ void ExtBoxWithBtns_Impl::RecalcAll()
 {
     const sal_Int32 nActive = getSelIndex();
 
-    if ( nActive != IExtensionListBox::ENTRY_NOTFOUND )
+    if ( nActive != ExtensionBox_Impl::ENTRY_NOTFOUND )
     {
         SetButtonStatus( GetEntryData( nActive) );
     }
@@ -309,7 +309,7 @@ void ExtBoxWithBtns_Impl::MouseButtonDown( const MouseEvent& rMEvt )
     {
         const SolarMutexGuard aGuard;
         if ( rMEvt.IsMod1() && HasActive() )
-            selectEntry( IExtensionListBox::ENTRY_NOTFOUND );
+            selectEntry( ExtensionBox_Impl::ENTRY_NOTFOUND );
                 // selecting a not existing entry will deselect the current one
         else
             selectEntry( nPos );
@@ -323,7 +323,7 @@ void ExtBoxWithBtns_Impl::enableButtons( bool bEnable )
     if ( bEnable )
     {
         sal_Int32 nIndex = getSelIndex();
-        if ( nIndex != IExtensionListBox::ENTRY_NOTFOUND )
+        if ( nIndex != ExtensionBox_Impl::ENTRY_NOTFOUND )
             SetButtonStatus( GetEntryData( nIndex ) );
     }
     else
@@ -910,7 +910,7 @@ IMPL_LINK_NOARG(ExtMgrDialog, HandleOptionsBtn, Button*, void)
 {
     const sal_Int32 nActive = m_pExtensionBox->getSelIndex();
 
-    if ( nActive != IExtensionListBox::ENTRY_NOTFOUND )
+    if ( nActive != ExtensionBox_Impl::ENTRY_NOTFOUND )
     {
         SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
 
@@ -939,7 +939,7 @@ IMPL_LINK_NOARG(ExtMgrDialog, HandleRemoveBtn, Button*, void)
 {
     const sal_Int32 nActive = m_pExtensionBox->getSelIndex();
 
-    if ( nActive != IExtensionListBox::ENTRY_NOTFOUND )
+    if ( nActive != ExtensionBox_Impl::ENTRY_NOTFOUND )
     {
         TEntry_Impl pEntry = m_pExtensionBox->GetEntryData( nActive );
         removePackage( pEntry->m_xPackage );
@@ -950,7 +950,7 @@ IMPL_LINK_NOARG(ExtMgrDialog, HandleEnableBtn, Button*, void)
 {
     const sal_Int32 nActive = m_pExtensionBox->getSelIndex();
 
-    if ( nActive != IExtensionListBox::ENTRY_NOTFOUND )
+    if ( nActive != ExtensionBox_Impl::ENTRY_NOTFOUND )
     {
         TEntry_Impl pEntry = m_pExtensionBox->GetEntryData( nActive );
 
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 94fb3069d7f3..9d987b18bfce 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -176,7 +176,7 @@ ExtensionRemovedListener::~ExtensionRemovedListener()
 
 // ExtensionBox_Impl
 ExtensionBox_Impl::ExtensionBox_Impl(vcl::Window* pParent) :
-    IExtensionListBox( pParent ),
+    Control( pParent, WB_BORDER | WB_TABSTOP ),
     m_bHasScrollBar( false ),
     m_bHasActive( false ),
     m_bNeedsRecalc( true ),
@@ -260,7 +260,7 @@ void ExtensionBox_Impl::dispose()
 
     m_pLocale.reset();
     m_pCollator.reset();
-    IExtensionListBox::dispose();
+    Control::dispose();
 }
 
 
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
index 90282c1142be..79397f30ddbb 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
@@ -103,27 +103,7 @@ public:
     virtual void SAL_CALL disposing(css::lang::EventObject const& evt) override;
 };
 
-/** This abstract class provides methods to implement an extension list box.
-    This header is needed for the automatic test tool
-*/
-class IExtensionListBox: public Control
-{
-public:
-    enum { ENTRY_NOTFOUND = -1 };
-
-    IExtensionListBox( vcl::Window* pParent ): Control( pParent, WB_BORDER | WB_TABSTOP ){}
-
-    /** @return  The count of the entries in the list box. */
-    virtual sal_Int32 getItemCount() const = 0;
-
-    /** @return  The index of the first selected entry in the list box.
-        When nothing is selected, which is the case when getItemCount returns '0',
-        then this function returns ENTRY_NOTFOUND */
-    virtual sal_Int32 getSelIndex() const = 0;
-
-};
-
-class ExtensionBox_Impl : public IExtensionListBox
+class ExtensionBox_Impl : public Control
 {
     bool m_bHasScrollBar : 1;
     bool m_bHasActive : 1;
@@ -213,14 +193,19 @@ public:
     void setExtensionManager(TheExtensionManager* pManager) { m_pManager = pManager; }
 
     //These functions are used for automatic testing
+public:
+    enum { ENTRY_NOTFOUND = -1 };
 
     /** @return  The count of the entries in the list box. */
-    virtual sal_Int32 getItemCount() const override;
+    virtual sal_Int32 getItemCount() const;
 
     /** @return  The index of the first selected entry in the list box.
         When nothing is selected, which is the case when getItemCount returns '0',
         then this function returns ENTRY_NOTFOUND */
-    virtual sal_Int32 getSelIndex() const override;
+    /** @return  The index of the first selected entry in the list box.
+        When nothing is selected, which is the case when getItemCount returns '0',
+        then this function returns ENTRY_NOTFOUND */
+    virtual sal_Int32 getSelIndex() const;
 };
 
 }


More information about the Libreoffice-commits mailing list