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

Noel Grandin noel at peralex.com
Mon May 25 23:47:39 PDT 2015


 cui/source/customize/cfg.cxx      |    6 ++----
 cui/source/customize/selector.cxx |    1 +
 cui/source/inc/cfg.hxx            |    4 ++--
 cui/source/inc/selector.hxx       |   16 +++++-----------
 4 files changed, 10 insertions(+), 17 deletions(-)

New commits:
commit 01ef2044d0b2c3429eca71de6afef0241e0196f3
Author: Noel Grandin <noel at peralex.com>
Date:   Mon May 25 15:19:52 2015 +0200

    loplugin:unnecessarysuperclass, merge ImageProvider with SaveInData
    
    Change-Id: Ib538cc10728b2dc97e173d865807754471860e0f
    Reviewed-on: https://gerrit.libreoffice.org/15900
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 7eadd5a..36f3997 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2589,8 +2589,7 @@ IMPL_LINK( SvxMenuConfigPage, AddCommandsHdl, Button *, pButton )
     // beside the menu contents list and does not obscure it
     m_pSelectorDlg->SetPosPixel( m_pAddCommandsButton->GetPosPixel() );
 
-    m_pSelectorDlg->SetImageProvider(
-        static_cast< ImageProvider* >( GetSaveInData() ) );
+    m_pSelectorDlg->SetImageProvider( GetSaveInData() );
 
     m_pSelectorDlg->Show();
     return 1;
@@ -4503,8 +4502,7 @@ IMPL_LINK( SvxToolbarConfigPage, AddCommandsHdl, Button *, pButton )
             LINK( this, SvxToolbarConfigPage, AddFunctionHdl ) );
     }
 
-    m_pSelectorDlg->SetImageProvider(
-        static_cast< ImageProvider* >( GetSaveInData() ) );
+    m_pSelectorDlg->SetImageProvider( GetSaveInData() );
 
     m_pSelectorDlg->Show();
     return 1;
diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx
index 781ddbf..99b17e2 100644
--- a/cui/source/customize/selector.cxx
+++ b/cui/source/customize/selector.cxx
@@ -23,6 +23,7 @@
 #include <vcl/vclmedit.hxx>
 #include <vcl/builderfactory.hxx>
 #include "selector.hxx"
+#include "cfg.hxx"
 #include <dialmgr.hxx>
 #include <svx/fmresids.hrc>
 #include <svx/dialmgr.hxx>
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index 73b0514..4cb324e 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -70,7 +70,7 @@ public:
     void SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame);
 };
 
-class SaveInData : public ImageProvider
+class SaveInData
 {
 private:
 
@@ -138,7 +138,7 @@ public:
     com::sun::star::uno::Sequence
         < com::sun::star::beans::PropertyValue > m_aSeparatorSeq;
 
-    Image GetImage( const OUString& rCommandURL ) SAL_OVERRIDE;
+    Image GetImage( const OUString& rCommandURL );
 
     virtual bool HasURL( const OUString& aURL ) = 0;
     virtual bool HasSettings() = 0;
diff --git a/cui/source/inc/selector.hxx b/cui/source/inc/selector.hxx
index 898314d..6d0e7da 100644
--- a/cui/source/inc/selector.hxx
+++ b/cui/source/inc/selector.hxx
@@ -32,6 +32,8 @@
 
 #include <boost/ptr_container/ptr_vector.hpp>
 
+class SaveInData;
+
 #define SVX_CFGGROUP_FUNCTION 1
 #define SVX_CFGFUNCTION_SLOT  2
 #define SVX_CFGGROUP_SCRIPTCONTAINER  3
@@ -80,14 +82,6 @@ struct SvxGroupInfo_Impl
 
 typedef boost::ptr_vector<SvxGroupInfo_Impl> SvxGroupInfoArr_Impl;
 
-class ImageProvider
-{
-public:
-    virtual ~ImageProvider() {}
-
-    virtual Image GetImage( const OUString& rCommandURL ) = 0;
-};
-
 class SvxConfigFunctionListBox : public SvTreeListBox
 {
 friend class SvxConfigGroupListBox;
@@ -124,7 +118,7 @@ class SvxConfigGroupListBox : public SvTreeListBox
     bool                            m_bShowSlots;
 
     VclPtr<SvxConfigFunctionListBox>  pFunctionListBox;
-    ImageProvider*                  m_pImageProvider;
+    SaveInData*                     m_pImageProvider;
 
     ::com::sun::star::uno::Reference
         < ::com::sun::star::frame::XFrame > m_xFrame;
@@ -175,7 +169,7 @@ public:
     void    SetFunctionListBox( SvxConfigFunctionListBox *pBox )
         { pFunctionListBox = pBox; }
 
-    void    SetImageProvider( ImageProvider* provider )
+    void    SetImageProvider( SaveInData* provider )
         { m_pImageProvider = provider; }
 };
 
@@ -211,7 +205,7 @@ public:
     void        SetAddHdl( const Link<>& rLink ) { m_aAddHdl = rLink; }
     const Link<>& GetAddHdl() const { return m_aAddHdl; }
 
-    void        SetImageProvider(ImageProvider* provider)
+    void        SetImageProvider(SaveInData* provider)
     {
         m_pCategories->SetImageProvider(provider);
     }


More information about the Libreoffice-commits mailing list