diff options
-rw-r--r-- | svx/source/inc/unogalthemeprovider.hxx | 19 | ||||
-rw-r--r-- | svx/source/unodraw/unoctabl.cxx | 8 | ||||
-rw-r--r-- | svx/source/unogallery/unogalthemeprovider.cxx | 79 | ||||
-rw-r--r-- | svx/util/svx.component | 3 |
4 files changed, 28 insertions, 81 deletions
diff --git a/svx/source/inc/unogalthemeprovider.hxx b/svx/source/inc/unogalthemeprovider.hxx index 8d1cd680c08f..84980ab408c7 100644 --- a/svx/source/inc/unogalthemeprovider.hxx +++ b/svx/source/inc/unogalthemeprovider.hxx @@ -25,23 +25,9 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/gallery/XGalleryThemeProvider.hpp> -#include <svx/svxdllapi.h> - class Gallery; -namespace unogallery { - -// ------------------------- -// - some helper functions - -// ------------------------- - -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GalleryThemeProvider_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception ); - ::com::sun::star::uno::Sequence< OUString > SAL_CALL GalleryThemeProvider_getSupportedServiceNames() throw(); -OUString SAL_CALL GalleryThemeProvider_getImplementationName() throw(); - -// ----------------- -// - GalleryThemes - -// ----------------- +namespace { class GalleryThemeProvider : public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XInitialization, ::com::sun::star::gallery::XGalleryThemeProvider > @@ -51,9 +37,6 @@ public: GalleryThemeProvider(); ~GalleryThemeProvider(); - SVX_DLLPUBLIC static OUString getImplementationName_Static() throw(); - SVX_DLLPUBLIC static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(); - protected: // XServiceInfo diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx index 56aee061476e..8f990b7c9268 100644 --- a/svx/source/unodraw/unoctabl.cxx +++ b/svx/source/unodraw/unoctabl.cxx @@ -223,7 +223,6 @@ uno::Reference< uno::XInterface > SAL_CALL create_EnhancedCustomShapeEngine( con // #include "UnoGraphicExporter.hxx" -#include "unogalthemeprovider.hxx" #include <com/sun/star/registry/XRegistryKey.hpp> #include "sal/types.h" #include "osl/diagnose.h" @@ -331,13 +330,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svx_component_getFactory ( svx::FindbarDispatcher_createInstance, svx::FindbarDispatcher::getSupportedServiceNames_Static() ); } - else if( ::unogallery::GalleryThemeProvider_getImplementationName().equalsAscii( pImplName ) ) - { - xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - ::unogallery::GalleryThemeProvider_getImplementationName(), - ::unogallery::GalleryThemeProvider_createInstance, - ::unogallery::GalleryThemeProvider_getSupportedServiceNames() ); - } if( xFactory.is()) { diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx index e5ad2d89002a..71b0736f6491 100644 --- a/svx/source/unogallery/unogalthemeprovider.cxx +++ b/svx/source/unogallery/unogalthemeprovider.cxx @@ -30,38 +30,7 @@ using namespace ::com::sun::star; -namespace unogallery { - -// -------------------- -// - Helper functions - -// -------------------- - -uno::Reference< uno::XInterface > SAL_CALL GalleryThemeProvider_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & ) - throw( uno::Exception ) -{ - return *( new GalleryThemeProvider() ); -} - -// ----------------------------------------------------------------------------- - -uno::Sequence< OUString > SAL_CALL GalleryThemeProvider_getSupportedServiceNames() - throw() -{ - return GalleryThemeProvider::getSupportedServiceNames_Static(); -} - -// ----------------------------------------------------------------------------- - -OUString SAL_CALL GalleryThemeProvider_getImplementationName() - throw() -{ - return GalleryThemeProvider::getImplementationName_Static(); -} - -// ----------------- -// - GalleryThemeProvider - -// ----------------- +namespace { GalleryThemeProvider::GalleryThemeProvider() : mbHiddenThemes( sal_False ) @@ -77,30 +46,10 @@ GalleryThemeProvider::~GalleryThemeProvider() // ------------------------------------------------------------------------------ -SVX_DLLPUBLIC OUString GalleryThemeProvider::getImplementationName_Static() - throw() -{ - return OUString( "com.sun.star.comp.gallery.GalleryThemeProvider" ); -} - -// ------------------------------------------------------------------------------ - -SVX_DLLPUBLIC uno::Sequence< OUString > GalleryThemeProvider::getSupportedServiceNames_Static() - throw() -{ - uno::Sequence< OUString > aSeq( 1 ); - - aSeq.getArray()[ 0 ] = "com.sun.star.gallery.GalleryThemeProvider"; - - return aSeq; -} - -// ------------------------------------------------------------------------------ - OUString SAL_CALL GalleryThemeProvider::getImplementationName() throw( uno::RuntimeException ) { - return getImplementationName_Static(); + return OUString( "com.sun.star.comp.gallery.GalleryThemeProvider" ); } // ------------------------------------------------------------------------------ @@ -123,7 +72,9 @@ sal_Bool SAL_CALL GalleryThemeProvider::supportsService( const OUString& Service uno::Sequence< OUString > SAL_CALL GalleryThemeProvider::getSupportedServiceNames() throw( uno::RuntimeException ) { - return getSupportedServiceNames_Static(); + uno::Sequence< OUString > aSeq( 1 ); + aSeq.getArray()[ 0 ] = "com.sun.star.gallery.GalleryThemeProvider"; + return aSeq; } // ------------------------------------------------------------------------------ @@ -297,4 +248,24 @@ void SAL_CALL GalleryThemeProvider::removeByName( const OUString& rName ) } +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_gallery_GalleryThemeProvider_implementation_getFactory( + SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + uno_Sequence * arguments) +{ + assert(arguments != 0); + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new GalleryThemeProvider)); + x->acquire(); + css::uno::Reference< css::lang::XInitialization > xx(x, css::uno::UNO_QUERY); + if (xx.is()) + { + css::uno::Sequence<css::uno::Any> aArgs( + reinterpret_cast<css::uno::Any *>(arguments->elements), + arguments->nElements); + xx->initialize(aArgs); + } + return x.get(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/util/svx.component b/svx/util/svx.component index 0e985a7c5f63..fbc4eed0df6f 100644 --- a/svx/util/svx.component +++ b/svx/util/svx.component @@ -22,7 +22,8 @@ <implementation name="com.sun.star.comp.Draw.GraphicExporter"> <service name="com.sun.star.drawing.GraphicExportFilter"/> </implementation> - <implementation name="com.sun.star.comp.gallery.GalleryThemeProvider"> + <implementation name="com.sun.star.comp.gallery.GalleryThemeProvider" + constructor="com_sun_star_comp_gallery_GalleryThemeProvider_implementation_getFactory"> <service name="com.sun.star.gallery.GalleryThemeProvider"/> </implementation> <implementation name="com.sun.star.comp.svx.Impl.FindbarDispatcher"> |