Kaydet (Commit) 01ef2044 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

loplugin:unnecessarysuperclass, merge ImageProvider with SaveInData

Change-Id: Ib538cc10728b2dc97e173d865807754471860e0f
Reviewed-on: https://gerrit.libreoffice.org/15900Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst b4b48e0f
...@@ -2589,8 +2589,7 @@ IMPL_LINK( SvxMenuConfigPage, AddCommandsHdl, Button *, pButton ) ...@@ -2589,8 +2589,7 @@ IMPL_LINK( SvxMenuConfigPage, AddCommandsHdl, Button *, pButton )
// beside the menu contents list and does not obscure it // beside the menu contents list and does not obscure it
m_pSelectorDlg->SetPosPixel( m_pAddCommandsButton->GetPosPixel() ); m_pSelectorDlg->SetPosPixel( m_pAddCommandsButton->GetPosPixel() );
m_pSelectorDlg->SetImageProvider( m_pSelectorDlg->SetImageProvider( GetSaveInData() );
static_cast< ImageProvider* >( GetSaveInData() ) );
m_pSelectorDlg->Show(); m_pSelectorDlg->Show();
return 1; return 1;
...@@ -4503,8 +4502,7 @@ IMPL_LINK( SvxToolbarConfigPage, AddCommandsHdl, Button *, pButton ) ...@@ -4503,8 +4502,7 @@ IMPL_LINK( SvxToolbarConfigPage, AddCommandsHdl, Button *, pButton )
LINK( this, SvxToolbarConfigPage, AddFunctionHdl ) ); LINK( this, SvxToolbarConfigPage, AddFunctionHdl ) );
} }
m_pSelectorDlg->SetImageProvider( m_pSelectorDlg->SetImageProvider( GetSaveInData() );
static_cast< ImageProvider* >( GetSaveInData() ) );
m_pSelectorDlg->Show(); m_pSelectorDlg->Show();
return 1; return 1;
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <vcl/vclmedit.hxx> #include <vcl/vclmedit.hxx>
#include <vcl/builderfactory.hxx> #include <vcl/builderfactory.hxx>
#include "selector.hxx" #include "selector.hxx"
#include "cfg.hxx"
#include <dialmgr.hxx> #include <dialmgr.hxx>
#include <svx/fmresids.hrc> #include <svx/fmresids.hrc>
#include <svx/dialmgr.hxx> #include <svx/dialmgr.hxx>
......
...@@ -70,7 +70,7 @@ public: ...@@ -70,7 +70,7 @@ public:
void SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame); void SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame);
}; };
class SaveInData : public ImageProvider class SaveInData
{ {
private: private:
...@@ -138,7 +138,7 @@ public: ...@@ -138,7 +138,7 @@ public:
com::sun::star::uno::Sequence com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue > m_aSeparatorSeq; < 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 HasURL( const OUString& aURL ) = 0;
virtual bool HasSettings() = 0; virtual bool HasSettings() = 0;
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#include <boost/ptr_container/ptr_vector.hpp> #include <boost/ptr_container/ptr_vector.hpp>
class SaveInData;
#define SVX_CFGGROUP_FUNCTION 1 #define SVX_CFGGROUP_FUNCTION 1
#define SVX_CFGFUNCTION_SLOT 2 #define SVX_CFGFUNCTION_SLOT 2
#define SVX_CFGGROUP_SCRIPTCONTAINER 3 #define SVX_CFGGROUP_SCRIPTCONTAINER 3
...@@ -80,14 +82,6 @@ struct SvxGroupInfo_Impl ...@@ -80,14 +82,6 @@ struct SvxGroupInfo_Impl
typedef boost::ptr_vector<SvxGroupInfo_Impl> SvxGroupInfoArr_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 class SvxConfigFunctionListBox : public SvTreeListBox
{ {
friend class SvxConfigGroupListBox; friend class SvxConfigGroupListBox;
...@@ -124,7 +118,7 @@ class SvxConfigGroupListBox : public SvTreeListBox ...@@ -124,7 +118,7 @@ class SvxConfigGroupListBox : public SvTreeListBox
bool m_bShowSlots; bool m_bShowSlots;
VclPtr<SvxConfigFunctionListBox> pFunctionListBox; VclPtr<SvxConfigFunctionListBox> pFunctionListBox;
ImageProvider* m_pImageProvider; SaveInData* m_pImageProvider;
::com::sun::star::uno::Reference ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame > m_xFrame; < ::com::sun::star::frame::XFrame > m_xFrame;
...@@ -175,7 +169,7 @@ public: ...@@ -175,7 +169,7 @@ public:
void SetFunctionListBox( SvxConfigFunctionListBox *pBox ) void SetFunctionListBox( SvxConfigFunctionListBox *pBox )
{ pFunctionListBox = pBox; } { pFunctionListBox = pBox; }
void SetImageProvider( ImageProvider* provider ) void SetImageProvider( SaveInData* provider )
{ m_pImageProvider = provider; } { m_pImageProvider = provider; }
}; };
...@@ -211,7 +205,7 @@ public: ...@@ -211,7 +205,7 @@ public:
void SetAddHdl( const Link<>& rLink ) { m_aAddHdl = rLink; } void SetAddHdl( const Link<>& rLink ) { m_aAddHdl = rLink; }
const Link<>& GetAddHdl() const { return m_aAddHdl; } const Link<>& GetAddHdl() const { return m_aAddHdl; }
void SetImageProvider(ImageProvider* provider) void SetImageProvider(SaveInData* provider)
{ {
m_pCategories->SetImageProvider(provider); m_pCategories->SetImageProvider(provider);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment