From 7f65fc10d069082d3b1938f37b4e6fc74cfcc3b9 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Sun, 3 May 2015 15:17:42 +0200 Subject: sc: Convert many services to constructors. Change-Id: I8f382fec62c11760399872eae86b71214534a372 --- sc/inc/ScPanelFactory.hxx | 5 - sc/inc/afmtuno.hxx | 8 -- sc/inc/appluno.hxx | 54 --------- sc/inc/filtuno.hxx | 8 -- sc/source/filter/xml/xmlexprt.cxx | 187 +++++--------------------------- sc/source/ui/sidebar/ScPanelFactory.cxx | 36 ++---- sc/source/ui/unoobj/afmtuno.cxx | 21 +--- sc/source/ui/unoobj/appluno.cxx | 104 ------------------ sc/source/ui/unoobj/filtuno.cxx | 21 +--- sc/util/sc.component | 39 ++++--- 10 files changed, 72 insertions(+), 411 deletions(-) diff --git a/sc/inc/ScPanelFactory.hxx b/sc/inc/ScPanelFactory.hxx index 69af4f086e26..0777fa01e868 100644 --- a/sc/inc/ScPanelFactory.hxx +++ b/sc/inc/ScPanelFactory.hxx @@ -42,11 +42,6 @@ class ScPanelFactory public PanelFactoryInterfaceBase { public: - static ::rtl::OUString SAL_CALL getImplementationName_static(); - static css::uno::Reference SAL_CALL createInstance( - const css::uno::Reference& rxFactory); - static css::uno::Sequence SAL_CALL getSupportedServiceNames_static(); - ScPanelFactory(void); virtual ~ScPanelFactory(void); diff --git a/sc/inc/afmtuno.hxx b/sc/inc/afmtuno.hxx index 5e1da0e50433..ca2b53205460 100644 --- a/sc/inc/afmtuno.hxx +++ b/sc/inc/afmtuno.hxx @@ -44,11 +44,6 @@ class ScAutoFormatObj; #define SC_AFMTOBJ_INVALID USHRT_MAX -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL - ScAutoFormatsObj_CreateInstance( - const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& ); - class ScAutoFormatsObj : public ::cppu::WeakImplHelper4< ::com::sun::star::container::XNameContainer, ::com::sun::star::container::XEnumerationAccess, @@ -63,9 +58,6 @@ public: ScAutoFormatsObj(); virtual ~ScAutoFormatsObj(); - static OUString getImplementationName_Static(); - static ::com::sun::star::uno::Sequence< OUString> getSupportedServiceNames_Static(); - // XNameContainer virtual void SAL_CALL insertByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement ) diff --git a/sc/inc/appluno.hxx b/sc/inc/appluno.hxx index 662b028ebf92..982536a4d8d1 100644 --- a/sc/inc/appluno.hxx +++ b/sc/inc/appluno.hxx @@ -76,60 +76,6 @@ OUString SAL_CALL ScXMLImport_Settings_getImplementationName() throw(); css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLImport_Settings_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) throw( css::uno::Exception ); -// Calc XML export -css::uno::Sequence< OUString > SAL_CALL ScXMLOOoExport_getSupportedServiceNames() throw(); -OUString SAL_CALL ScXMLOOoExport_getImplementationName() throw(); -css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLOOoExport_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) - throw (css::uno::Exception, std::exception); -css::uno::Sequence< OUString > SAL_CALL ScXMLOOoExport_Meta_getSupportedServiceNames() throw(); -OUString SAL_CALL ScXMLOOoExport_Meta_getImplementationName() throw(); -css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLOOoExport_Meta_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) - throw (css::uno::Exception, std::exception); -css::uno::Sequence< OUString > SAL_CALL ScXMLOOoExport_Styles_getSupportedServiceNames() throw(); -OUString SAL_CALL ScXMLOOoExport_Styles_getImplementationName() throw(); -css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLOOoExport_Styles_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) - throw (css::uno::Exception, std::exception); -css::uno::Sequence< OUString > SAL_CALL ScXMLOOoExport_Content_getSupportedServiceNames() throw(); -OUString SAL_CALL ScXMLOOoExport_Content_getImplementationName() throw(); -css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLOOoExport_Content_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) - throw (css::uno::Exception, std::exception); -css::uno::Sequence< OUString > SAL_CALL ScXMLOOoExport_Settings_getSupportedServiceNames() throw(); -OUString SAL_CALL ScXMLOOoExport_Settings_getImplementationName() throw(); -css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLOOoExport_Settings_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) - throw( css::uno::Exception, std::exception ); - -// Calc XML Oasis export -css::uno::Sequence< OUString > SAL_CALL ScXMLOasisExport_getSupportedServiceNames() throw(); -OUString SAL_CALL ScXMLOasisExport_getImplementationName() throw(); -css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLOasisExport_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) - throw (css::uno::Exception, std::exception); -css::uno::Sequence< OUString > SAL_CALL ScXMLOasisExport_Meta_getSupportedServiceNames() throw(); -OUString SAL_CALL ScXMLOasisExport_Meta_getImplementationName() throw(); -css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLOasisExport_Meta_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) - throw (css::uno::Exception, std::exception); -css::uno::Sequence< OUString > SAL_CALL ScXMLOasisExport_Styles_getSupportedServiceNames() throw(); -OUString SAL_CALL ScXMLOasisExport_Styles_getImplementationName() throw(); -css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLOasisExport_Styles_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) - throw( css::uno::Exception, std::exception ); -css::uno::Sequence< OUString > SAL_CALL ScXMLOasisExport_Content_getSupportedServiceNames() throw(); -OUString SAL_CALL ScXMLOasisExport_Content_getImplementationName() throw(); -css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLOasisExport_Content_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) - throw (css::uno::Exception, std::exception); -css::uno::Sequence< OUString > SAL_CALL ScXMLOasisExport_Settings_getSupportedServiceNames() throw(); -OUString SAL_CALL ScXMLOasisExport_Settings_getImplementationName() throw(); -css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLOasisExport_Settings_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) - throw (css::uno::Exception, std::exception); - class ScSpreadsheetSettings : public cppu::WeakImplHelper3< com::sun::star::sheet::XGlobalSheetSettings, com::sun::star::beans::XPropertySet, diff --git a/sc/inc/filtuno.hxx b/sc/inc/filtuno.hxx index 5b8969b172f6..a3126db578ee 100644 --- a/sc/inc/filtuno.hxx +++ b/sc/inc/filtuno.hxx @@ -33,11 +33,6 @@ namespace com { namespace sun { namespace star { namespace io { class XInputStream; } } } } -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL - ScFilterOptionsObj_CreateInstance( - const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& ); - class ScFilterOptionsObj : public ::cppu::WeakImplHelper5< ::com::sun::star::beans::XPropertyAccess, ::com::sun::star::ui::dialogs::XExecutableDialog, @@ -56,9 +51,6 @@ public: ScFilterOptionsObj(); virtual ~ScFilterOptionsObj(); - static OUString getImplementationName_Static(); - static ::com::sun::star::uno::Sequence< OUString> getSupportedServiceNames_Static(); - // XPropertyAccess virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getPropertyValues() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 8c21574ff706..8cdbd82e8cc4 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -244,191 +244,64 @@ OUString lcl_GetFormattedString( ScDocument* pDoc, const ScAddress& rPos ) } // anonymous namespace -OUString SAL_CALL ScXMLOOoExport_getImplementationName() throw() +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +Calc_XMLExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence const &) { - return OUString( "com.sun.star.comp.Calc.XMLExporter" ); + return cppu::acquire(new ScXMLExport(context, "com.sun.star.comp.Calc.XMLExporter", SvXMLExportFlags::ALL)); } -uno::Sequence< OUString > SAL_CALL ScXMLOOoExport_getSupportedServiceNames() throw() +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +Calc_XMLMetaExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence const &) { - const OUString aServiceName( ScXMLOOoExport_getImplementationName() ); - return uno::Sequence< OUString >( &aServiceName, 1 ); + return cppu::acquire(new ScXMLExport(context, "com.sun.star.comp.Calc.XMLMetaExporter", SvXMLExportFlags::META)); } -uno::Reference< uno::XInterface > SAL_CALL ScXMLOOoExport_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) - throw(uno::Exception, std::exception) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +Calc_XMLStylesExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence const &) { - return (cppu::OWeakObject*)new ScXMLExport( comphelper::getComponentContext(rSMgr), ScXMLOOoExport_getImplementationName(), SvXMLExportFlags::ALL ); + return cppu::acquire(new ScXMLExport(context, "com.sun.star.comp.Calc.XMLStylesExporter", SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::FONTDECLS)); } -OUString SAL_CALL ScXMLOOoExport_Meta_getImplementationName() throw() +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +Calc_XMLContentExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence const &) { - return OUString( "com.sun.star.comp.Calc.XMLMetaExporter" ); + return cppu::acquire(new ScXMLExport(context, "com.sun.star.comp.Calc.XMLContentExporter", SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::FONTDECLS)); } -uno::Sequence< OUString > SAL_CALL ScXMLOOoExport_Meta_getSupportedServiceNames() throw() +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +Calc_XMLSettingsExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence const &) { - const OUString aServiceName( ScXMLOOoExport_Meta_getImplementationName() ); - return uno::Sequence< OUString > ( &aServiceName, 1 ); + return cppu::acquire(new ScXMLExport(context, "com.sun.star.comp.Calc.XMLSettingsExporter", SvXMLExportFlags::SETTINGS)); } -uno::Reference< uno::XInterface > SAL_CALL ScXMLOOoExport_Meta_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) - throw (uno::Exception, std::exception) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +Calc_XMLOasisExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence const &) { - return (cppu::OWeakObject*)new ScXMLExport( comphelper::getComponentContext(rSMgr), ScXMLOOoExport_Meta_getImplementationName(), SvXMLExportFlags::META ); + return cppu::acquire(new ScXMLExport(context, "com.sun.star.comp.Calc.XMLOasisExporter", SvXMLExportFlags::ALL|SvXMLExportFlags::OASIS)); } -OUString SAL_CALL ScXMLOOoExport_Styles_getImplementationName() throw() +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +Calc_XMLOasisMetaExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence const &) { - return OUString( "com.sun.star.comp.Calc.XMLStylesExporter" ); + return cppu::acquire(new ScXMLExport(context, "com.sun.star.comp.Calc.XMLOasisMetaExporter", SvXMLExportFlags::META|SvXMLExportFlags::OASIS)); } -uno::Sequence< OUString > SAL_CALL ScXMLOOoExport_Styles_getSupportedServiceNames() throw() +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +Calc_XMLOasisStylesExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence const &) { - const OUString aServiceName( ScXMLOOoExport_Styles_getImplementationName() ); - return uno::Sequence< OUString > ( &aServiceName, 1 ); + return cppu::acquire(new ScXMLExport(context, "com.sun.star.comp.Calc.XMLOasisStylesExporter", SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::OASIS)); } -uno::Reference< uno::XInterface > SAL_CALL ScXMLOOoExport_Styles_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) - throw (uno::Exception, std::exception) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +Calc_XMLOasisContentExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence const &) { - return (cppu::OWeakObject*)new ScXMLExport( comphelper::getComponentContext(rSMgr), ScXMLOOoExport_Styles_getImplementationName(), SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::FONTDECLS); + return cppu::acquire(new ScXMLExport(context, "com.sun.star.comp.Calc.XMLOasisContentExporter", SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::OASIS)); } -OUString SAL_CALL ScXMLOOoExport_Content_getImplementationName() throw() +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +Calc_XMLOasisSettingsExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence const &) { - return OUString( "com.sun.star.comp.Calc.XMLContentExporter" ); -} - -uno::Sequence< OUString > SAL_CALL ScXMLOOoExport_Content_getSupportedServiceNames() throw() -{ - const OUString aServiceName( ScXMLOOoExport_Content_getImplementationName() ); - return uno::Sequence< OUString > ( &aServiceName, 1 ); -} - -uno::Reference< uno::XInterface > SAL_CALL ScXMLOOoExport_Content_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) - throw (uno::Exception, std::exception) -{ - return (cppu::OWeakObject*)new ScXMLExport( comphelper::getComponentContext(rSMgr), ScXMLOOoExport_Content_getImplementationName(), SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::FONTDECLS); -} - -OUString SAL_CALL ScXMLOOoExport_Settings_getImplementationName() throw() -{ - return OUString( "com.sun.star.comp.Calc.XMLSettingsExporter" ); -} - -uno::Sequence< OUString > SAL_CALL ScXMLOOoExport_Settings_getSupportedServiceNames() throw() -{ - const OUString aServiceName( ScXMLOOoExport_Settings_getImplementationName() ); - return uno::Sequence< OUString > ( &aServiceName, 1 ); -} - -uno::Reference< uno::XInterface > SAL_CALL ScXMLOOoExport_Settings_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) - throw( uno::Exception, std::exception ) -{ - return (cppu::OWeakObject*)new ScXMLExport( comphelper::getComponentContext(rSMgr), ScXMLOOoExport_Settings_getImplementationName(), SvXMLExportFlags::SETTINGS ); -} - -// Oasis Filter - -OUString SAL_CALL ScXMLOasisExport_getImplementationName() throw() -{ - return OUString( "com.sun.star.comp.Calc.XMLOasisExporter" ); -} - -uno::Sequence< OUString > SAL_CALL ScXMLOasisExport_getSupportedServiceNames() throw() -{ - const OUString aServiceName( ScXMLOasisExport_getImplementationName() ); - const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); - return aSeq; -} - -uno::Reference< uno::XInterface > SAL_CALL ScXMLOasisExport_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) - throw (uno::Exception, std::exception) -{ - return (cppu::OWeakObject*)new ScXMLExport(comphelper::getComponentContext(rSMgr), ScXMLOasisExport_getImplementationName(), SvXMLExportFlags::ALL|SvXMLExportFlags::OASIS); -} - -OUString SAL_CALL ScXMLOasisExport_Meta_getImplementationName() throw() -{ - return OUString( "com.sun.star.comp.Calc.XMLOasisMetaExporter" ); -} - -uno::Sequence< OUString > SAL_CALL ScXMLOasisExport_Meta_getSupportedServiceNames() throw() -{ - const OUString aServiceName( ScXMLOasisExport_Meta_getImplementationName() ); - const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); - return aSeq; -} - -uno::Reference< uno::XInterface > SAL_CALL ScXMLOasisExport_Meta_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) - throw (uno::Exception, std::exception) -{ - return (cppu::OWeakObject*)new ScXMLExport(comphelper::getComponentContext(rSMgr), ScXMLOasisExport_Meta_getImplementationName(), SvXMLExportFlags::META|SvXMLExportFlags::OASIS); -} - -OUString SAL_CALL ScXMLOasisExport_Styles_getImplementationName() throw() -{ - return OUString( "com.sun.star.comp.Calc.XMLOasisStylesExporter" ); -} - -uno::Sequence< OUString > SAL_CALL ScXMLOasisExport_Styles_getSupportedServiceNames() throw() -{ - const OUString aServiceName( ScXMLOasisExport_Styles_getImplementationName() ); - const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); - return aSeq; -} - -uno::Reference< uno::XInterface > SAL_CALL ScXMLOasisExport_Styles_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) - throw( uno::Exception, std::exception ) -{ - return (cppu::OWeakObject*)new ScXMLExport(comphelper::getComponentContext(rSMgr), ScXMLOasisExport_Styles_getImplementationName(), SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::OASIS); -} - -OUString SAL_CALL ScXMLOasisExport_Content_getImplementationName() throw() -{ - return OUString( "com.sun.star.comp.Calc.XMLOasisContentExporter" ); -} - -uno::Sequence< OUString > SAL_CALL ScXMLOasisExport_Content_getSupportedServiceNames() throw() -{ - const OUString aServiceName( ScXMLOasisExport_Content_getImplementationName() ); - const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); - return aSeq; -} - -uno::Reference< uno::XInterface > SAL_CALL ScXMLOasisExport_Content_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) - throw (uno::Exception, std::exception) -{ - return (cppu::OWeakObject*)new ScXMLExport(comphelper::getComponentContext(rSMgr), ScXMLOasisExport_Content_getImplementationName(), SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::OASIS); -} - -OUString SAL_CALL ScXMLOasisExport_Settings_getImplementationName() throw() -{ - return OUString( "com.sun.star.comp.Calc.XMLOasisSettingsExporter" ); -} - -uno::Sequence< OUString > SAL_CALL ScXMLOasisExport_Settings_getSupportedServiceNames() throw() -{ - const OUString aServiceName( ScXMLOasisExport_Settings_getImplementationName() ); - const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); - return aSeq; -} - -uno::Reference< uno::XInterface > SAL_CALL ScXMLOasisExport_Settings_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) - throw (uno::Exception, std::exception) -{ - return (cppu::OWeakObject*)new ScXMLExport(comphelper::getComponentContext(rSMgr), ScXMLOasisExport_Settings_getImplementationName(), SvXMLExportFlags::SETTINGS|SvXMLExportFlags::OASIS); + return cppu::acquire(new ScXMLExport(context, "com.sun.star.comp.Calc.XMLOasisSettingsExporter", SvXMLExportFlags::SETTINGS|SvXMLExportFlags::OASIS)); } class ScXMLShapeExport : public XMLShapeExport diff --git a/sc/source/ui/sidebar/ScPanelFactory.cxx b/sc/source/ui/sidebar/ScPanelFactory.cxx index b0d4c8fdd4ed..f465248e69dc 100644 --- a/sc/source/ui/sidebar/ScPanelFactory.cxx +++ b/sc/source/ui/sidebar/ScPanelFactory.cxx @@ -43,30 +43,6 @@ using ::rtl::OUString; namespace sc { namespace sidebar { -#define IMPLEMENTATION_NAME "org.apache.openoffice.comp.sc.sidebar.ScPanelFactory" -#define SERVICE_NAME "com.sun.star.ui.UIElementFactory" - -::rtl::OUString SAL_CALL ScPanelFactory::getImplementationName_static() -{ - return OUString(IMPLEMENTATION_NAME); -} - -css::uno::Reference SAL_CALL ScPanelFactory::createInstance( - const uno::Reference& ) -{ - ::rtl::Reference pPanelFactory (new ScPanelFactory()); - css::uno::Reference xService (static_cast(pPanelFactory.get()), css::uno::UNO_QUERY); - return xService; -} - -css::uno::Sequence SAL_CALL ScPanelFactory::getSupportedServiceNames_static() -{ - css::uno::Sequence aServiceNames (1); - aServiceNames[0] = SERVICE_NAME; - return aServiceNames; - -} - ScPanelFactory::ScPanelFactory (void) : PanelFactoryInterfaceBase(m_aMutex) { @@ -171,7 +147,7 @@ Reference SAL_CALL ScPanelFactory::createUIElement ( OUString ScPanelFactory::getImplementationName() throw (css::uno::RuntimeException, std::exception) { - return getImplementationName_static(); + return OUString("org.apache.openoffice.comp.sc.sidebar.ScPanelFactory"); } sal_Bool ScPanelFactory::supportsService(OUString const & ServiceName) @@ -183,9 +159,17 @@ sal_Bool ScPanelFactory::supportsService(OUString const & ServiceName) css::uno::Sequence ScPanelFactory::getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) { - return getSupportedServiceNames_static(); + css::uno::Sequence aServiceNames(1); + aServiceNames[0] = "com.sun.star.ui.UIElementFactory"; + return aServiceNames; } } } // end of namespace sc::sidebar +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +ScPanelFactory_get_implementation(css::uno::XComponentContext*, css::uno::Sequence const &) +{ + return cppu::acquire(new sc::sidebar::ScPanelFactory()); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx index 7af9a593d3c5..ab104f4a9ab0 100644 --- a/sc/source/ui/unoobj/afmtuno.cxx +++ b/sc/source/ui/unoobj/afmtuno.cxx @@ -171,27 +171,12 @@ ScAutoFormatsObj::~ScAutoFormatsObj() { } -// stuff for exService_... - -uno::Reference SAL_CALL ScAutoFormatsObj_CreateInstance( - const uno::Reference& ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +ScAutoFormatsObj_get_implementation(css::uno::XComponentContext*, css::uno::Sequence const &) { SolarMutexGuard aGuard; ScDLL::Init(); - return (::cppu::OWeakObject*) new ScAutoFormatsObj; -} - -OUString ScAutoFormatsObj::getImplementationName_Static() -{ - return OUString( "stardiv.StarCalc.ScAutoFormatsObj" ); -} - -uno::Sequence ScAutoFormatsObj::getSupportedServiceNames_Static() -{ - uno::Sequence aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = SCAUTOFORMATSOBJ_SERVICE; - return aRet; + return cppu::acquire(new ScAutoFormatsObj); } // XTableAutoFormats diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx index 47045564a2a5..bb6115b1c0a2 100644 --- a/sc/source/ui/unoobj/appluno.cxx +++ b/sc/source/ui/unoobj/appluno.cxx @@ -128,14 +128,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL sc_component_getFactory( ScFunctionListObj_CreateInstance, ScFunctionListObj::getSupportedServiceNames_Static() )); } - else if ( aImpl == ScAutoFormatsObj::getImplementationName_Static() ) - { - xFactory.set(cppu::createOneInstanceFactory( - static_cast(pServiceManager), - ScAutoFormatsObj::getImplementationName_Static(), - ScAutoFormatsObj_CreateInstance, - ScAutoFormatsObj::getSupportedServiceNames_Static() )); - } else if ( aImpl == ScFunctionAccess::getImplementationName_Static() ) { xFactory.set(cppu::createOneInstanceFactory( @@ -144,14 +136,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL sc_component_getFactory( ScFunctionAccess_CreateInstance, ScFunctionAccess::getSupportedServiceNames_Static() )); } - else if ( aImpl == ScFilterOptionsObj::getImplementationName_Static() ) - { - xFactory.set(cppu::createSingleFactory( - static_cast(pServiceManager), - ScFilterOptionsObj::getImplementationName_Static(), - ScFilterOptionsObj_CreateInstance, - ScFilterOptionsObj::getSupportedServiceNames_Static() )); - } else if ( aImpl == ScXMLImport_getImplementationName() ) { xFactory.set(cppu::createSingleFactory( @@ -192,86 +176,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL sc_component_getFactory( ScXMLImport_Settings_createInstance, ScXMLImport_Settings_getSupportedServiceNames() )); } - else if ( aImpl == ScXMLOOoExport_getImplementationName() ) - { - xFactory = cppu::createSingleFactory( - static_cast(pServiceManager), - ScXMLOOoExport_getImplementationName(), - ScXMLOOoExport_createInstance, - ScXMLOOoExport_getSupportedServiceNames() ); - } - else if ( aImpl == ScXMLOOoExport_Meta_getImplementationName() ) - { - xFactory = cppu::createSingleFactory( - static_cast(pServiceManager), - ScXMLOOoExport_Meta_getImplementationName(), - ScXMLOOoExport_Meta_createInstance, - ScXMLOOoExport_Meta_getSupportedServiceNames() ); - } - else if ( aImpl == ScXMLOOoExport_Styles_getImplementationName() ) - { - xFactory = cppu::createSingleFactory( - static_cast(pServiceManager), - ScXMLOOoExport_Styles_getImplementationName(), - ScXMLOOoExport_Styles_createInstance, - ScXMLOOoExport_Styles_getSupportedServiceNames() ); - } - else if ( aImpl == ScXMLOOoExport_Content_getImplementationName() ) - { - xFactory = cppu::createSingleFactory( - static_cast(pServiceManager), - ScXMLOOoExport_Content_getImplementationName(), - ScXMLOOoExport_Content_createInstance, - ScXMLOOoExport_Content_getSupportedServiceNames() ); - } - else if ( aImpl == ScXMLOOoExport_Settings_getImplementationName() ) - { - xFactory = cppu::createSingleFactory( - static_cast(pServiceManager), - ScXMLOOoExport_Settings_getImplementationName(), - ScXMLOOoExport_Settings_createInstance, - ScXMLOOoExport_Settings_getSupportedServiceNames() ); - } - else if ( aImpl == ScXMLOasisExport_getImplementationName() ) - { - xFactory = cppu::createSingleFactory( - static_cast(pServiceManager), - ScXMLOasisExport_getImplementationName(), - ScXMLOasisExport_createInstance, - ScXMLOasisExport_getSupportedServiceNames() ); - } - else if ( aImpl == ScXMLOasisExport_Meta_getImplementationName() ) - { - xFactory = cppu::createSingleFactory( - static_cast(pServiceManager), - ScXMLOasisExport_Meta_getImplementationName(), - ScXMLOasisExport_Meta_createInstance, - ScXMLOasisExport_Meta_getSupportedServiceNames() ); - } - else if ( aImpl == ScXMLOasisExport_Styles_getImplementationName() ) - { - xFactory = cppu::createSingleFactory( - static_cast(pServiceManager), - ScXMLOasisExport_Styles_getImplementationName(), - ScXMLOasisExport_Styles_createInstance, - ScXMLOasisExport_Styles_getSupportedServiceNames() ); - } - else if ( aImpl == ScXMLOasisExport_Content_getImplementationName() ) - { - xFactory = cppu::createSingleFactory( - static_cast(pServiceManager), - ScXMLOasisExport_Content_getImplementationName(), - ScXMLOasisExport_Content_createInstance, - ScXMLOasisExport_Content_getSupportedServiceNames() ); - } - else if ( aImpl == ScXMLOasisExport_Settings_getImplementationName() ) - { - xFactory = cppu::createSingleFactory( - static_cast(pServiceManager), - ScXMLOasisExport_Settings_getImplementationName(), - ScXMLOasisExport_Settings_createInstance, - ScXMLOasisExport_Settings_getSupportedServiceNames() ); - } else if ( aImpl == ScDocument_getImplementationName() ) { xFactory.set(sfx2::createSfxModelFactory( @@ -280,14 +184,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL sc_component_getFactory( ScDocument_createInstance, ScDocument_getSupportedServiceNames() )); } - else if ( aImpl == ::sc::sidebar::ScPanelFactory::getImplementationName_static() ) - { - xFactory = ::cppu::createSingleFactory( - static_cast(pServiceManager), - ::sc::sidebar::ScPanelFactory::getImplementationName_static(), - ::sc::sidebar::ScPanelFactory::createInstance, - ::sc::sidebar::ScPanelFactory::getSupportedServiceNames_static() ); - } void* pRet = NULL; if (xFactory.is()) diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx index 6ccd62971391..2246df755328 100644 --- a/sc/source/ui/unoobj/filtuno.cxx +++ b/sc/source/ui/unoobj/filtuno.cxx @@ -111,27 +111,12 @@ ScFilterOptionsObj::~ScFilterOptionsObj() { } -// stuff for exService_... - -uno::Reference SAL_CALL ScFilterOptionsObj_CreateInstance( - const uno::Reference& ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +Calc_FilterOptionsDialog_get_implementation(css::uno::XComponentContext*, css::uno::Sequence const &) { SolarMutexGuard aGuard; ScDLL::Init(); - return (::cppu::OWeakObject*) new ScFilterOptionsObj; -} - -OUString ScFilterOptionsObj::getImplementationName_Static() -{ - return OUString( SCFILTEROPTIONSOBJ_IMPLNAME ); -} - -uno::Sequence ScFilterOptionsObj::getSupportedServiceNames_Static() -{ - uno::Sequence aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = SCFILTEROPTIONSOBJ_SERVICE; - return aRet; + return cppu::acquire(new ScFilterOptionsObj); } // XPropertyAccess diff --git a/sc/util/sc.component b/sc/util/sc.component index 03bb057389a3..b7b65b1c5f07 100644 --- a/sc/util/sc.component +++ b/sc/util/sc.component @@ -19,58 +19,70 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -85,7 +97,8 @@ - + -- cgit