diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2013-12-30 10:38:29 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2013-12-31 13:25:48 +0100 |
commit | 2929847516a597bc20e696fdd1a260d750560584 (patch) | |
tree | bb68b2fbb3c2fcb55379c2b7d4cd2f67c3c54032 /svx/source/unogallery | |
parent | 32b64a0ff6fc54290ce5848c34e38ebb7eb5bd95 (diff) |
svx: Use constructor feature for GalleryThemeProvider.
Change-Id: Ifb92256b1516098d292a3ad960cb5982121998da
Diffstat (limited to 'svx/source/unogallery')
-rw-r--r-- | svx/source/unogallery/unogalthemeprovider.cxx | 79 |
1 files changed, 25 insertions, 54 deletions
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: */ |