diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2013-12-17 21:59:50 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2013-12-20 16:26:35 +0100 |
commit | 4a969ac35174520f1ffeb4f919f5d7bb6d99a628 (patch) | |
tree | 887738c0aeae027c1067e7c1092d5c7ef401d654 /svx | |
parent | 296b1e76071698c990e726d2f7935cef9ca07fbe (diff) |
svx: split into direct implementation getFactories
Change-Id: I888f10a923dc2b97247b2a66cc6bd116eee280a7
Diffstat (limited to 'svx')
20 files changed, 351 insertions, 768 deletions
diff --git a/svx/inc/sidebar/PanelFactory.hxx b/svx/inc/sidebar/PanelFactory.hxx deleted file mode 100644 index 7dcfffe69d38..000000000000 --- a/svx/inc/sidebar/PanelFactory.hxx +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_SVX_INC_SIDEBAR_PANELFACTORY_HXX -#define INCLUDED_SVX_INC_SIDEBAR_PANELFACTORY_HXX - -#include <cppuhelper/compbase1.hxx> -#include <cppuhelper/basemutex.hxx> - -#include <com/sun/star/ui/XUIElementFactory.hpp> - -#include <boost/noncopyable.hpp> - -namespace cssu = ::com::sun::star::uno; - - -namespace svx { namespace sidebar { - -namespace -{ - typedef ::cppu::WeakComponentImplHelper1 < - css::ui::XUIElementFactory - > PanelFactoryInterfaceBase; -} - - -class PanelFactory - : private ::boost::noncopyable, - private ::cppu::BaseMutex, - public PanelFactoryInterfaceBase -{ -public: - static ::rtl::OUString SAL_CALL getImplementationName (void); - static cssu::Reference<cssu::XInterface> SAL_CALL createInstance ( - const cssu::Reference<css::lang::XMultiServiceFactory>& rxFactory); - static cssu::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames (void); - - PanelFactory (void); - virtual ~PanelFactory (void); - - // XUIElementFactory - cssu::Reference<css::ui::XUIElement> SAL_CALL createUIElement ( - const ::rtl::OUString& rsResourceURL, - const ::cssu::Sequence<css::beans::PropertyValue>& rArguments) - throw( - css::container::NoSuchElementException, - css::lang::IllegalArgumentException, - cssu::RuntimeException); -}; - - -} } // end of namespace svx::sidebar - -#endif diff --git a/svx/inc/tbunocontroller.hxx b/svx/inc/tbunocontroller.hxx index 82e48c5c51c7..06ee3f87a76b 100644 --- a/svx/inc/tbunocontroller.hxx +++ b/svx/inc/tbunocontroller.hxx @@ -25,8 +25,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -namespace svx -{ +namespace { class SvxFontSizeBox_Impl; class FontHeightToolBoxControl : public svt::ToolboxController, @@ -47,13 +46,6 @@ class FontHeightToolBoxControl : public svt::ToolboxController, virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ); - static OUString getImplementationName_Static() throw() - { - return OUString("com.sun.star.svx.FontHeightToolBoxController"); - } - - static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(); - // XComponent virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException); @@ -75,8 +67,6 @@ class FontHeightToolBoxControl : public svt::ToolboxController, ::com::sun::star::awt::FontDescriptor m_aCurrentFont; }; -::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL FontHeightToolBoxControl_createInstance( const com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMgr ); - } #endif // INCLUDED_SVX_INC_TBUNOCONTROLLER_HXX diff --git a/svx/inc/tbunosearchcontrollers.hxx b/svx/inc/tbunosearchcontrollers.hxx index 5f33b603cd4a..51d31de94fc8 100644 --- a/svx/inc/tbunosearchcontrollers.hxx +++ b/svx/inc/tbunosearchcontrollers.hxx @@ -40,8 +40,7 @@ #include <map> #include <vector> -namespace svx -{ +namespace { class FindTextFieldControl : public ComboBox { @@ -105,13 +104,6 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException ); virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException ); - static OUString getImplementationName_Static() throw() - { - return OUString("com.sun.star.svx.FindTextToolboxController"); - } - - static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(); - // XComponent virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException ); @@ -153,13 +145,6 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException ); virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException ); - static OUString getImplementationName_Static( ) throw() - { - return OUString( "com.sun.star.svx.ExitFindbarToolboxController" ); - } - - static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(); - // XComponent virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException ); @@ -192,14 +177,6 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException ); virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException ); - static OUString getImplementationName_Static( Type eType ) throw() - { - return eType == UP? OUString( "com.sun.star.svx.UpSearchToolboxController" ) : - OUString( "com.sun.star.svx.DownSearchToolboxController" ); - } - - static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(); - // XComponent virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException ); @@ -233,13 +210,6 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException ); virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException ); - static OUString getImplementationName_Static( ) throw() - { - return OUString( "com.sun.star.svx.MatchCaseToolboxController" ); - } - - static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(); - // XComponent virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException ); @@ -274,13 +244,6 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException ); virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException ); - static OUString getImplementationName_Static( ) throw() - { - return OUString( "com.sun.star.svx.FindAllToolboxController" ); - } - - static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(); - // XComponent virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException ); @@ -317,13 +280,6 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException ); virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException ); - static OUString getImplementationName_Static() throw() - { - return OUString("com.sun.star.comp.svx.Impl.FindbarDispatcher"); - } - - static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(); - // XInitialization virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException ); @@ -342,15 +298,6 @@ private: }; -// createInstance -css::uno::Reference< css::uno::XInterface > SAL_CALL FindTextToolbarController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ); -css::uno::Reference< css::uno::XInterface > SAL_CALL DownSearchToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ); -css::uno::Reference< css::uno::XInterface > SAL_CALL UpSearchToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ); -css::uno::Reference< css::uno::XInterface > SAL_CALL MatchCaseToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ); -css::uno::Reference< css::uno::XInterface > SAL_CALL FindAllToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ); -css::uno::Reference< css::uno::XInterface > SAL_CALL ExitFindbarToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ); -css::uno::Reference< css::uno::XInterface > SAL_CALL FindbarDispatcher_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ); - } #endif // INCLUDED_SVX_INC_TBUNOSEARCHCONTROLLERS_HXX diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx index bfaa79119530..cdd8dca4f58f 100644 --- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx @@ -47,24 +47,10 @@ using namespace css; using namespace css::uno; -// - EnhancedCustomShapeEngine - -OUString EnhancedCustomShapeEngine_getImplementationName() - throw( RuntimeException ) -{ - return OUString( "com.sun.star.drawing.EnhancedCustomShapeEngine" ); -} - -Sequence< OUString > SAL_CALL EnhancedCustomShapeEngine_getSupportedServiceNames() - throw( RuntimeException ) -{ - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.drawing.CustomShapeEngine"; - return aRet; -} +namespace { -EnhancedCustomShapeEngine::EnhancedCustomShapeEngine( const Reference< lang::XMultiServiceFactory >& rxMgr ) : - mxFact ( rxMgr ), +// - EnhancedCustomShapeEngine - +EnhancedCustomShapeEngine::EnhancedCustomShapeEngine() : mbForceGroupWithText ( sal_False ) { } @@ -109,7 +95,7 @@ void SAL_CALL EnhancedCustomShapeEngine::initialize( const Sequence< Any >& aArg OUString SAL_CALL EnhancedCustomShapeEngine::getImplementationName() throw( RuntimeException ) { - return EnhancedCustomShapeEngine_getImplementationName(); + return OUString( "com.sun.star.drawing.EnhancedCustomShapeEngine" ); } sal_Bool SAL_CALL EnhancedCustomShapeEngine::supportsService( const OUString& rServiceName ) throw( RuntimeException ) @@ -119,7 +105,10 @@ sal_Bool SAL_CALL EnhancedCustomShapeEngine::supportsService( const OUString& rS Sequence< OUString > SAL_CALL EnhancedCustomShapeEngine::getSupportedServiceNames() throw ( RuntimeException ) { - return EnhancedCustomShapeEngine_getSupportedServiceNames(); + Sequence< OUString > aRet(1); + OUString* pArray = aRet.getArray(); + pArray[0] = "com.sun.star.drawing.CustomShapeEngine"; + return aRet; } // XCustomShapeEngine ----------------------------------------------------------- @@ -444,4 +433,18 @@ Sequence< Reference< drawing::XCustomShapeHandle > > SAL_CALL EnhancedCustomShap return aSeq; } +} + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_drawing_EnhancedCustomShapeEngine_implementation_getFactory( + SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + uno_Sequence * arguments) +{ + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new EnhancedCustomShapeEngine)); + x->acquire(); + return x.get(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.hxx b/svx/source/customshapes/EnhancedCustomShapeEngine.hxx index ae90045a1f87..cad5f9e097df 100644 --- a/svx/source/customshapes/EnhancedCustomShapeEngine.hxx +++ b/svx/source/customshapes/EnhancedCustomShapeEngine.hxx @@ -40,6 +40,8 @@ class SdrObject; class SdrObjCustomShape; +namespace { + class EnhancedCustomShapeEngine : public cppu::WeakImplHelper3 < css::lang::XInitialization, @@ -47,14 +49,13 @@ class EnhancedCustomShapeEngine : public cppu::WeakImplHelper3 css::drawing::XCustomShapeEngine > { - css::uno::Reference< css::lang::XMultiServiceFactory > mxFact; css::uno::Reference< css::drawing::XShape > mxShape; sal_Bool mbForceGroupWithText; SdrObject* ImplForceGroupWithText( const SdrObjCustomShape* pCustoObj, SdrObject* pRenderedShape ); public: - EnhancedCustomShapeEngine( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxMgr ); + EnhancedCustomShapeEngine(); virtual ~EnhancedCustomShapeEngine(); // XInterface @@ -84,12 +85,7 @@ public: throw ( css::uno::RuntimeException ); }; -OUString EnhancedCustomShapeEngine_getImplementationName() - throw ( css::uno::RuntimeException ); -sal_Bool SAL_CALL EnhancedCustomShapeEngine_supportsService( const OUString& rServiceName ) - throw( css::uno::RuntimeException ); -css::uno::Sequence< OUString > SAL_CALL EnhancedCustomShapeEngine_getSupportedServiceNames() - throw( css::uno::RuntimeException ); +} #endif diff --git a/svx/source/gallery2/GalleryControl.cxx b/svx/source/gallery2/GalleryControl.cxx index 3806bcb456d8..18b1d3875e72 100644 --- a/svx/source/gallery2/GalleryControl.cxx +++ b/svx/source/gallery2/GalleryControl.cxx @@ -15,7 +15,6 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "sidebar/PanelFactory.hxx" #include "GalleryControl.hxx" diff --git a/svx/source/inc/recoveryui.hxx b/svx/source/inc/recoveryui.hxx index 38febbbbf433..46c867db2f96 100644 --- a/svx/source/inc/recoveryui.hxx +++ b/svx/source/inc/recoveryui.hxx @@ -28,8 +28,7 @@ #include "docrecovery.hxx" -namespace svx -{ +namespace { namespace svxdr = ::svx::DocRecovery; @@ -109,13 +108,6 @@ class RecoveryUI : public ::cppu::WeakImplHelper2< css::lang::XServiceInfo const css::util::URL& aURL ) throw(css::uno::RuntimeException); - //--------------------------------------- - // XServiceInfo helper - - static OUString st_getImplementationName(); - static css::uno::Sequence< OUString > st_getSupportedServiceNames(); - static css::uno::Reference< css::uno::XInterface > SAL_CALL st_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); - //------------------------------------------- // helper private: @@ -132,7 +124,7 @@ class RecoveryUI : public ::cppu::WeakImplHelper2< css::lang::XServiceInfo }; -} // namespace svx +} #endif // INCLUDED_SVX_SOURCE_INC_RECOVERYUI_HXX diff --git a/svx/source/inc/unogalthemeprovider.hxx b/svx/source/inc/unogalthemeprovider.hxx index 8d1cd680c08f..74e77dc6e461 100644 --- a/svx/source/inc/unogalthemeprovider.hxx +++ b/svx/source/inc/unogalthemeprovider.hxx @@ -25,19 +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(); +namespace { // ----------------- // - GalleryThemes - @@ -51,9 +41,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/sdr/primitive2d/primitivefactory2d.cxx b/svx/source/sdr/primitive2d/primitivefactory2d.cxx index e549d79b3565..d04e46d9a5a5 100644 --- a/svx/source/sdr/primitive2d/primitivefactory2d.cxx +++ b/svx/source/sdr/primitive2d/primitivefactory2d.cxx @@ -17,43 +17,29 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <svx/sdr/primitive2d/primitiveFactory2d.hxx> +#include <com/sun/star/graphic/XPrimitiveFactory2D.hpp> #include <drawinglayer/primitive2d/baseprimitive2d.hxx> #include <svx/svdobj.hxx> #include <svx/svdpage.hxx> #include <svx/unoapi.hxx> #include <svx/sdr/contact/viewcontact.hxx> -////////////////////////////////////////////////////////////////////////////// - using namespace com::sun::star; -////////////////////////////////////////////////////////////////////////////// -// UNO API helper methods - -namespace drawinglayer -{ - namespace primitive2d - { - uno::Reference< uno::XInterface > SAL_CALL XPrimitiveFactory2DProvider_createInstance( - const uno::Reference< lang::XMultiServiceFactory >& /*rSMgr*/) throw( uno::Exception ) - { - return *(new PrimitiveFactory2D()); - } - } // end of namespace primitive2d -} // end of namespace drawinglayer +namespace { -////////////////////////////////////////////////////////////////////////////// -// UNO API helper methods +typedef cppu::WeakComponentImplHelper1< graphic::XPrimitiveFactory2D > PrimitiveFactory2DImplBase; -namespace drawinglayer +// base class for C++ implementation of com::sun::star::graphic::XPrimitiveFactory2D +class PrimitiveFactory2D: protected comphelper::OBaseMutex, public PrimitiveFactory2DImplBase { - namespace primitive2d - { - PrimitiveFactory2D::PrimitiveFactory2D() - : PrimitiveFactory2DImplBase(m_aMutex) - { - } +public: + PrimitiveFactory2D(): PrimitiveFactory2DImplBase(m_aMutex) {} + + // Methods from XPrimitiveFactory2D + virtual uno::Sequence< uno::Reference< graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXShape( const uno::Reference< drawing::XShape >& xShape, const uno::Sequence< beans::PropertyValue >& aParms ) throw (uno::RuntimeException); + virtual uno::Sequence< uno::Reference< graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXDrawPage( const uno::Reference< drawing::XDrawPage >& xDrawPage, const uno::Sequence< beans::PropertyValue >& aParms ) throw (uno::RuntimeException); +}; Primitive2DSequence SAL_CALL PrimitiveFactory2D::createPrimitivesFromXShape( const uno::Reference< drawing::XShape >& xShape, @@ -96,27 +82,18 @@ namespace drawinglayer return aRetval; } - OUString PrimitiveFactory2D::getImplementationName_Static() - { - static OUString aRetval("com.sun.star.comp.graphic.PrimitiveFactory2D"); - return aRetval; - } - - uno::Sequence< OUString > PrimitiveFactory2D::getSupportedServiceNames_Static() - { - static uno::Sequence< OUString > aSeq; - osl::Mutex aMutex; - osl::MutexGuard aGuard( aMutex ); +} - if(!aSeq.getLength()) - { - aSeq.realloc(1L); - aSeq[0] = "com.sun.star.graphic.PrimitiveFactory2D"; - } - - return aSeq; - } - } // end of namespace primitive2d -} // end of namespace drawinglayer +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_graphic_PrimitiveFactory2D_implementation_getFactory( + SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + uno_Sequence * arguments) +{ + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new PrimitiveFactory2D)); + x->acquire(); + return x.get(); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx index 693c00f9a02e..86669834dd6f 100644 --- a/svx/source/sidebar/PanelFactory.cxx +++ b/svx/source/sidebar/PanelFactory.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * @@ -15,7 +16,6 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "sidebar/PanelFactory.hxx" #include "text/TextPropertyPanel.hxx" #include "paragraph/ParaPropertyPanel.hxx" @@ -37,69 +37,57 @@ #include <vcl/window.hxx> #include <rtl/ref.hxx> #include <comphelper/namedvaluecollection.hxx> +#include <cppuhelper/basemutex.hxx> +#include <cppuhelper/compbase1.hxx> #include <com/sun/star/ui/XSidebar.hpp> +#include <com/sun/star/ui/XUIElementFactory.hpp> #include <boost/bind.hpp> +#include <boost/noncopyable.hpp> - +namespace cssu = ::com::sun::star::uno; using namespace css; using namespace cssu; -using ::rtl::OUString; - - -namespace svx { namespace sidebar { +using namespace svx::sidebar; +/* Why this is not used ? Doesn't it need to inherit from XServiceInfo ? #define IMPLEMENTATION_NAME "org.apache.openoffice.comp.svx.sidebar.PanelFactory" #define SERVICE_NAME "com.sun.star.ui.UIElementFactory" +*/ +namespace { -::rtl::OUString SAL_CALL PanelFactory::getImplementationName (void) -{ - return OUString(IMPLEMENTATION_NAME); -} - - - - -cssu::Reference<cssu::XInterface> SAL_CALL PanelFactory::createInstance ( - const uno::Reference<lang::XMultiServiceFactory>& rxFactory) -{ - (void)rxFactory; - - ::rtl::Reference<PanelFactory> pPanelFactory (new PanelFactory()); - cssu::Reference<cssu::XInterface> xService (static_cast<XWeak*>(pPanelFactory.get()), cssu::UNO_QUERY); - return xService; -} - - - +typedef ::cppu::WeakComponentImplHelper1 < + css::ui::XUIElementFactory > PanelFactoryInterfaceBase; -cssu::Sequence<OUString> SAL_CALL PanelFactory::getSupportedServiceNames (void) +class PanelFactory + : private ::boost::noncopyable, + private ::cppu::BaseMutex, + public PanelFactoryInterfaceBase { - cssu::Sequence<OUString> aServiceNames (1); - aServiceNames[0] = SERVICE_NAME; - return aServiceNames; - -} - - - +public: + PanelFactory (void); + virtual ~PanelFactory (void); + + // XUIElementFactory + cssu::Reference<css::ui::XUIElement> SAL_CALL createUIElement ( + const ::rtl::OUString& rsResourceURL, + const ::cssu::Sequence<css::beans::PropertyValue>& rArguments) + throw( + css::container::NoSuchElementException, + css::lang::IllegalArgumentException, + cssu::RuntimeException); +}; PanelFactory::PanelFactory (void) : PanelFactoryInterfaceBase(m_aMutex) { } - - - PanelFactory::~PanelFactory (void) { } - - - Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement ( const ::rtl::OUString& rsResourceURL, const ::cssu::Sequence<css::beans::PropertyValue>& rArguments) @@ -208,6 +196,18 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement ( return Reference<ui::XUIElement>(); } -} } // end of namespace svx::sidebar +} + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +org_apache_openoffice_comp_svx_sidebar_PanelFactory_implementation_getFactory( + SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + uno_Sequence * arguments) +{ + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new PanelFactory)); + x->acquire(); + return x.get(); +} -// eof +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx index c34384466b6e..c7277546c075 100644 --- a/svx/source/tbxctrls/tbunocontroller.cxx +++ b/svx/source/tbxctrls/tbunocontroller.cxx @@ -39,8 +39,7 @@ using namespace ::com::sun::star; -namespace svx -{ +namespace { class FontHeightToolBoxControl; class SvxFontSizeBox_Impl : public FontSizeBox @@ -284,18 +283,12 @@ throw(uno::RuntimeException) OUString SAL_CALL FontHeightToolBoxControl::getImplementationName() throw( uno::RuntimeException ) { - return getImplementationName_Static(); + return OUString("com.sun.star.svx.FontHeightToolBoxController"); } uno::Sequence< OUString > SAL_CALL FontHeightToolBoxControl::getSupportedServiceNames( ) throw( uno::RuntimeException ) { - return getSupportedServiceNames_Static(); -} - -uno::Sequence< OUString > FontHeightToolBoxControl::getSupportedServiceNames_Static() -throw() -{ uno::Sequence< OUString > aSNS( 1 ); aSNS.getArray()[0] = "com.sun.star.frame.ToolbarController"; return aSNS; @@ -404,12 +397,18 @@ void FontHeightToolBoxControl::dispatchCommand( } } -uno::Reference< uno::XInterface > SAL_CALL FontHeightToolBoxControl_createInstance( - const uno::Reference< lang::XMultiServiceFactory >& rSMgr ) -{ - return *new FontHeightToolBoxControl( comphelper::getComponentContext(rSMgr) ); } +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_svx_FontHeightToolBoxController_implementation_getFactory( + css::uno::XComponentContext *rxContext, + uno_Sequence * arguments) +{ + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new FontHeightToolBoxControl(rxContext))); + x->acquire(); + return x.get(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 6089e39f5423..39e839f352b5 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -41,8 +41,9 @@ #include <osl/mutex.hxx> #include <rtl/instance.hxx> -namespace svx -{ +using namespace css; + +namespace { static const char SEARCHITEM_COMMAND[] = "SearchItem.Command"; static const char SEARCHITEM_SEARCHSTRING[] = "SearchItem.SearchString"; @@ -379,7 +380,7 @@ void SAL_CALL FindTextToolbarController::release() throw () // XServiceInfo OUString SAL_CALL FindTextToolbarController::getImplementationName() throw( css::uno::RuntimeException ) { - return getImplementationName_Static(); + return OUString("com.sun.star.svx.FindTextToolboxController"); } sal_Bool SAL_CALL FindTextToolbarController::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException ) @@ -389,11 +390,6 @@ sal_Bool SAL_CALL FindTextToolbarController::supportsService( const OUString& Se css::uno::Sequence< OUString > SAL_CALL FindTextToolbarController::getSupportedServiceNames() throw( css::uno::RuntimeException ) { - return getSupportedServiceNames_Static(); -} - -css::uno::Sequence< OUString > FindTextToolbarController::getSupportedServiceNames_Static() throw() -{ css::uno::Sequence< OUString > aSNS( 1 ); aSNS[0] = "com.sun.star.frame.ToolbarController"; return aSNS; @@ -545,7 +541,9 @@ void SAL_CALL UpDownSearchToolboxController::release() throw () // XServiceInfo OUString SAL_CALL UpDownSearchToolboxController::getImplementationName() throw( css::uno::RuntimeException ) { - return getImplementationName_Static( meType ); + return meType == UpDownSearchToolboxController::UP? + OUString( "com.sun.star.svx.UpSearchToolboxController" ) : + OUString( "com.sun.star.svx.DownSearchToolboxController" ); } sal_Bool SAL_CALL UpDownSearchToolboxController::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException ) @@ -555,11 +553,6 @@ sal_Bool SAL_CALL UpDownSearchToolboxController::supportsService( const OUString css::uno::Sequence< OUString > SAL_CALL UpDownSearchToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException ) { - return getSupportedServiceNames_Static(); -} - -css::uno::Sequence< OUString > UpDownSearchToolboxController::getSupportedServiceNames_Static() throw() -{ css::uno::Sequence< OUString > aSNS( 1 ); aSNS[0] = "com.sun.star.frame.ToolbarController"; return aSNS; @@ -646,7 +639,7 @@ void SAL_CALL MatchCaseToolboxController::release() throw () // XServiceInfo OUString SAL_CALL MatchCaseToolboxController::getImplementationName() throw( css::uno::RuntimeException ) { - return getImplementationName_Static(); + return OUString( "com.sun.star.svx.MatchCaseToolboxController" ); } sal_Bool SAL_CALL MatchCaseToolboxController::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException ) @@ -656,11 +649,6 @@ sal_Bool SAL_CALL MatchCaseToolboxController::supportsService( const OUString& S css::uno::Sequence< OUString > SAL_CALL MatchCaseToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException ) { - return getSupportedServiceNames_Static(); -} - -css::uno::Sequence< OUString > MatchCaseToolboxController::getSupportedServiceNames_Static() throw() -{ css::uno::Sequence< OUString > aSNS( 1 ); aSNS[0] = "com.sun.star.frame.ToolbarController"; return aSNS; @@ -757,7 +745,7 @@ void SAL_CALL FindAllToolboxController::release() throw () // XServiceInfo OUString SAL_CALL FindAllToolboxController::getImplementationName() throw( css::uno::RuntimeException ) { - return getImplementationName_Static( ); + return OUString( "com.sun.star.svx.FindAllToolboxController" ); } @@ -768,11 +756,6 @@ sal_Bool SAL_CALL FindAllToolboxController::supportsService( const OUString& Ser css::uno::Sequence< OUString > SAL_CALL FindAllToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException ) { - return getSupportedServiceNames_Static(); -} - -css::uno::Sequence< OUString > FindAllToolboxController::getSupportedServiceNames_Static() throw() -{ css::uno::Sequence< OUString > aSNS( 1 ); aSNS[0] = "com.sun.star.frame.ToolbarController"; return aSNS; @@ -852,10 +835,9 @@ void SAL_CALL ExitSearchToolboxController::release() throw () // XServiceInfo OUString SAL_CALL ExitSearchToolboxController::getImplementationName() throw( css::uno::RuntimeException ) { - return getImplementationName_Static( ); + return OUString( "com.sun.star.svx.ExitFindbarToolboxController" ); } - sal_Bool SAL_CALL ExitSearchToolboxController::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException ) { return cppu::supportsService(this, ServiceName); @@ -863,11 +845,6 @@ sal_Bool SAL_CALL ExitSearchToolboxController::supportsService( const OUString& css::uno::Sequence< OUString > SAL_CALL ExitSearchToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException ) { - return getSupportedServiceNames_Static(); -} - -css::uno::Sequence< OUString > ExitSearchToolboxController::getSupportedServiceNames_Static() throw() -{ css::uno::Sequence< OUString > aSNS( 1 ); aSNS[0] = "com.sun.star.frame.ToolbarController"; return aSNS; @@ -961,7 +938,7 @@ void SAL_CALL FindbarDispatcher::release() throw() // XServiceInfo OUString SAL_CALL FindbarDispatcher::getImplementationName() throw( css::uno::RuntimeException ) { - return getImplementationName_Static(); + return OUString("com.sun.star.comp.svx.Impl.FindbarDispatcher"); } sal_Bool SAL_CALL FindbarDispatcher::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException ) @@ -971,11 +948,6 @@ sal_Bool SAL_CALL FindbarDispatcher::supportsService( const OUString& ServiceNam css::uno::Sequence< OUString > SAL_CALL FindbarDispatcher::getSupportedServiceNames() throw( css::uno::RuntimeException ) { - return getSupportedServiceNames_Static(); -} - -css::uno::Sequence< OUString > FindbarDispatcher::getSupportedServiceNames_Static() throw() -{ css::uno::Sequence< OUString > aSNS( 2 ); aSNS[0] = "com.sun.star.comp.svx.FindbarDispatcher"; aSNS[1] = "com.sun.star.frame.ProtocolHandler"; @@ -1074,59 +1046,86 @@ void SAL_CALL FindbarDispatcher::removeStatusListener( const css::uno::Reference { } -//----------------------------------------------------------------------------------------------------------- -// create Instance - -css::uno::Reference< css::uno::XInterface > SAL_CALL FindTextToolbarController_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) -{ - return static_cast< cppu::OWeakObject * >( - new FindTextToolbarController( comphelper::getComponentContext(rSMgr) ) ); } -css::uno::Reference< css::uno::XInterface > SAL_CALL DownSearchToolboxController_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_svx_FindTextToolboxController_implementation_getFactory( + css::uno::XComponentContext *context, uno_Sequence * arguments) { - return static_cast< cppu::OWeakObject * >( - new UpDownSearchToolboxController( - comphelper::getComponentContext(rSMgr), UpDownSearchToolboxController::DOWN ) ); + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new FindTextToolbarController(context))); + x->acquire(); + return x.get(); } -css::uno::Reference< css::uno::XInterface > SAL_CALL UpSearchToolboxController_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_svx_ExitFindbarToolboxController_implementation_getFactory( + css::uno::XComponentContext *context, uno_Sequence * arguments) { - return static_cast< cppu::OWeakObject * >( - new UpDownSearchToolboxController( - comphelper::getComponentContext(rSMgr), UpDownSearchToolboxController::UP ) ); + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new ExitSearchToolboxController(context))); + x->acquire(); + return x.get(); } -css::uno::Reference< css::uno::XInterface > SAL_CALL MatchCaseToolboxController_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_svx_UpSearchToolboxController_implementation_getFactory( + css::uno::XComponentContext *context, uno_Sequence * arguments) { - return static_cast< cppu::OWeakObject * >( - new MatchCaseToolboxController( comphelper::getComponentContext(rSMgr) ) ); + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new UpDownSearchToolboxController( + context, UpDownSearchToolboxController::UP ))); + x->acquire(); + return x.get(); } -css::uno::Reference< css::uno::XInterface > SAL_CALL FindAllToolboxController_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_svx_DownSearchToolboxController_implementation_getFactory( + css::uno::XComponentContext *context, uno_Sequence * arguments) { - return static_cast< cppu::OWeakObject * >( - new FindAllToolboxController( comphelper::getComponentContext(rSMgr) ) ); + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new UpDownSearchToolboxController( + context, UpDownSearchToolboxController::DOWN ))); + x->acquire(); + return x.get(); } -css::uno::Reference< css::uno::XInterface > SAL_CALL ExitFindbarToolboxController_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_svx_MatchCaseToolboxController_implementation_getFactory( + css::uno::XComponentContext *context, uno_Sequence * arguments) { - return *new ExitSearchToolboxController( comphelper::getComponentContext(rSMgr) ); + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new MatchCaseToolboxController(context))); + x->acquire(); + return x.get(); } -css::uno::Reference< css::uno::XInterface > SAL_CALL FindbarDispatcher_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory >& ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_svx_FindAllToolboxController_implementation_getFactory( + css::uno::XComponentContext *context, uno_Sequence * arguments) { - return static_cast< cppu::OWeakObject * >( new FindbarDispatcher ); + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new FindAllToolboxController(context))); + x->acquire(); + return x.get(); } -//----------------------------------------------------------------------------------------------------------- +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_svx_Impl_FindbarDispatcher_implementation_getFactory( + SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + uno_Sequence * arguments) +{ + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new FindbarDispatcher)); + x->acquire(); + return x.get(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 0c83a677b248..365ba925377e 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -83,15 +83,14 @@ using namespace ::com::sun::star::document; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::task; -#include <svx/sdr/contact/viewobjectcontactredirector.hxx> // #i102251# #include <editeng/editstat.hxx> ////////////////////////////////////////////////////////////////////////////// -namespace svx -{ +namespace { + struct ExportSettings { OUString maFilterName; @@ -180,26 +179,6 @@ namespace svx SdrModel* mpDoc; }; - SVX_DLLPUBLIC Reference< XInterface > SAL_CALL GraphicExporter_createInstance(const Reference< XMultiServiceFactory > & ) - throw( Exception ) - { - return (XWeak*)new GraphicExporter(); - } - - SVX_DLLPUBLIC Sequence< OUString > SAL_CALL GraphicExporter_getSupportedServiceNames() - throw() - { - Sequence< OUString > aSupportedServiceNames( 1 ); - aSupportedServiceNames[0] = "com.sun.star.drawing.GraphicExportFilter"; - return aSupportedServiceNames; - } - - SVX_DLLPUBLIC OUString SAL_CALL GraphicExporter_getImplementationName() - throw() - { - return OUString( "com.sun.star.comp.Draw.GraphicExporter" ); - } - /** creates a bitmap that is optionaly transparent from a metafile */ BitmapEx GetBitmapFromMetaFile( const GDIMetaFile& rMtf, sal_Bool bTransparent, const Size* pSize ) @@ -300,7 +279,6 @@ namespace svx return &aOutSize; } -} class ImplExportCheckVisisbilityRedirector : public ::sdr::contact::ViewObjectContactRedirector { @@ -351,7 +329,7 @@ drawinglayer::primitive2d::Primitive2DSequence ImplExportCheckVisisbilityRedirec } } -using namespace ::svx; +// using namespace ::svx; GraphicExporter::GraphicExporter() : mpUnoPage( NULL ), mnPageNumber(-1), mpCurrentPage(0), mpDoc( NULL ) @@ -1224,7 +1202,7 @@ void SAL_CALL GraphicExporter::setSourceDocument( const Reference< lang::XCompon OUString SAL_CALL GraphicExporter::getImplementationName( ) throw(RuntimeException) { - return GraphicExporter_getImplementationName(); + return OUString( "com.sun.star.comp.Draw.GraphicExporter" ); } sal_Bool SAL_CALL GraphicExporter::supportsService( const OUString& ServiceName ) @@ -1236,7 +1214,9 @@ sal_Bool SAL_CALL GraphicExporter::supportsService( const OUString& ServiceName Sequence< OUString > SAL_CALL GraphicExporter::getSupportedServiceNames( ) throw(RuntimeException) { - return GraphicExporter_getSupportedServiceNames(); + Sequence< OUString > aSupportedServiceNames( 1 ); + aSupportedServiceNames[0] = "com.sun.star.drawing.GraphicExportFilter"; + return aSupportedServiceNames; } // XMimeTypeInfo @@ -1284,6 +1264,8 @@ Sequence< OUString > SAL_CALL GraphicExporter::getSupportedMimeTypeNames( ) thr return aSeq; } +} + Graphic SvxGetGraphicForShape( SdrObject& rShape, bool bVector ) { Graphic aGraphic; @@ -1302,4 +1284,16 @@ Graphic SvxGetGraphicForShape( SdrObject& rShape, bool bVector ) return aGraphic; } +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_Draw_GraphicExporter_implementation_getFactory( + SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + uno_Sequence * arguments) +{ + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new GraphicExporter)); + x->acquire(); + return x.get(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/UnoGraphicExporter.hxx b/svx/source/unodraw/UnoGraphicExporter.hxx deleted file mode 100644 index 864ad2158e67..000000000000 --- a/svx/source/unodraw/UnoGraphicExporter.hxx +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVX_SOURCE_UNODRAW_UNOGRAPHICEXPORTER_HXX -#define INCLUDED_SVX_SOURCE_UNODRAW_UNOGRAPHICEXPORTER_HXX - -#include <com/sun/star/uno/XInterface.hpp> - -namespace svx -{ - SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GraphicExporter_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception ); - SVX_DLLPUBLIC ::com::sun::star::uno::Sequence< OUString > SAL_CALL GraphicExporter_getSupportedServiceNames() throw(); - SVX_DLLPUBLIC OUString SAL_CALL GraphicExporter_getImplementationName() throw(); -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx index 986afe7d8695..d0c83dcfe6a5 100644 --- a/svx/source/unodraw/recoveryui.cxx +++ b/svx/source/unodraw/recoveryui.cxx @@ -35,8 +35,7 @@ #include <boost/scoped_ptr.hpp> #include <officecfg/Office/Recovery.hxx> -namespace svx -{ +namespace { namespace svxdr = ::svx::DocRecovery; @@ -57,7 +56,7 @@ RecoveryUI::~RecoveryUI() OUString SAL_CALL RecoveryUI::getImplementationName() throw(css::uno::RuntimeException) { - return RecoveryUI::st_getImplementationName(); + return OUString("com.sun.star.comp.svx.RecoveryUI"); } sal_Bool SAL_CALL RecoveryUI::supportsService(const OUString& sServiceName) @@ -69,7 +68,9 @@ sal_Bool SAL_CALL RecoveryUI::supportsService(const OUString& sServiceName) css::uno::Sequence< OUString > SAL_CALL RecoveryUI::getSupportedServiceNames() throw(css::uno::RuntimeException) { - return RecoveryUI::st_getSupportedServiceNames(); + css::uno::Sequence< OUString > lServiceNames(1); + lServiceNames[0] = "com.sun.star.dialog.RecoveryUI"; + return lServiceNames; } css::uno::Any SAL_CALL RecoveryUI::dispatchWithReturnValue(const css::util::URL& aURL, @@ -132,24 +133,6 @@ void SAL_CALL RecoveryUI::removeStatusListener(const css::uno::Reference< css::f OSL_FAIL("RecoveryUI::removeStatusListener()\nNot implemented yet!"); } -OUString RecoveryUI::st_getImplementationName() -{ - return OUString("com.sun.star.comp.svx.RecoveryUI"); -} - -css::uno::Sequence< OUString > RecoveryUI::st_getSupportedServiceNames() -{ - css::uno::Sequence< OUString > lServiceNames(1); - lServiceNames[0] = "com.sun.star.dialog.RecoveryUI"; - return lServiceNames; -} - -css::uno::Reference< css::uno::XInterface > SAL_CALL RecoveryUI::st_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) -{ - RecoveryUI* pNew = new RecoveryUI(comphelper::getComponentContext(xSMGR)); - return css::uno::Reference< css::uno::XInterface >(static_cast< css::lang::XServiceInfo* >(pNew)); -} - static OUString GetCrashConfigDir() { @@ -342,6 +325,17 @@ void RecoveryUI::impl_showAllRecoveredDocs() } } -} // namespace svx +} + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_svx_RecoveryUI_implementation_getFactory( + css::uno::XComponentContext *context, uno_Sequence * arguments) +{ + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new RecoveryUI(context))); + x->acquire(); + return x.get(); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx index 6963cf9b52bc..76762b9a7efa 100644 --- a/svx/source/unodraw/unoctabl.cxx +++ b/svx/source/unodraw/unoctabl.cxx @@ -20,21 +20,15 @@ #include <unotools/pathoptions.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/implbase2.hxx> - -#include "../customshapes/EnhancedCustomShapeEngine.hxx" - #include <svx/xtable.hxx> -#include "svx/unoshcol.hxx" -#include "recoveryui.hxx" -#include "svx/xmlgrhlp.hxx" -#include "tbunocontroller.hxx" -#include "tbunosearchcontrollers.hxx" using namespace ::com::sun::star; -using namespace ::rtl; using namespace ::cppu; +namespace { + class SvxUnoColorTable : public WeakImplHelper2< container::XNameContainer, lang::XServiceInfo > { private: @@ -49,13 +43,6 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( uno::RuntimeException); virtual uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( uno::RuntimeException); - static OUString getImplementationName_Static() throw() - { - return OUString("com.sun.star.drawing.SvxUnoColorTable"); - } - - static uno::Sequence< OUString > getSupportedServiceNames_Static(void) throw(); - // XNameContainer virtual void SAL_CALL insertByName( const OUString& aName, const uno::Any& aElement ) throw( lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL removeByName( const OUString& Name ) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException); @@ -98,17 +85,12 @@ sal_Bool SAL_CALL SvxUnoColorTable::supportsService( const OUString& ServiceNam OUString SAL_CALL SvxUnoColorTable::getImplementationName() throw( uno::RuntimeException ) { - return OUString("SvxUnoColorTable"); + return OUString("com.sun.star.drawing.SvxUnoColorTable"); } uno::Sequence< OUString > SAL_CALL SvxUnoColorTable::getSupportedServiceNames() throw( uno::RuntimeException ) { - return getSupportedServiceNames_Static(); -} - -uno::Sequence< OUString > SvxUnoColorTable::getSupportedServiceNames_Static(void) throw() -{ uno::Sequence< OUString > aSNS( 1 ); aSNS.getArray()[0] = "com.sun.star.drawing.ColorTable"; return aSNS; @@ -207,184 +189,18 @@ sal_Bool SAL_CALL SvxUnoColorTable::hasElements() return pList.is() && pList->Count() != 0; } -/** - * Create a colortable - */ -uno::Reference< uno::XInterface > SAL_CALL SvxUnoColorTable_createInstance(const uno::Reference< lang::XMultiServiceFactory > & ) throw(uno::Exception) -{ - return *new SvxUnoColorTable(); } -uno::Reference< uno::XInterface > SAL_CALL create_EnhancedCustomShapeEngine( const uno::Reference< lang::XMultiServiceFactory >& rxFact ) throw(uno::Exception) -{ - return *new EnhancedCustomShapeEngine( rxFact ); -} - -// -// export this service -// - -#include "UnoGraphicExporter.hxx" -#include "unogalthemeprovider.hxx" -#include <com/sun/star/registry/XRegistryKey.hpp> -#include "sal/types.h" -#include "osl/diagnose.h" -#include "cppuhelper/factory.hxx" -#include <svx/sdr/primitive2d/primitiveFactory2d.hxx> -#include "sidebar/PanelFactory.hxx" - - -extern "C" -{ -SAL_DLLPUBLIC_EXPORT void * SAL_CALL svx_component_getFactory ( - const sal_Char * pImplName, void * pServiceManager, void * ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_drawing_SvxUnoColorTable_implementation_getFactory( + SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + uno_Sequence * arguments) { - void * pRet = 0; - if( pServiceManager ) - { - uno::Reference< lang::XSingleServiceFactory > xFactory; - - if( rtl_str_compare( pImplName, "com.sun.star.drawing.SvxUnoColorTable" ) == 0 ) - { - xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - SvxUnoColorTable::getImplementationName_Static(), - SvxUnoColorTable_createInstance, - SvxUnoColorTable::getSupportedServiceNames_Static() ); - } - else if ( rtl_str_compare( pImplName, "com.sun.star.drawing.EnhancedCustomShapeEngine" ) == 0 ) - { - xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), - EnhancedCustomShapeEngine_getImplementationName(), - create_EnhancedCustomShapeEngine, - EnhancedCustomShapeEngine_getSupportedServiceNames() ); - } - else if( rtl_str_compare( pImplName, "com.sun.star.drawing.SvxShapeCollection" ) == 0 ) - { - xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - SvxShapeCollection::getImplementationName_Static(), - SvxShapeCollection_createInstance, - SvxShapeCollection::getSupportedServiceNames_Static() ); - } - else if( svx::RecoveryUI::st_getImplementationName().equalsAscii( pImplName ) ) - { - xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - svx::RecoveryUI::st_getImplementationName(), - svx::RecoveryUI::st_createInstance, - svx::RecoveryUI::st_getSupportedServiceNames() ); - } - else if( svx::GraphicExporter_getImplementationName().equalsAscii( pImplName ) ) - { - xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - svx::GraphicExporter_getImplementationName(), - svx::GraphicExporter_createInstance, - svx::GraphicExporter_getSupportedServiceNames() ); - } - else if ( svx::FontHeightToolBoxControl::getImplementationName_Static().equalsAscii( pImplName ) ) - { - xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - svx::FontHeightToolBoxControl::getImplementationName_Static(), - svx::FontHeightToolBoxControl_createInstance, - svx::FontHeightToolBoxControl::getSupportedServiceNames_Static() ); - } - else if ( svx::FindTextToolbarController::getImplementationName_Static().equalsAscii( pImplName ) ) - { - xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - svx::FindTextToolbarController::getImplementationName_Static(), - svx::FindTextToolbarController_createInstance, - svx::FindTextToolbarController::getSupportedServiceNames_Static() ); - } - else if ( svx::UpDownSearchToolboxController::getImplementationName_Static( svx::UpDownSearchToolboxController::DOWN ).equalsAscii( pImplName ) ) - { - xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - svx::UpDownSearchToolboxController::getImplementationName_Static( svx::UpDownSearchToolboxController::DOWN ), - svx::DownSearchToolboxController_createInstance, - svx::UpDownSearchToolboxController::getSupportedServiceNames_Static() ); - } - else if ( svx::UpDownSearchToolboxController::getImplementationName_Static( svx::UpDownSearchToolboxController::UP ).equalsAscii( pImplName ) ) - { - xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - svx::UpDownSearchToolboxController::getImplementationName_Static( svx::UpDownSearchToolboxController::UP ), - svx::UpSearchToolboxController_createInstance, - svx::UpDownSearchToolboxController::getSupportedServiceNames_Static() ); - } - else if ( svx::MatchCaseToolboxController::getImplementationName_Static().equalsAscii( pImplName ) ) - { - xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - svx::MatchCaseToolboxController::getImplementationName_Static(), - svx::MatchCaseToolboxController_createInstance, - svx::MatchCaseToolboxController::getSupportedServiceNames_Static() ); - } - else if ( svx::FindAllToolboxController::getImplementationName_Static().equalsAscii( pImplName ) ) - { - xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - svx::FindAllToolboxController::getImplementationName_Static(), - svx::FindAllToolboxController_createInstance, - svx::FindAllToolboxController::getSupportedServiceNames_Static() ); - } - else if ( svx::ExitSearchToolboxController::getImplementationName_Static().equalsAscii( pImplName ) ) - { - xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - svx::ExitSearchToolboxController::getImplementationName_Static(), - svx::ExitFindbarToolboxController_createInstance, - svx::ExitSearchToolboxController::getSupportedServiceNames_Static() ); - } - else if ( svx::FindbarDispatcher::getImplementationName_Static().equalsAscii( pImplName ) ) - { - xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - svx::FindbarDispatcher::getImplementationName_Static(), - 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() ); - } - else if( drawinglayer::primitive2d::PrimitiveFactory2D::getImplementationName_Static().equalsAscii( pImplName ) ) - { - // XPrimitiveFactory2D - xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - drawinglayer::primitive2d::PrimitiveFactory2D::getImplementationName_Static(), - drawinglayer::primitive2d::XPrimitiveFactory2DProvider_createInstance, - drawinglayer::primitive2d::PrimitiveFactory2D::getSupportedServiceNames_Static() ); - } - else if( ::svx::SvXMLGraphicImportHelper_getImplementationName().equalsAscii( pImplName ) ) - { - xFactory = ::cppu::createSingleFactory( - reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - ::svx::SvXMLGraphicImportHelper_getImplementationName(), - ::svx::SvXMLGraphicImportHelper_createInstance, - ::svx::SvXMLGraphicImportHelper_getSupportedServiceNames() ); - } - else if( ::svx::SvXMLGraphicExportHelper_getImplementationName().equalsAscii( pImplName ) ) - { - xFactory = ::cppu::createSingleFactory( - reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), - ::svx::SvXMLGraphicExportHelper_getImplementationName(), - ::svx::SvXMLGraphicExportHelper_createInstance, - ::svx::SvXMLGraphicExportHelper_getSupportedServiceNames() ); - } - else if (::svx::sidebar::PanelFactory::getImplementationName().equalsAscii(pImplName)) - { - xFactory = ::cppu::createSingleFactory( - reinterpret_cast<lang::XMultiServiceFactory*>(pServiceManager), - ::svx::sidebar::PanelFactory::getImplementationName(), - ::svx::sidebar::PanelFactory::createInstance, - ::svx::sidebar::PanelFactory::getSupportedServiceNames()); - } - - if( xFactory.is()) - { - xFactory->acquire(); - pRet = xFactory.get(); - } - } - - return pRet; -} - + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new SvxUnoColorTable)); + x->acquire(); + return x.get(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx index 2850e1efb958..7e77015129ef 100644 --- a/svx/source/unodraw/unoshcol.cxx +++ b/svx/source/unodraw/unoshcol.cxx @@ -18,8 +18,9 @@ */ #include <com/sun/star/document/EventObject.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> -#include "svx/unoshcol.hxx" +#include <svx/unoshcol.hxx> #include <svx/unoprov.hxx> #include <cppuhelper/supportsservice.hxx> @@ -210,11 +211,6 @@ sal_Bool SAL_CALL SvxShapeCollection::hasElements() throw( uno::RuntimeException OUString SAL_CALL SvxShapeCollection::getImplementationName() throw( uno::RuntimeException ) { - return getImplementationName_Static(); -} - -OUString SvxShapeCollection::getImplementationName_Static() -{ return OUString("com.sun.star.drawing.SvxShapeCollection"); } @@ -226,20 +222,22 @@ sal_Bool SAL_CALL SvxShapeCollection::supportsService( const OUString& ServiceNa uno::Sequence< OUString > SAL_CALL SvxShapeCollection::getSupportedServiceNames() throw( uno::RuntimeException ) { - return getSupportedServiceNames_Static(); -} - -uno::Sequence< OUString > SvxShapeCollection::getSupportedServiceNames_Static() -{ uno::Sequence< OUString > aSeq(2); aSeq.getArray()[0] = "com.sun.star.drawing.Shapes"; aSeq.getArray()[1] = "com.sun.star.drawing.ShapeCollection"; return aSeq; } -Reference< XInterface > SAL_CALL SvxShapeCollection_createInstance( const Reference< ::com::sun::star::lang::XMultiServiceFactory >& ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_drawing_SvxShapeCollection_implementation_getFactory( + SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + uno_Sequence * arguments) { - return *( new SvxShapeCollection() ); + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new SvxShapeCollection)); + x->acquire(); + return x.get(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx index e5ad2d89002a..75049ccc5bab 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,16 @@ 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 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new GalleryThemeProvider)); + x->acquire(); + return x.get(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 0509b7c8309e..4cd46118933e 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -28,7 +28,6 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <cppuhelper/compbase4.hxx> #include <cppuhelper/supportsservice.hxx> - #include <unotools/ucbstreamhelper.hxx> #include <unotools/streamwrap.hxx> #include <unotools/tempfile.hxx> @@ -54,6 +53,8 @@ using ::com::sun::star::lang::XMultiServiceFactory; #define XML_GRAPHICSTORAGE_NAME "Pictures" #define XML_GRAPHICOBJECT_URL_BASE "vnd.sun.star.GraphicObject:" +namespace { + const MetaCommentAction* ImplCheckForEPS( GDIMetaFile& rMtf ) { const MetaCommentAction* pComment = NULL; @@ -346,6 +347,8 @@ const GraphicObject& SvXMLGraphicOutputStream::GetGraphicObject() return maGrfObj; } +} + SvXMLGraphicHelper::SvXMLGraphicHelper( SvXMLGraphicHelperMode eCreateMode ) : ::cppu::WeakComponentImplHelper2< ::com::sun::star::document::XGraphicObjectResolver, ::com::sun::star::document::XBinaryStreamResolver >( maMutex ) @@ -884,9 +887,9 @@ OUString SAL_CALL SvXMLGraphicHelper::resolveOutputStream( const Reference< XOut return aRet; } +namespace { + // for instantiation via service manager -namespace svx -{ namespace impl { @@ -1014,8 +1017,8 @@ OUString SAL_CALL SvXMLGraphicImportExportHelper::getImplementationName() throw (uno::RuntimeException) { if( m_eGraphicHelperMode == GRAPHICHELPER_MODE_READ ) - return SvXMLGraphicImportHelper_getImplementationName(); - return SvXMLGraphicExportHelper_getImplementationName(); + return OUString("com.sun.star.comp.Svx.GraphicImportHelper"); + return OUString("com.sun.star.comp.Svx.GraphicExportHelper"); } ::sal_Bool SAL_CALL SvXMLGraphicImportExportHelper::supportsService( const OUString& ServiceName ) @@ -1027,25 +1030,6 @@ OUString SAL_CALL SvXMLGraphicImportExportHelper::getImplementationName() Sequence< OUString > SAL_CALL SvXMLGraphicImportExportHelper::getSupportedServiceNames() throw (uno::RuntimeException) { - if( m_eGraphicHelperMode == GRAPHICHELPER_MODE_READ ) - return SvXMLGraphicImportHelper_getSupportedServiceNames(); - return SvXMLGraphicExportHelper_getSupportedServiceNames(); -} - -// import -Reference< XInterface > SAL_CALL SvXMLGraphicImportHelper_createInstance(const Reference< XMultiServiceFactory > & /* rSMgr */ ) - throw( Exception ) -{ - return static_cast< XWeak* >( new SvXMLGraphicImportExportHelper( GRAPHICHELPER_MODE_READ )); -} -OUString SAL_CALL SvXMLGraphicImportHelper_getImplementationName() - throw() -{ - return OUString( "com.sun.star.comp.Svx.GraphicImportHelper" ); -} -Sequence< OUString > SAL_CALL SvXMLGraphicImportHelper_getSupportedServiceNames() - throw() -{ // XGraphicObjectResolver and XBinaryStreamResolver are not part of any service Sequence< OUString > aSupportedServiceNames( 2 ); aSupportedServiceNames[0] = "com.sun.star.document.GraphicObjectResolver"; @@ -1053,27 +1037,56 @@ Sequence< OUString > SAL_CALL SvXMLGraphicImportHelper_getSupportedServiceNames( return aSupportedServiceNames; } -// export -Reference< XInterface > SAL_CALL SvXMLGraphicExportHelper_createInstance(const Reference< XMultiServiceFactory > & /* rSMgr */ ) - throw( Exception ) -{ - return static_cast< XWeak* >( new SvXMLGraphicImportExportHelper( GRAPHICHELPER_MODE_WRITE )); } -OUString SAL_CALL SvXMLGraphicExportHelper_getImplementationName() - throw() + +/** Create this with createInstanceWithArguments. service name + "com.sun.star.comp.Svx.GraphicImportHelper", one argument which is the + XStorage. Without arguments no helper class is created. With an empty + argument the helper class is created and initialized like in the CTOR to + SvXMLGraphicHelper that only gets the create mode. + + You should call dispose after you no longer need this component. + + uses eCreateMode == GRAPHICHELPER_MODE_READ, bDirect == sal_True in + SvXMLGraphicHelper + */ +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_Svx_GraphicImportHelper_implementation_getFactory( + SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + uno_Sequence * arguments) { - return OUString( "com.sun.star.comp.Svx.GraphicExportHelper" ); + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new SvXMLGraphicImportExportHelper( + GRAPHICHELPER_MODE_READ ))); + x->acquire(); + return x.get(); } -Sequence< OUString > SAL_CALL SvXMLGraphicExportHelper_getSupportedServiceNames() - throw() + +/** Create this with createInstanceWithArguments. service name + "com.sun.star.comp.Svx.GraphicExportHelper", one argument which is the + XStorage. Without arguments no helper class is created. With an empty + argument the helper class is created and initialized like in the CTOR to + SvXMLGraphicHelper that only gets the create mode + + To write the Pictures stream, you have to call dispose at this component. + Make sure you call dipose before you commit the parent storage. + + uses eCreateMode == GRAPHICHELPER_MODE_WRITE, bDirect == sal_True in + SvXMLGraphicHelper + */ + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_Svx_GraphicExportHelper_implementation_getFactory( + SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + uno_Sequence * arguments) { - // XGraphicObjectResolver and XBinaryStreamResolver are not part of any service - Sequence< OUString > aSupportedServiceNames( 2 ); - aSupportedServiceNames[0] = "com.sun.star.document.GraphicObjectResolver"; - aSupportedServiceNames[1] = "com.sun.star.document.BinaryStreamResolver"; - return aSupportedServiceNames; + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new SvXMLGraphicImportExportHelper( + GRAPHICHELPER_MODE_WRITE ))); + x->acquire(); + return x.get(); } -} // namespace svx - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/util/svx.component b/svx/util/svx.component index e5054eb0130c..c5e609f570e7 100644 --- a/svx/util/svx.component +++ b/svx/util/svx.component @@ -18,62 +18,80 @@ --> <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - prefix="svx" xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.comp.Draw.GraphicExporter"> + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.Draw.GraphicExporter" + constructor="com_sun_star_comp_Draw_GraphicExporter_implementation_getFactory"> <service name="com.sun.star.drawing.GraphicExportFilter"/> </implementation> - <implementation name="com.sun.star.comp.Svx.GraphicExportHelper"> + <implementation name="com.sun.star.comp.Svx.GraphicExportHelper" + constructor="com_sun_star_comp_Svx_GraphicExportHelper_implementation_getFactory"> <service name="com.sun.star.document.BinaryStreamResolver"/> <service name="com.sun.star.document.GraphicObjectResolver"/> </implementation> - <implementation name="com.sun.star.comp.Svx.GraphicImportHelper"> + <implementation name="com.sun.star.comp.Svx.GraphicImportHelper" + constructor="com_sun_star_comp_Svx_GraphicImportHelper_implementation_getFactory"> <service name="com.sun.star.document.BinaryStreamResolver"/> <service name="com.sun.star.document.GraphicObjectResolver"/> </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.graphic.PrimitiveFactory2D"> + <implementation name="com.sun.star.comp.graphic.PrimitiveFactory2D" + constructor="com_sun_star_comp_graphic_PrimitiveFactory2D_implementation_getFactory"> <service name="com.sun.star.graphic.PrimitiveFactory2D"/> </implementation> - <implementation name="com.sun.star.comp.svx.Impl.FindbarDispatcher"> + <implementation name="com.sun.star.comp.svx.Impl.FindbarDispatcher" + constructor="com_sun_star_comp_svx_Impl_FindbarDispatcher_implementation_getFactory"> <service name="com.sun.star.comp.svx.FindbarDispatcher"/> <service name="com.sun.star.frame.ProtocolHandler"/> </implementation> - <implementation name="com.sun.star.comp.svx.RecoveryUI"> + <implementation name="com.sun.star.comp.svx.RecoveryUI" + constructor="com_sun_star_comp_svx_RecoveryUI_implementation_getFactory"> <service name="com.sun.star.dialog.RecoveryUI"/> </implementation> - <implementation name="com.sun.star.drawing.EnhancedCustomShapeEngine"> + <implementation name="com.sun.star.drawing.EnhancedCustomShapeEngine" + constructor="com_sun_star_drawing_EnhancedCustomShapeEngine_implementation_getFactory"> <service name="com.sun.star.drawing.CustomShapeEngine"/> </implementation> - <implementation name="com.sun.star.drawing.SvxShapeCollection"> + <implementation name="com.sun.star.drawing.SvxShapeCollection" + constructor="com_sun_star_drawing_SvxShapeCollection_implementation_getFactory"> <service name="com.sun.star.drawing.ShapeCollection"/> </implementation> - <implementation name="com.sun.star.drawing.SvxUnoColorTable"> + <implementation name="com.sun.star.drawing.SvxUnoColorTable" + constructor="com_sun_star_drawing_SvxUnoColorTable_implementation_getFactory"> <service name="com.sun.star.drawing.ColorTable"/> </implementation> - <implementation name="com.sun.star.svx.DownSearchToolboxController"> + <implementation name="com.sun.star.svx.DownSearchToolboxController" + constructor="com_sun_star_svx_DownSearchToolboxController_implementation_getFactory"> <service name="com.sun.star.frame.ToolbarController"/> </implementation> - <implementation name="com.sun.star.svx.FindTextToolboxController"> + <implementation name="com.sun.star.svx.FindTextToolboxController" + constructor="com_sun_star_svx_FindTextToolboxController_implementation_getFactory"> <service name="com.sun.star.frame.ToolbarController"/> </implementation> - <implementation name="com.sun.star.svx.MatchCaseToolboxController"> + <implementation name="com.sun.star.svx.MatchCaseToolboxController" + constructor="com_sun_star_svx_MatchCaseToolboxController_implementation_getFactory"> <service name="com.sun.star.frame.ToolbarController"/> </implementation> - <implementation name="com.sun.star.svx.FindAllToolboxController"> + <implementation name="com.sun.star.svx.FindAllToolboxController" + constructor="com_sun_star_svx_FindAllToolboxController_implementation_getFactory"> <service name="com.sun.star.frame.ToolbarController"/> </implementation> - <implementation name="com.sun.star.svx.FontHeightToolBoxController"> + <implementation name="com.sun.star.svx.FontHeightToolBoxController" + constructor="com_sun_star_svx_FontHeightToolBoxController_implementation_getFactory"> <service name="com.sun.star.frame.ToolbarController"/> </implementation> - <implementation name="com.sun.star.svx.UpSearchToolboxController"> + <implementation name="com.sun.star.svx.UpSearchToolboxController" + constructor="com_sun_star_svx_UpSearchToolboxController_implementation_getFactory"> <service name="com.sun.star.frame.ToolbarController"/> </implementation> - <implementation name="com.sun.star.svx.ExitFindbarToolboxController"> + <implementation name="com.sun.star.svx.ExitFindbarToolboxController" + constructor="com_sun_star_svx_ExitFindbarToolboxController_implementation_getFactory"> <service name="com.sun.star.frame.ToolbarController"/> </implementation> - <implementation name="org.apache.openoffice.comp.svx.sidebar.PanelFactory"> + <implementation name="org.apache.openoffice.comp.svx.sidebar.PanelFactory" + constructor="org_apache_openoffice_comp_svx_sidebar_PanelFactory_implementation_getFactory"> <service name="com.sun.star.ui.UIElementFactory"/> </implementation> </component> |