diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2023-08-20 20:41:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-21 09:22:24 +0200 |
commit | 84b12cd3ea96ee9b02365b5239f391af242f7303 (patch) | |
tree | e01007b35b318f08bb895e515b7c952d45a57564 /sd | |
parent | 73ec9c71689525ff14db219238083ff75028f8c8 (diff) |
remove pimpl in ButtonSet
Change-Id: I117b3b0002fb6151cc03245dcd3f892d6e211f0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155872
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/html/buttonset.cxx | 55 | ||||
-rw-r--r-- | sd/source/filter/html/buttonset.hxx | 11 |
2 files changed, 14 insertions, 52 deletions
diff --git a/sd/source/filter/html/buttonset.cxx b/sd/source/filter/html/buttonset.cxx index d79dfa38e69f..078485334ba1 100644 --- a/sd/source/filter/html/buttonset.cxx +++ b/sd/source/filter/html/buttonset.cxx @@ -22,7 +22,6 @@ #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/graphic/GraphicProvider.hpp> -#include <com/sun/star/graphic/XGraphicProvider.hpp> #include <com/sun/star/io/XStream.hpp> #include <o3tl/safeint.hxx> @@ -48,8 +47,6 @@ using namespace ::com::sun::star::io; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; -namespace { - class ButtonsImpl { public: @@ -65,8 +62,6 @@ private: Reference< XStorage > mxStorage; }; -} - ButtonsImpl::ButtonsImpl( const OUString& rURL ) { try @@ -139,25 +134,7 @@ bool ButtonsImpl::copyGraphic( const OUString& rName, const OUString& rPath ) return false; } -class ButtonSetImpl -{ -public: - ButtonSetImpl(); - - int getCount() const; - - bool getPreview( int nSet, const std::vector< OUString >& rButtons, Image& rImage ); - bool exportButton( int nSet, const OUString& rPath, const OUString& rName ); - - void scanForButtonSets( const OUString& rPath ); - - Reference< XGraphicProvider > const & getGraphicProvider(); - - std::vector< std::shared_ptr< ButtonsImpl > > maButtons; - Reference< XGraphicProvider > mxGraphicProvider; -}; - -ButtonSetImpl::ButtonSetImpl() +ButtonSet::ButtonSet() { static const char sSubPath[] = "/wizard/web/buttons" ; @@ -170,7 +147,7 @@ ButtonSetImpl::ButtonSetImpl() scanForButtonSets( sUserPath ); } -void ButtonSetImpl::scanForButtonSets( const OUString& rPath ) +void ButtonSet::scanForButtonSets( const OUString& rPath ) { osl::Directory aDirectory( rPath ); if( aDirectory.open() != osl::FileBase::E_None ) @@ -189,12 +166,12 @@ void ButtonSetImpl::scanForButtonSets( const OUString& rPath ) } } -int ButtonSetImpl::getCount() const +int ButtonSet::getCount() const { return maButtons.size(); } -bool ButtonSetImpl::getPreview( int nSet, const std::vector< OUString >& rButtons, Image& rImage ) +bool ButtonSet::getPreview( int nSet, const std::vector< OUString >& rButtons, Image& rImage ) { if( (nSet >= 0) && (o3tl::make_unsigned(nSet) < maButtons.size())) { @@ -242,7 +219,7 @@ bool ButtonSetImpl::getPreview( int nSet, const std::vector< OUString >& rButton return false; } -bool ButtonSetImpl::exportButton( int nSet, const OUString& rPath, const OUString& rName ) +bool ButtonSet::exportButton( int nSet, const OUString& rPath, const OUString& rName ) { if( (nSet >= 0) && (o3tl::make_unsigned(nSet) < maButtons.size())) { @@ -253,7 +230,7 @@ bool ButtonSetImpl::exportButton( int nSet, const OUString& rPath, const OUStrin return false; } -Reference< XGraphicProvider > const & ButtonSetImpl::getGraphicProvider() +Reference< XGraphicProvider > const & ButtonSet::getGraphicProvider() { if( !mxGraphicProvider.is() ) { @@ -263,28 +240,8 @@ Reference< XGraphicProvider > const & ButtonSetImpl::getGraphicProvider() return mxGraphicProvider; } -ButtonSet::ButtonSet() -: mpImpl( new ButtonSetImpl() ) -{ -} - ButtonSet::~ButtonSet() { } -int ButtonSet::getCount() const -{ - return mpImpl->getCount(); -} - -bool ButtonSet::getPreview( int nSet, const std::vector< OUString >& rButtons, Image& rImage ) -{ - return mpImpl->getPreview( nSet, rButtons, rImage ); -} - -bool ButtonSet::exportButton( int nSet, const OUString& rPath, const OUString& rName ) -{ - return mpImpl->exportButton( nSet, rPath, rName ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/filter/html/buttonset.hxx b/sd/source/filter/html/buttonset.hxx index 4289c10e9805..9891496a05c2 100644 --- a/sd/source/filter/html/buttonset.hxx +++ b/sd/source/filter/html/buttonset.hxx @@ -20,13 +20,13 @@ #pragma once #include <sddllapi.h> - +#include <com/sun/star/graphic/XGraphicProvider.hpp> #include <rtl/ustring.hxx> #include <vector> #include <memory> class Image; -class ButtonSetImpl; +class ButtonsImpl; class SD_DLLPUBLIC ButtonSet { @@ -40,7 +40,12 @@ public: bool exportButton(int nSet, const OUString& rPath, const OUString& rName); private: - std::unique_ptr<ButtonSetImpl> mpImpl; + void scanForButtonSets(const OUString& rPath); + + css::uno::Reference<css::graphic::XGraphicProvider> const& getGraphicProvider(); + + std::vector<std::shared_ptr<ButtonsImpl>> maButtons; + css::uno::Reference<css::graphic::XGraphicProvider> mxGraphicProvider; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |