From 4a969ac35174520f1ffeb4f919f5d7bb6d99a628 Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Tue, 17 Dec 2013 21:59:50 +0100 Subject: svx: split into direct implementation getFactories Change-Id: I888f10a923dc2b97247b2a66cc6bd116eee280a7 --- include/osl/detail/component-declarations.h | 18 ++ include/osl/detail/component-mapping.h | 24 ++- include/svx/sdr/primitive2d/primitiveFactory2d.hxx | 76 -------- include/svx/unoshcol.hxx | 3 - include/svx/xmlgrhlp.hxx | 36 ---- svx/inc/sidebar/PanelFactory.hxx | 68 ------- svx/inc/tbunocontroller.hxx | 12 +- svx/inc/tbunosearchcontrollers.hxx | 55 +----- .../customshapes/EnhancedCustomShapeEngine.cxx | 41 ++-- .../customshapes/EnhancedCustomShapeEngine.hxx | 12 +- svx/source/gallery2/GalleryControl.cxx | 1 - svx/source/inc/recoveryui.hxx | 12 +- svx/source/inc/unogalthemeprovider.hxx | 15 +- svx/source/sdr/primitive2d/primitivefactory2d.cxx | 71 +++---- svx/source/sidebar/PanelFactory.cxx | 86 ++++----- svx/source/tbxctrls/tbunocontroller.cxx | 25 ++- svx/source/tbxctrls/tbunosearchcontrollers.cxx | 143 +++++++------- svx/source/unodraw/UnoGraphicExporter.cxx | 48 +++-- svx/source/unodraw/UnoGraphicExporter.hxx | 34 ---- svx/source/unodraw/recoveryui.cxx | 40 ++-- svx/source/unodraw/unoctabl.cxx | 210 ++------------------- svx/source/unodraw/unoshcol.cxx | 24 ++- svx/source/unogallery/unogalthemeprovider.cxx | 71 ++----- svx/source/xml/xmlgrhlp.cxx | 95 ++++++---- svx/util/svx.component | 56 ++++-- 25 files changed, 391 insertions(+), 885 deletions(-) delete mode 100644 include/svx/sdr/primitive2d/primitiveFactory2d.hxx delete mode 100644 svx/inc/sidebar/PanelFactory.hxx delete mode 100644 svx/source/unodraw/UnoGraphicExporter.hxx diff --git a/include/osl/detail/component-declarations.h b/include/osl/detail/component-declarations.h index b8fb658d2822..aeb906909508 100644 --- a/include/osl/detail/component-declarations.h +++ b/include/osl/detail/component-declarations.h @@ -109,6 +109,24 @@ void * com_sun_star_comp_stoc_SimpleRegistry( void * , void * ); void * com_sun_star_extensions_xml_sax_Writer( void * , void * ); void * com_sun_star_security_comp_stoc_AccessController( void * , void * ); void * com_sun_star_security_comp_stoc_FilePolicy( void * , void * ); +void * com_sun_star_comp_Draw_GraphicExporter_implementation_getFactory( void * , void * ); +void * com_sun_star_comp_Svx_GraphicExportHelper_implementation_getFactory( void * , void * ); +void * com_sun_star_comp_Svx_GraphicImportHelper_implementation_getFactory( void * , void * ); +void * com_sun_star_comp_gallery_GalleryThemeProvider_implementation_getFactory( void * , void * ); +void * com_sun_star_comp_graphic_PrimitiveFactory2D_implementation_getFactory( void * , void * ); +void * com_sun_star_comp_svx_Impl_FindbarDispatcher_implementation_getFactory( void * , void * ); +void * com_sun_star_comp_svx_RecoveryUI_implementation_getFactory( void * , void * ); +void * com_sun_star_drawing_EnhancedCustomShapeEngine_implementation_getFactory( void * , void * ); +void * com_sun_star_drawing_SvxShapeCollection_implementation_getFactory( void * , void * ); +void * com_sun_star_drawing_SvxUnoColorTable_implementation_getFactory( void * , void * ); +void * com_sun_star_svx_DownSearchToolboxController_implementation_getFactory( void * , void * ); +void * com_sun_star_svx_FindTextToolboxController_implementation_getFactory( void * , void * ); +void * com_sun_star_svx_MatchCaseToolboxController_implementation_getFactory( void * , void * ); +void * com_sun_star_svx_FindAllToolboxController_implementation_getFactory( void * , void * ); +void * com_sun_star_svx_FontHeightToolBoxController_implementation_getFactory( void * , void * ); +void * com_sun_star_svx_UpSearchToolboxController_implementation_getFactory( void * , void * ); +void * com_sun_star_svx_ExitFindbarToolboxController_implementation_getFactory( void * , void * ); +void * org_apache_openoffice_comp_svx_sidebar_PanelFactory_implementation_getFactory( void * , void * ); #ifdef __cplusplus } diff --git a/include/osl/detail/component-mapping.h b/include/osl/detail/component-mapping.h index b32d41b5c8a8..776f37119707 100644 --- a/include/osl/detail/component-mapping.h +++ b/include/osl/detail/component-mapping.h @@ -69,7 +69,6 @@ const lib_to_constructor_mapping *lo_get_constructor_map(void); { "libspelllo.a", spell_component_getFactory }, \ { "libsvllo.a", svl_component_getFactory }, \ { "libsvtlo.a", svt_component_getFactory }, \ - { "libsvxlo.a", svx_component_getFactory }, \ { "libtklo.a", tk_component_getFactory }, \ { "libucb1.a", ucb_component_getFactory }, \ { "libucpexpand1lo.a", ucpexpand1_component_getFactory }, \ @@ -135,8 +134,11 @@ const lib_to_constructor_mapping *lo_get_constructor_map(void); { "libwpftwriterlo.a", wpftwriter_component_getFactory }, \ #define NON_APP_SPECIFIC_CONSTRUCTOR_MAP \ + /* expwrap.component */ \ { "com_sun_star_comp_extensions_xml_sax_ParserExpat", com_sun_star_comp_extensions_xml_sax_ParserExpat }, \ { "com_sun_star_comp_extensions_xml_sax_FastParser", com_sun_star_comp_extensions_xml_sax_FastParser }, \ + { "com_sun_star_extensions_xml_sax_Writer", com_sun_star_extensions_xml_sax_Writer }, \ + /* bootstrap.component */ \ { "com_sun_star_comp_stoc_DLLComponentLoader", com_sun_star_comp_stoc_DLLComponentLoader }, \ { "com_sun_star_comp_stoc_ImplementationRegistration", com_sun_star_comp_stoc_ImplementationRegistration }, \ { "com_sun_star_comp_stoc_NestedRegistry", com_sun_star_comp_stoc_NestedRegistry }, \ @@ -144,9 +146,27 @@ const lib_to_constructor_mapping *lo_get_constructor_map(void); { "com_sun_star_comp_stoc_OServiceManager", com_sun_star_comp_stoc_OServiceManager }, \ { "com_sun_star_comp_stoc_OServiceManagerWrapper", com_sun_star_comp_stoc_OServiceManagerWrapper }, \ { "com_sun_star_comp_stoc_SimpleRegistry", com_sun_star_comp_stoc_SimpleRegistry }, \ - { "com_sun_star_extensions_xml_sax_Writer", com_sun_star_extensions_xml_sax_Writer }, \ { "com_sun_star_security_comp_stoc_AccessController", com_sun_star_security_comp_stoc_AccessController }, \ { "com_sun_star_security_comp_stoc_FilePolicy", com_sun_star_security_comp_stoc_FilePolicy }, \ + /* svx.component */ \ + { "com_sun_star_comp_Draw_GraphicExporter_implementation_getFactory", com_sun_star_comp_Draw_GraphicExporter_implementation_getFactory }, \ + { "com_sun_star_comp_Svx_GraphicExportHelper_implementation_getFactory", com_sun_star_comp_Svx_GraphicExportHelper_implementation_getFactory }, \ + { "com_sun_star_comp_Svx_GraphicImportHelper_implementation_getFactory", com_sun_star_comp_Svx_GraphicImportHelper_implementation_getFactory }, \ + { "com_sun_star_comp_gallery_GalleryThemeProvider_implementation_getFactory", com_sun_star_comp_gallery_GalleryThemeProvider_implementation_getFactory }, \ + { "com_sun_star_comp_graphic_PrimitiveFactory2D_implementation_getFactory", com_sun_star_comp_graphic_PrimitiveFactory2D_implementation_getFactory }, \ + { "com_sun_star_comp_svx_Impl_FindbarDispatcher_implementation_getFactory", com_sun_star_comp_svx_Impl_FindbarDispatcher_implementation_getFactory }, \ + { "com_sun_star_comp_svx_RecoveryUI_implementation_getFactory", com_sun_star_comp_svx_RecoveryUI_implementation_getFactory }, \ + { "com_sun_star_drawing_EnhancedCustomShapeEngine_implementation_getFactory", com_sun_star_drawing_EnhancedCustomShapeEngine_implementation_getFactory }, \ + { "com_sun_star_drawing_SvxShapeCollection_implementation_getFactory", com_sun_star_drawing_SvxShapeCollection_implementation_getFactory }, \ + { "com_sun_star_drawing_SvxUnoColorTable_implementation_getFactory", com_sun_star_drawing_SvxUnoColorTable_implementation_getFactory }, \ + { "com_sun_star_svx_DownSearchToolboxController_implementation_getFactory", com_sun_star_svx_DownSearchToolboxController_implementation_getFactory }, \ + { "com_sun_star_svx_FindTextToolboxController_implementation_getFactory", com_sun_star_svx_FindTextToolboxController_implementation_getFactory }, \ + { "com_sun_star_svx_MatchCaseToolboxController_implementation_getFactory", com_sun_star_svx_MatchCaseToolboxController_implementation_getFactory }, \ + { "com_sun_star_svx_FindAllToolboxController_implementation_getFactory", com_sun_star_svx_FindAllToolboxController_implementation_getFactory }, \ + { "com_sun_star_svx_FontHeightToolBoxController_implementation_getFactory", com_sun_star_svx_FontHeightToolBoxController_implementation_getFactory }, \ + { "com_sun_star_svx_UpSearchToolboxController_implementation_getFactory", com_sun_star_svx_UpSearchToolboxController_implementation_getFactory }, \ + { "com_sun_star_svx_ExitFindbarToolboxController_implementation_getFactory", com_sun_star_svx_ExitFindbarToolboxController_implementation_getFactory }, \ + { "org_apache_openoffice_comp_svx_sidebar_PanelFactory_implementation_getFactory", org_apache_openoffice_comp_svx_sidebar_PanelFactory_implementation_getFactory }, \ #endif /* DISABLE_DYNLOADING */ diff --git a/include/svx/sdr/primitive2d/primitiveFactory2d.hxx b/include/svx/sdr/primitive2d/primitiveFactory2d.hxx deleted file mode 100644 index dcbdc6b79589..000000000000 --- a/include/svx/sdr/primitive2d/primitiveFactory2d.hxx +++ /dev/null @@ -1,76 +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_SDR_PRIMITIVE2D_PRIMITIVEFACTORY2D_HXX -#define INCLUDED_SVX_SDR_PRIMITIVE2D_PRIMITIVEFACTORY2D_HXX - -#include -#include -#include - -#include - -////////////////////////////////////////////////////////////////////////////// -// UNO API helper methods - -namespace drawinglayer -{ - namespace primitive2d - { - SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL XPrimitiveFactory2DProvider_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception ); - } // end of namespace primitive2d -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// -// PrimitiveFactory2D class - -namespace drawinglayer -{ - namespace primitive2d - { - // typedef for PrimitiveFactory2DImplBase - typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitiveFactory2D > PrimitiveFactory2DImplBase; - - // base class for C++ implementation of com::sun::star::graphic::XPrimitiveFactory2D - class PrimitiveFactory2D - : protected comphelper::OBaseMutex, - public PrimitiveFactory2DImplBase - { - private: - protected: - public: - // constructor - PrimitiveFactory2D(); - - // Methods from XPrimitiveFactory2D - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aParms ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXDrawPage( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aParms ) throw (::com::sun::star::uno::RuntimeException); - - // UNO API helpers - SVX_DLLPUBLIC static OUString getImplementationName_Static(); - SVX_DLLPUBLIC static com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static(); - }; - } // end of namespace primitive2d -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -#endif // INCLUDED_SVX_SDR_PRIMITIVE2D_PRIMITIVEFACTORY2D_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unoshcol.hxx b/include/svx/unoshcol.hxx index b349b5e01ea2..523313f6213b 100644 --- a/include/svx/unoshcol.hxx +++ b/include/svx/unoshcol.hxx @@ -81,11 +81,8 @@ public: virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException); 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 com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static(); - static OUString getImplementationName_Static(); }; -::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL SvxShapeCollection_createInstance( const com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMgr ); #endif diff --git a/include/svx/xmlgrhlp.hxx b/include/svx/xmlgrhlp.hxx index 7e399b0f47ef..595be129d3d6 100644 --- a/include/svx/xmlgrhlp.hxx +++ b/include/svx/xmlgrhlp.hxx @@ -119,42 +119,6 @@ public: virtual OUString SAL_CALL resolveOutputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rxBinaryStream ) throw (::com::sun::star::uno::RuntimeException); }; - -// for instantiation via service manager -namespace svx -{ -/** 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 - */ -SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicImportHelper_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 SvXMLGraphicImportHelper_getSupportedServiceNames() throw(); -SVX_DLLPUBLIC OUString SAL_CALL SvXMLGraphicImportHelper_getImplementationName() 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 - */ -SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicExportHelper_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 SvXMLGraphicExportHelper_getSupportedServiceNames() throw(); -SVX_DLLPUBLIC OUString SAL_CALL SvXMLGraphicExportHelper_getImplementationName() throw(); -} - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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 -#include - -#include - -#include - -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 SAL_CALL createInstance ( - const cssu::Reference& rxFactory); - static cssu::Sequence SAL_CALL getSupportedServiceNames (void); - - PanelFactory (void); - virtual ~PanelFactory (void); - - // XUIElementFactory - cssu::Reference SAL_CALL createUIElement ( - const ::rtl::OUString& rsResourceURL, - const ::cssu::Sequence& 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 #include -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 #include -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 x( + static_cast(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 #include -#include - 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 +#include #include #include #include #include #include -////////////////////////////////////////////////////////////////////////////// - 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 x( + static_cast(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 #include #include +#include +#include #include +#include #include +#include - +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 SAL_CALL PanelFactory::createInstance ( - const uno::Reference& rxFactory) -{ - (void)rxFactory; - - ::rtl::Reference pPanelFactory (new PanelFactory()); - cssu::Reference xService (static_cast(pPanelFactory.get()), cssu::UNO_QUERY); - return xService; -} - - - +typedef ::cppu::WeakComponentImplHelper1 < + css::ui::XUIElementFactory > PanelFactoryInterfaceBase; -cssu::Sequence SAL_CALL PanelFactory::getSupportedServiceNames (void) +class PanelFactory + : private ::boost::noncopyable, + private ::cppu::BaseMutex, + public PanelFactoryInterfaceBase { - cssu::Sequence aServiceNames (1); - aServiceNames[0] = SERVICE_NAME; - return aServiceNames; - -} - - - +public: + PanelFactory (void); + virtual ~PanelFactory (void); + + // XUIElementFactory + cssu::Reference SAL_CALL createUIElement ( + const ::rtl::OUString& rsResourceURL, + const ::cssu::Sequence& rArguments) + throw( + css::container::NoSuchElementException, + css::lang::IllegalArgumentException, + cssu::RuntimeException); +}; PanelFactory::PanelFactory (void) : PanelFactoryInterfaceBase(m_aMutex) { } - - - PanelFactory::~PanelFactory (void) { } - - - Reference SAL_CALL PanelFactory::createUIElement ( const ::rtl::OUString& rsResourceURL, const ::cssu::Sequence& rArguments) @@ -208,6 +196,18 @@ Reference SAL_CALL PanelFactory::createUIElement ( return Reference(); } -} } // 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 x( + static_cast(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,17 +283,11 @@ 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"; @@ -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 x( + static_cast(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 #include -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 ) @@ -388,11 +389,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"; @@ -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 ) @@ -554,11 +552,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"; @@ -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 ) @@ -655,11 +648,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"; @@ -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" ); } @@ -767,11 +755,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"; @@ -852,21 +835,15 @@ 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); } 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"; @@ -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 ) @@ -970,11 +947,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"; @@ -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 x( + static_cast(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 x( + static_cast(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 x( + static_cast(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 x( + static_cast(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 x( + static_cast(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 x( + static_cast(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 x( + static_cast(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 // #i102251# #include ////////////////////////////////////////////////////////////////////////////// -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 x( + static_cast(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 - -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 #include -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 x( + static_cast(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 #include #include +#include #include - -#include "../customshapes/EnhancedCustomShapeEngine.hxx" - #include -#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,16 +85,11 @@ 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"; @@ -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 -#include "sal/types.h" -#include "osl/diagnose.h" -#include "cppuhelper/factory.hxx" -#include -#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(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 x( + static_cast(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 +#include -#include "svx/unoshcol.hxx" +#include #include #include @@ -209,11 +210,6 @@ sal_Bool SAL_CALL SvxShapeCollection::hasElements() throw( uno::RuntimeException // XServiceInfo OUString SAL_CALL SvxShapeCollection::getImplementationName() throw( uno::RuntimeException ) -{ - return getImplementationName_Static(); -} - -OUString SvxShapeCollection::getImplementationName_Static() { return OUString("com.sun.star.drawing.SvxShapeCollection"); } @@ -225,11 +221,6 @@ 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"; @@ -237,9 +228,16 @@ uno::Sequence< OUString > SvxShapeCollection::getSupportedServiceNames_Static() 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 x( + static_cast(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 x( + static_cast(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 #include #include - #include #include #include @@ -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 ) @@ -1026,25 +1029,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 ); @@ -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 x( + static_cast(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 x( + static_cast(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 @@ --> - + xmlns="http://openoffice.org/2010/uno-components"> + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + -- cgit v1.2.3