[Libreoffice-commits] core.git: 11 commits - include/osl include/sfx2 sax/source sfx2/inc sfx2/Library_sfx.mk sfx2/source sfx2/util stoc/source stoc/util svx/source svx/util sw/inc sw/source

Matúš Kukan matus.kukan at collabora.com
Wed Jan 15 06:13:29 PST 2014


 include/osl/detail/component-defines.h                |   18 
 include/sfx2/appuno.hxx                               |   51 -
 sax/source/expatwrap/expwrap.component                |    6 
 sax/source/expatwrap/sax_expat.cxx                    |    2 
 sax/source/expatwrap/saxwriter.cxx                    |    2 
 sax/source/fastparser/fastparser.cxx                  |    2 
 sfx2/Library_sfx.mk                                   |    1 
 sfx2/inc/frmload.hxx                                  |  138 ----
 sfx2/source/appl/app.cxx                              |    1 
 sfx2/source/appl/appbas.cxx                           |    1 
 sfx2/source/appl/appbaslib.cxx                        |   55 -
 sfx2/source/appl/appdata.cxx                          |    1 
 sfx2/source/appl/appmain.cxx                          |    1 
 sfx2/source/appl/appquit.cxx                          |    1 
 sfx2/source/appl/appserv.cxx                          |    6 
 sfx2/source/appl/appuno.cxx                           |   17 
 sfx2/source/appl/xpackcreator.cxx                     |   69 +-
 sfx2/source/appl/xpackcreator.hxx                     |   68 --
 sfx2/source/bastyp/fltfnc.cxx                         |    1 
 sfx2/source/control/request.cxx                       |    1 
 sfx2/source/control/statcach.cxx                      |    1 
 sfx2/source/doc/docfile.cxx                           |    1 
 sfx2/source/doc/doctemplates.cxx                      |  129 +++-
 sfx2/source/doc/iframe.cxx                            |  114 +++
 sfx2/source/doc/objxtor.cxx                           |    1 
 sfx2/source/doc/ownsubfilterservice.cxx               |  142 ++--
 sfx2/source/doc/plugin.cxx                            |   95 ++-
 sfx2/source/inc/appbaslib.hxx                         |   30 
 sfx2/source/inc/doctemplates.hxx                      |   79 --
 sfx2/source/inc/eventsupplier.hxx                     |  137 ----
 sfx2/source/inc/iframe.hxx                            |   86 --
 sfx2/source/inc/ownsubfilterservice.hxx               |   81 --
 sfx2/source/inc/plugin.hxx                            |   85 --
 sfx2/source/notify/eventsupplier.cxx                  |  353 -----------
 sfx2/source/notify/globalevents.cxx                   |  542 ++++++++++++++++++
 sfx2/source/view/frame.cxx                            |    1 
 sfx2/source/view/frmload.cxx                          |  136 +++-
 sfx2/util/sfx.component                               |   27 
 stoc/source/defaultregistry/defaultregistry.cxx       |    2 
 stoc/source/implementationregistration/implreg.cxx    |    2 
 stoc/source/loader/dllcomponentloader.cxx             |    2 
 stoc/source/security/access_controller.cxx            |    2 
 stoc/source/security/file_policy.cxx                  |    2 
 stoc/source/servicemanager/servicemanager.cxx         |    6 
 stoc/source/simpleregistry/simpleregistry.cxx         |    2 
 stoc/util/bootstrap.component                         |   18 
 svx/source/customshapes/EnhancedCustomShapeEngine.cxx |    2 
 svx/source/sdr/primitive2d/primitivefactory2d.cxx     |    2 
 svx/source/sidebar/PanelFactory.cxx                   |    2 
 svx/source/tbxctrls/tbunocontroller.cxx               |    2 
 svx/source/tbxctrls/tbunosearchcontrollers.cxx        |   14 
 svx/source/unodraw/UnoGraphicExporter.cxx             |    2 
 svx/source/unodraw/recoveryui.cxx                     |    2 
 svx/source/unodraw/unoctabl.cxx                       |    2 
 svx/source/unodraw/unoshcol.cxx                       |    2 
 svx/source/unogallery/unogalthemeprovider.cxx         |    2 
 svx/source/xml/xmlgrhlp.cxx                           |    4 
 svx/util/svx.component                                |   28 
 svx/util/svxcore.component                            |    8 
 sw/inc/pch/precompiled_sw.hxx                         |    1 
 sw/source/ui/app/swmodule.cxx                         |    1 
 61 files changed, 1120 insertions(+), 1472 deletions(-)

New commits:
commit 921e2dc0393873ad0a972252000803ceadc290cb
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Wed Jan 15 15:08:08 2014 +0100

    Reduce the number of experimental direct constructor calls.
    
    It puts the function into binary in cases we don't want it for mobile platforms.
    We want to generate this list later anyway.
    
    Change-Id: I59be18b7b394254d845f5b2de02684c774510174

diff --git a/include/osl/detail/component-defines.h b/include/osl/detail/component-defines.h
index da6856f..058a332 100644
--- a/include/osl/detail/component-defines.h
+++ b/include/osl/detail/component-defines.h
@@ -14,28 +14,10 @@
 
 #define LO_URE_CURRENT_ENV 1 /*TODO*/
 
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_lang_dot_RegistryServiceManager 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_lang_dot_RegistryServiceManager com_sun_star_comp_stoc_ORegistryServiceManager
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_lang_dot_ServiceManager 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_lang_dot_ServiceManager com_sun_star_comp_stoc_OServiceManager
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_loader_dot_SharedLibrary 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_loader_dot_SharedLibrary com_sun_star_comp_stoc_DLLComponentLoader
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_registry_dot_ImplementationRegistration 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_registry_dot_ImplementationRegistration com_sun_star_comp_stoc_ImplementationRegistration
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_registry_dot_NestedRegistry 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_registry_dot_NestedRegistry com_sun_star_comp_stoc_NestedRegistry
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_registry_dot_SimpleRegistry 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_registry_dot_SimpleRegistry com_sun_star_comp_stoc_SimpleRegistry
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_security_dot_AccessController 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_security_dot_AccessController com_sun_star_security_comp_stoc_AccessController
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_security_dot_Policy 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_security_dot_Policy com_sun_star_security_comp_stoc_FilePolicy
 #define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_xml_dot_sax_dot_FastParser 1 /*TODO*/
 #define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_xml_dot_sax_dot_FastParser com_sun_star_comp_extensions_xml_sax_FastParser
 #define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_xml_dot_sax_dot_Parser 1 /*TODO*/
 #define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_xml_dot_sax_dot_Parser com_sun_star_comp_extensions_xml_sax_ParserExpat
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_xml_dot_sax_dot_Writer 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_xml_dot_sax_dot_Writer com_sun_star_extensions_xml_sax_Writer
 
 #endif
 
commit a700ce8e2b2f2dad50bf36dfd69de577211f1dc3
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Wed Jan 15 15:06:17 2014 +0100

    Unify ctor functions to have _get_implementation suffix.
    
    Change-Id: I07fe0671d0633ef9480a4f3431df6a64c7902db8

diff --git a/sax/source/expatwrap/expwrap.component b/sax/source/expatwrap/expwrap.component
index 306e517..6128198 100644
--- a/sax/source/expatwrap/expwrap.component
+++ b/sax/source/expatwrap/expwrap.component
@@ -20,15 +20,15 @@
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
     xmlns="http://openoffice.org/2010/uno-components">
   <implementation name="com.sun.star.comp.extensions.xml.sax.ParserExpat"
-      constructor="com_sun_star_comp_extensions_xml_sax_ParserExpat">
+      constructor="com_sun_star_comp_extensions_xml_sax_ParserExpat_get_implementation">
     <service name="com.sun.star.xml.sax.Parser"/>
   </implementation>
   <implementation name="com.sun.star.extensions.xml.sax.Writer"
-      constructor="com_sun_star_extensions_xml_sax_Writer">
+      constructor="com_sun_star_extensions_xml_sax_Writer_get_implementation">
     <service name="com.sun.star.xml.sax.Writer"/>
   </implementation>
   <implementation name="com.sun.star.comp.extensions.xml.sax.FastParser"
-      constructor="com_sun_star_comp_extensions_xml_sax_FastParser">
+      constructor="com_sun_star_comp_extensions_xml_sax_FastParser_get_implementation">
      <service name="com.sun.star.xml.sax.FastParser"/>
   </implementation>
 </component>
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index 19f2f3a..456aca2 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -1020,7 +1020,7 @@ void SaxExpatParser_Impl::callbackEndCDATA( void *pvThis )
 } // namespace
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_extensions_xml_sax_ParserExpat(
+com_sun_star_comp_extensions_xml_sax_ParserExpat_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index 38975bf..7f0d498 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -1373,7 +1373,7 @@ void SAXWriter::unknown(const OUString& sString) throw (SAXException, RuntimeExc
 } // namespace
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_extensions_xml_sax_Writer(
+com_sun_star_extensions_xml_sax_Writer_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 99a8e93..5f86b88 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -1427,7 +1427,7 @@ bool FastSaxParser::hasNamespaceURL( const OUString& rPrefix ) const
 } // namespace sax_fastparser
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_extensions_xml_sax_FastParser(
+com_sun_star_comp_extensions_xml_sax_FastParser_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx
index 977a797..ca66017 100644
--- a/stoc/source/defaultregistry/defaultregistry.cxx
+++ b/stoc/source/defaultregistry/defaultregistry.cxx
@@ -1350,7 +1350,7 @@ void SAL_CALL NestedRegistryImpl::mergeKey( const OUString& aKeyName, const OUSt
 } // namespace
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_stoc_NestedRegistry(
+com_sun_star_comp_stoc_NestedRegistry_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx
index afc6236..7b7a13c 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -1817,7 +1817,7 @@ Reference< XSimpleRegistry > ImplementationRegistration::createTemporarySimpleRe
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_stoc_ImplementationRegistration(
+com_sun_star_comp_stoc_ImplementationRegistration_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/stoc/source/loader/dllcomponentloader.cxx b/stoc/source/loader/dllcomponentloader.cxx
index bdd90c4..b8e196a 100644
--- a/stoc/source/loader/dllcomponentloader.cxx
+++ b/stoc/source/loader/dllcomponentloader.cxx
@@ -165,7 +165,7 @@ sal_Bool SAL_CALL DllComponentLoader::writeRegistryInfo(
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_stoc_DLLComponentLoader(
+com_sun_star_comp_stoc_DLLComponentLoader_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx
index 0be6b2c..9edb8c4 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -980,7 +980,7 @@ Sequence< OUString > AccessController::getSupportedServiceNames()
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_security_comp_stoc_AccessController(
+com_sun_star_security_comp_stoc_AccessController_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx
index 8dc3a47..47d1ae6 100644
--- a/stoc/source/security/file_policy.cxx
+++ b/stoc/source/security/file_policy.cxx
@@ -542,7 +542,7 @@ Sequence< OUString > FilePolicy::getSupportedServiceNames()
 } // namespace
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_security_comp_stoc_FilePolicy(
+com_sun_star_security_comp_stoc_FilePolicy_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index 5dfaba6..4253105 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -1671,7 +1671,7 @@ Any ORegistryServiceManager::getPropertyValue(const OUString& PropertyName)
 } // namespace
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_stoc_OServiceManager(
+com_sun_star_comp_stoc_OServiceManager_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
@@ -1682,7 +1682,7 @@ com_sun_star_comp_stoc_OServiceManager(
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_stoc_ORegistryServiceManager(
+com_sun_star_comp_stoc_ORegistryServiceManager_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
@@ -1693,7 +1693,7 @@ com_sun_star_comp_stoc_ORegistryServiceManager(
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_stoc_OServiceManagerWrapper(
+com_sun_star_comp_stoc_OServiceManagerWrapper_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx
index fac51ce..97fe443 100644
--- a/stoc/source/simpleregistry/simpleregistry.cxx
+++ b/stoc/source/simpleregistry/simpleregistry.cxx
@@ -1124,7 +1124,7 @@ void SimpleRegistry::mergeKey(
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_stoc_SimpleRegistry(
+com_sun_star_comp_stoc_SimpleRegistry_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/stoc/util/bootstrap.component b/stoc/util/bootstrap.component
index 81f622e..b6d5a7b 100644
--- a/stoc/util/bootstrap.component
+++ b/stoc/util/bootstrap.component
@@ -20,37 +20,37 @@
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
     xmlns="http://openoffice.org/2010/uno-components">
   <implementation name="com.sun.star.comp.stoc.DLLComponentLoader"
-      constructor="com_sun_star_comp_stoc_DLLComponentLoader">
+      constructor="com_sun_star_comp_stoc_DLLComponentLoader_get_implementation">
     <service name="com.sun.star.loader.SharedLibrary"/>
   </implementation>
   <implementation name="com.sun.star.comp.stoc.ImplementationRegistration"
-      constructor="com_sun_star_comp_stoc_ImplementationRegistration">
+      constructor="com_sun_star_comp_stoc_ImplementationRegistration_get_implementation">
     <service name="com.sun.star.registry.ImplementationRegistration"/>
   </implementation>
   <implementation name="com.sun.star.comp.stoc.NestedRegistry"
-      constructor="com_sun_star_comp_stoc_NestedRegistry">
+      constructor="com_sun_star_comp_stoc_NestedRegistry_get_implementation">
     <service name="com.sun.star.registry.NestedRegistry"/>
   </implementation>
   <implementation name="com.sun.star.comp.stoc.ORegistryServiceManager"
-      constructor="com_sun_star_comp_stoc_ORegistryServiceManager">
+      constructor="com_sun_star_comp_stoc_ORegistryServiceManager_get_implementation">
     <service name="com.sun.star.lang.RegistryServiceManager"/>
   </implementation>
   <implementation name="com.sun.star.comp.stoc.OServiceManager"
-      constructor="com_sun_star_comp_stoc_OServiceManager">
+      constructor="com_sun_star_comp_stoc_OServiceManager_get_implementation">
     <service name="com.sun.star.lang.ServiceManager"/>
   </implementation>
   <implementation name="com.sun.star.comp.stoc.OServiceManagerWrapper"
-      constructor="com_sun_star_comp_stoc_OServiceManagerWrapper"/>
+      constructor="com_sun_star_comp_stoc_OServiceManagerWrapper_get_implementation"/>
   <implementation name="com.sun.star.comp.stoc.SimpleRegistry"
-      constructor="com_sun_star_comp_stoc_SimpleRegistry">
+      constructor="com_sun_star_comp_stoc_SimpleRegistry_get_implementation">
     <service name="com.sun.star.registry.SimpleRegistry"/>
   </implementation>
   <implementation name="com.sun.star.security.comp.stoc.AccessController"
-      constructor="com_sun_star_security_comp_stoc_AccessController">
+      constructor="com_sun_star_security_comp_stoc_AccessController_get_implementation">
     <service name="com.sun.star.security.AccessController"/>
   </implementation>
   <implementation name="com.sun.star.security.comp.stoc.FilePolicy"
-      constructor="com_sun_star_security_comp_stoc_FilePolicy">
+      constructor="com_sun_star_security_comp_stoc_FilePolicy_get_implementation">
     <service name="com.sun.star.security.Policy"/>
   </implementation>
 </component>
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index c6a5feb..861c42a 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -489,7 +489,7 @@ Sequence< Reference< drawing::XCustomShapeHandle > > SAL_CALL EnhancedCustomShap
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_drawing_EnhancedCustomShapeEngine_implementation_getFactory(
+com_sun_star_drawing_EnhancedCustomShapeEngine_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/svx/source/sdr/primitive2d/primitivefactory2d.cxx b/svx/source/sdr/primitive2d/primitivefactory2d.cxx
index 7f35df7..abcdd91 100644
--- a/svx/source/sdr/primitive2d/primitivefactory2d.cxx
+++ b/svx/source/sdr/primitive2d/primitivefactory2d.cxx
@@ -88,7 +88,7 @@ Primitive2DSequence SAL_CALL PrimitiveFactory2D::createPrimitivesFromXDrawPage(
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_graphic_PrimitiveFactory2D_implementation_getFactory(
+com_sun_star_comp_graphic_PrimitiveFactory2D_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx
index 34638f8..dbf9c08 100644
--- a/svx/source/sidebar/PanelFactory.cxx
+++ b/svx/source/sidebar/PanelFactory.cxx
@@ -205,7 +205,7 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-org_apache_openoffice_comp_svx_sidebar_PanelFactory_implementation_getFactory(
+org_apache_openoffice_comp_svx_sidebar_PanelFactory_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index b29e954..cefad03 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -439,7 +439,7 @@ void FontHeightToolBoxControl::dispatchCommand(
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_svx_FontHeightToolBoxController_implementation_getFactory(
+com_sun_star_svx_FontHeightToolBoxController_get_implementation(
     css::uno::XComponentContext *rxContext,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 63ba432..79e7878 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -1050,7 +1050,7 @@ void SAL_CALL FindbarDispatcher::removeStatusListener( const css::uno::Reference
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_svx_FindTextToolboxController_implementation_getFactory(
+com_sun_star_svx_FindTextToolboxController_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
@@ -1061,7 +1061,7 @@ com_sun_star_svx_FindTextToolboxController_implementation_getFactory(
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_svx_ExitFindbarToolboxController_implementation_getFactory(
+com_sun_star_svx_ExitFindbarToolboxController_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
@@ -1072,7 +1072,7 @@ com_sun_star_svx_ExitFindbarToolboxController_implementation_getFactory(
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_svx_UpSearchToolboxController_implementation_getFactory(
+com_sun_star_svx_UpSearchToolboxController_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
@@ -1084,7 +1084,7 @@ com_sun_star_svx_UpSearchToolboxController_implementation_getFactory(
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_svx_DownSearchToolboxController_implementation_getFactory(
+com_sun_star_svx_DownSearchToolboxController_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
@@ -1096,7 +1096,7 @@ com_sun_star_svx_DownSearchToolboxController_implementation_getFactory(
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_svx_MatchCaseToolboxController_implementation_getFactory(
+com_sun_star_svx_MatchCaseToolboxController_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
@@ -1107,7 +1107,7 @@ com_sun_star_svx_MatchCaseToolboxController_implementation_getFactory(
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_svx_FindAllToolboxController_implementation_getFactory(
+com_sun_star_svx_FindAllToolboxController_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
@@ -1118,7 +1118,7 @@ com_sun_star_svx_FindAllToolboxController_implementation_getFactory(
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_svx_Impl_FindbarDispatcher_implementation_getFactory(
+com_sun_star_comp_svx_Impl_FindbarDispatcher_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 93b2802..9a21919 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -1281,7 +1281,7 @@ Graphic SvxGetGraphicForShape( SdrObject& rShape, bool bVector )
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_Draw_GraphicExporter_implementation_getFactory(
+com_sun_star_comp_Draw_GraphicExporter_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx
index 3867626..1644601 100644
--- a/svx/source/unodraw/recoveryui.cxx
+++ b/svx/source/unodraw/recoveryui.cxx
@@ -420,7 +420,7 @@ void RecoveryUI::impl_showAllRecoveredDocs()
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_svx_RecoveryUI_implementation_getFactory(
+com_sun_star_comp_svx_RecoveryUI_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index f30e6ae..c1afe3d 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -191,7 +191,7 @@ sal_Bool SAL_CALL SvxUnoColorTable::hasElements()
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_drawing_SvxUnoColorTable_implementation_getFactory(
+com_sun_star_drawing_SvxUnoColorTable_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx
index 0337734..916d1f0 100644
--- a/svx/source/unodraw/unoshcol.cxx
+++ b/svx/source/unodraw/unoshcol.cxx
@@ -269,7 +269,7 @@ uno::Sequence< OUString > SAL_CALL SvxShapeCollection::getSupportedServiceNames(
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_drawing_SvxShapeCollection_implementation_getFactory(
+com_sun_star_drawing_SvxShapeCollection_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx
index 39e50256..2400573 100644
--- a/svx/source/unogallery/unogalthemeprovider.cxx
+++ b/svx/source/unogallery/unogalthemeprovider.cxx
@@ -249,7 +249,7 @@ 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(
+com_sun_star_comp_gallery_GalleryThemeProvider_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 75bd29e..b95d38f 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -1051,7 +1051,7 @@ Sequence< OUString > SAL_CALL SvXMLGraphicImportExportHelper::getSupportedServic
     SvXMLGraphicHelper
  */
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_Svx_GraphicImportHelper_implementation_getFactory(
+com_sun_star_comp_Svx_GraphicImportHelper_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
@@ -1075,7 +1075,7 @@ com_sun_star_comp_Svx_GraphicImportHelper_implementation_getFactory(
     SvXMLGraphicHelper
  */
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_Svx_GraphicExportHelper_implementation_getFactory(
+com_sun_star_comp_Svx_GraphicExportHelper_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
diff --git a/svx/util/svx.component b/svx/util/svx.component
index 848b28e..8db99d9 100644
--- a/svx/util/svx.component
+++ b/svx/util/svx.component
@@ -20,60 +20,60 @@
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
     xmlns="http://openoffice.org/2010/uno-components">
   <implementation name="com.sun.star.comp.gallery.GalleryThemeProvider"
-      constructor="com_sun_star_comp_gallery_GalleryThemeProvider_implementation_getFactory">
+      constructor="com_sun_star_comp_gallery_GalleryThemeProvider_get_implementation">
     <service name="com.sun.star.gallery.GalleryThemeProvider"/>
   </implementation>
   <implementation name="com.sun.star.comp.svx.Impl.FindbarDispatcher"
-      constructor="com_sun_star_comp_svx_Impl_FindbarDispatcher_implementation_getFactory">
+      constructor="com_sun_star_comp_svx_Impl_FindbarDispatcher_get_implementation">
     <service name="com.sun.star.comp.svx.FindbarDispatcher"/>
     <service name="com.sun.star.frame.ProtocolHandler"/>
   </implementation>
   <implementation name="com.sun.star.comp.svx.RecoveryUI"
-      constructor="com_sun_star_comp_svx_RecoveryUI_implementation_getFactory">
+      constructor="com_sun_star_comp_svx_RecoveryUI_get_implementation">
     <service name="com.sun.star.dialog.RecoveryUI"/>
   </implementation>
   <implementation name="com.sun.star.drawing.EnhancedCustomShapeEngine"
-      constructor="com_sun_star_drawing_EnhancedCustomShapeEngine_implementation_getFactory">
+      constructor="com_sun_star_drawing_EnhancedCustomShapeEngine_get_implementation">
     <service name="com.sun.star.drawing.CustomShapeEngine"/>
   </implementation>
   <implementation name="com.sun.star.drawing.SvxShapeCollection"
-      constructor="com_sun_star_drawing_SvxShapeCollection_implementation_getFactory">
+      constructor="com_sun_star_drawing_SvxShapeCollection_get_implementation">
     <service name="com.sun.star.drawing.ShapeCollection"/>
   </implementation>
   <implementation name="com.sun.star.drawing.SvxUnoColorTable"
-      constructor="com_sun_star_drawing_SvxUnoColorTable_implementation_getFactory">
+      constructor="com_sun_star_drawing_SvxUnoColorTable_get_implementation">
     <service name="com.sun.star.drawing.ColorTable"/>
   </implementation>
   <implementation name="com.sun.star.svx.DownSearchToolboxController"
-      constructor="com_sun_star_svx_DownSearchToolboxController_implementation_getFactory">
+      constructor="com_sun_star_svx_DownSearchToolboxController_get_implementation">
     <service name="com.sun.star.frame.ToolbarController"/>
   </implementation>
   <implementation name="com.sun.star.svx.FindTextToolboxController"
-      constructor="com_sun_star_svx_FindTextToolboxController_implementation_getFactory">
+      constructor="com_sun_star_svx_FindTextToolboxController_get_implementation">
     <service name="com.sun.star.frame.ToolbarController"/>
   </implementation>
   <implementation name="com.sun.star.svx.MatchCaseToolboxController"
-      constructor="com_sun_star_svx_MatchCaseToolboxController_implementation_getFactory">
+      constructor="com_sun_star_svx_MatchCaseToolboxController_get_implementation">
     <service name="com.sun.star.frame.ToolbarController"/>
   </implementation>
   <implementation name="com.sun.star.svx.FindAllToolboxController"
-      constructor="com_sun_star_svx_FindAllToolboxController_implementation_getFactory">
+      constructor="com_sun_star_svx_FindAllToolboxController_get_implementation">
     <service name="com.sun.star.frame.ToolbarController"/>
   </implementation>
   <implementation name="com.sun.star.svx.FontHeightToolBoxController"
-      constructor="com_sun_star_svx_FontHeightToolBoxController_implementation_getFactory">
+      constructor="com_sun_star_svx_FontHeightToolBoxController_get_implementation">
     <service name="com.sun.star.frame.ToolbarController"/>
   </implementation>
   <implementation name="com.sun.star.svx.UpSearchToolboxController"
-      constructor="com_sun_star_svx_UpSearchToolboxController_implementation_getFactory">
+      constructor="com_sun_star_svx_UpSearchToolboxController_get_implementation">
     <service name="com.sun.star.frame.ToolbarController"/>
   </implementation>
   <implementation name="com.sun.star.svx.ExitFindbarToolboxController"
-      constructor="com_sun_star_svx_ExitFindbarToolboxController_implementation_getFactory">
+      constructor="com_sun_star_svx_ExitFindbarToolboxController_get_implementation">
     <service name="com.sun.star.frame.ToolbarController"/>
   </implementation>
   <implementation name="org.apache.openoffice.comp.svx.sidebar.PanelFactory"
-      constructor="org_apache_openoffice_comp_svx_sidebar_PanelFactory_implementation_getFactory">
+      constructor="org_apache_openoffice_comp_svx_sidebar_PanelFactory_get_implementation">
     <service name="com.sun.star.ui.UIElementFactory"/>
   </implementation>
 </component>
diff --git a/svx/util/svxcore.component b/svx/util/svxcore.component
index 5555c2a..1e6d1c7 100644
--- a/svx/util/svxcore.component
+++ b/svx/util/svxcore.component
@@ -19,7 +19,7 @@
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
     prefix="svxcore" xmlns="http://openoffice.org/2010/uno-components">
   <implementation name="com.sun.star.comp.Draw.GraphicExporter"
-      constructor="com_sun_star_comp_Draw_GraphicExporter_implementation_getFactory">
+      constructor="com_sun_star_comp_Draw_GraphicExporter_get_implementation">
     <service name="com.sun.star.drawing.GraphicExportFilter"/>
   </implementation>
   <implementation name="com.sun.star.comp.svx.ExtrusionDepthController">
@@ -41,17 +41,17 @@
     <service name="com.sun.star.frame.ToolbarController"/>
   </implementation>
   <implementation name="com.sun.star.comp.Svx.GraphicExportHelper"
-      constructor="com_sun_star_comp_Svx_GraphicExportHelper_implementation_getFactory">
+      constructor="com_sun_star_comp_Svx_GraphicExportHelper_get_implementation">
     <service name="com.sun.star.document.BinaryStreamResolver"/>
     <service name="com.sun.star.document.GraphicObjectResolver"/>
   </implementation>
   <implementation name="com.sun.star.comp.Svx.GraphicImportHelper"
-      constructor="com_sun_star_comp_Svx_GraphicImportHelper_implementation_getFactory">
+      constructor="com_sun_star_comp_Svx_GraphicImportHelper_get_implementation">
     <service name="com.sun.star.document.BinaryStreamResolver"/>
     <service name="com.sun.star.document.GraphicObjectResolver"/>
   </implementation>
   <implementation name="com.sun.star.comp.graphic.PrimitiveFactory2D"
-      constructor="com_sun_star_comp_graphic_PrimitiveFactory2D_implementation_getFactory">
+      constructor="com_sun_star_comp_graphic_PrimitiveFactory2D_get_implementation">
     <service name="com.sun.star.graphic.PrimitiveFactory2D"/>
   </implementation>
 </component>
commit dbd640e501b559e6910950d33b0cfd297d3a1cfd
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Wed Jan 15 14:59:38 2014 +0100

    sfx: Use constructor feature for OwnSubFilterService.
    
    Change-Id: I5bc7844c74043640494330fefc87914d4c02b768

diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index db5aea6..9f7b3e7 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -59,7 +59,6 @@
 #include <comphelper/sequence.hxx>
 #include <framework/documentundoguard.hxx>
 #include <osl/mutex.hxx>
-#include <ownsubfilterservice.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <svl/eitem.hxx>
 #include <svl/intitem.hxx>
@@ -1799,7 +1798,6 @@ SFX2_DLLPUBLIC void* SAL_CALL sfx_component_getFactory(
         IF_NAME_CREATECOMPONENTFACTORY( TestKeyHandler )
         IF_NAME_CREATECOMPONENTFACTORY( TestMouseClickHandler )
 #endif
-        IF_NAME_CREATECOMPONENTFACTORY( ::sfx2::OwnSubFilterService )
         if ( ::comp_SfxDocumentMetaData::_getImplementationName().equals(
                  OUString::createFromAscii( pImplementationName ) ) )
         {
diff --git a/sfx2/source/doc/ownsubfilterservice.cxx b/sfx2/source/doc/ownsubfilterservice.cxx
index d3b85a6..bb817db 100644
--- a/sfx2/source/doc/ownsubfilterservice.cxx
+++ b/sfx2/source/doc/ownsubfilterservice.cxx
@@ -19,63 +19,70 @@
 
 #include <com/sun/star/frame/DoubleInitializationException.hpp>
 #include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <cppuhelper/supportsservice.hxx>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/io/XStream.hpp>
 
-#include <ownsubfilterservice.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
+#include <rtl/ref.hxx>
 #include <sfx2/objsh.hxx>
 
-using namespace ::com::sun::star;
+using namespace css;
 
-namespace sfx2 {
+namespace {
 
-//-------------------------------------------------------------------------
-OwnSubFilterService::OwnSubFilterService( const uno::Reference < lang::XMultiServiceFactory >& xFactory )
-: m_xFactory( xFactory )
-, m_pObjectShell( NULL )
+class OwnSubFilterService : public cppu::WeakImplHelper2 < document::XFilter
+                                                        ,lang::XServiceInfo >
 {
-}
-
-//-------------------------------------------------------------------------
-OwnSubFilterService::~OwnSubFilterService()
+    uno::Reference< frame::XModel > m_xModel;
+    uno::Reference< io::XStream > m_xStream;
+    SfxObjectShell* m_pObjectShell;
+
+public:
+    OwnSubFilterService( const uno::Sequence< uno::Any >& aArguments )
+        throw (uno::Exception, uno::RuntimeException);
+    virtual ~OwnSubFilterService();
+
+    // XFilter
+    virtual ::sal_Bool SAL_CALL filter( const uno::Sequence< beans::PropertyValue >& aDescriptor ) throw (uno::RuntimeException);
+    virtual void SAL_CALL cancel() throw (uno::RuntimeException);
+
+    // XServiceInfo
+    virtual OUString SAL_CALL getImplementationName(  ) throw (uno::RuntimeException);
+    virtual ::sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (uno::RuntimeException);
+    virtual uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(  ) throw (uno::RuntimeException);
+};
+
+OwnSubFilterService::OwnSubFilterService( const uno::Sequence< uno::Any >& aArguments )
+    throw (uno::Exception, uno::RuntimeException)
+    : m_pObjectShell( NULL )
 {
-}
+    if ( aArguments.getLength() != 2 )
+        throw lang::IllegalArgumentException();
 
-//-------------------------------------------------------------------------
-uno::Sequence< OUString > SAL_CALL OwnSubFilterService::impl_getStaticSupportedServiceNames()
-{
-    uno::Sequence< OUString > aRet(2);
-    aRet[0] = "com.sun.star.document.OwnSubFilter";
-    aRet[1] = "com.sun.star.comp.document.OwnSubFilter";
-    return aRet;
-}
+    if ( m_pObjectShell )
+        throw frame::DoubleInitializationException();
 
-//-------------------------------------------------------------------------
-OUString SAL_CALL OwnSubFilterService::impl_getStaticImplementationName()
-{
-    return OUString("com.sun.star.comp.document.OwnSubFilter");
-}
+    if ( ( aArguments[1] >>= m_xStream ) && m_xStream.is()
+      && ( aArguments[0] >>= m_xModel ) && m_xModel.is() )
+    {
+        ::com::sun::star::uno::Reference < ::com::sun::star::lang::XUnoTunnel > xObj( m_xModel, uno::UNO_QUERY_THROW );
+        ::com::sun::star::uno::Sequence < sal_Int8 > aSeq( SvGlobalName( SFX_GLOBAL_CLASSID ).GetByteSequence() );
+        sal_Int64 nHandle = xObj->getSomething( aSeq );
+        if ( nHandle )
+            m_pObjectShell = reinterpret_cast< SfxObjectShell* >( sal::static_int_cast< sal_IntPtr >( nHandle ));
+    }
 
-//-------------------------------------------------------------------------
-uno::Reference< uno::XInterface > SAL_CALL OwnSubFilterService::impl_staticCreateSelfInstance(
-            const uno::Reference< lang::XMultiServiceFactory >& xServiceManager )
-{
-    return uno::Reference< uno::XInterface >( *new OwnSubFilterService( xServiceManager ) );
+    if ( !m_pObjectShell )
+        throw lang::IllegalArgumentException();
 }
 
-//-------------------------------------------------------------------------
-uno::Reference< lang::XSingleServiceFactory > SAL_CALL OwnSubFilterService::impl_createFactory(
-            const uno::Reference< lang::XMultiServiceFactory >& xServiceManager )
+OwnSubFilterService::~OwnSubFilterService()
 {
-    return ::cppu::createSingleFactory( xServiceManager,
-                                OwnSubFilterService::impl_getStaticImplementationName(),
-                                OwnSubFilterService::impl_staticCreateSelfInstance,
-                                OwnSubFilterService::impl_getStaticSupportedServiceNames() );
 }
 
-
-// XFilter
-
-//-------------------------------------------------------------------------
 sal_Bool SAL_CALL OwnSubFilterService::filter( const uno::Sequence< beans::PropertyValue >& aDescriptor )
     throw (uno::RuntimeException)
 {
@@ -85,48 +92,16 @@ sal_Bool SAL_CALL OwnSubFilterService::filter( const uno::Sequence< beans::Prope
     return m_pObjectShell->ImportFromGeneratedStream_Impl( m_xStream, aDescriptor );
 }
 
-//-------------------------------------------------------------------------
 void SAL_CALL OwnSubFilterService::cancel()
     throw (uno::RuntimeException)
 {
     // not implemented
 }
 
-
-// XInitialization
-
-//-------------------------------------------------------------------------
-void SAL_CALL OwnSubFilterService::initialize( const uno::Sequence< uno::Any >& aArguments )
-    throw (uno::Exception, uno::RuntimeException)
-{
-    if ( !m_xFactory.is() )
-        throw uno::RuntimeException();
-
-    if ( aArguments.getLength() != 2 )
-        throw lang::IllegalArgumentException();
-
-    if ( m_pObjectShell )
-        throw frame::DoubleInitializationException();
-
-    if ( ( aArguments[1] >>= m_xStream ) && m_xStream.is()
-      && ( aArguments[0] >>= m_xModel ) && m_xModel.is() )
-    {
-        ::com::sun::star::uno::Reference < ::com::sun::star::lang::XUnoTunnel > xObj( m_xModel, uno::UNO_QUERY_THROW );
-        ::com::sun::star::uno::Sequence < sal_Int8 > aSeq( SvGlobalName( SFX_GLOBAL_CLASSID ).GetByteSequence() );
-        sal_Int64 nHandle = xObj->getSomething( aSeq );
-        if ( nHandle )
-            m_pObjectShell = reinterpret_cast< SfxObjectShell* >( sal::static_int_cast< sal_IntPtr >( nHandle ));
-    }
-
-    if ( !m_pObjectShell )
-        throw lang::IllegalArgumentException();
-}
-
-// XServiceInfo
 OUString SAL_CALL OwnSubFilterService::getImplementationName()
     throw ( uno::RuntimeException )
 {
-    return impl_getStaticImplementationName();
+    return OUString("com.sun.star.comp.document.OwnSubFilter");
 }
 
 sal_Bool SAL_CALL OwnSubFilterService::supportsService( const OUString& ServiceName )
@@ -138,9 +113,22 @@ sal_Bool SAL_CALL OwnSubFilterService::supportsService( const OUString& ServiceN
 uno::Sequence< OUString > SAL_CALL OwnSubFilterService::getSupportedServiceNames()
     throw ( uno::RuntimeException )
 {
-    return impl_getStaticSupportedServiceNames();
+    uno::Sequence< OUString > aRet(2);
+    aRet[0] = "com.sun.star.document.OwnSubFilter";
+    aRet[1] = "com.sun.star.comp.document.OwnSubFilter";
+    return aRet;
 }
 
-} // namespace sfx2
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_document_OwnSubFilter_get_implementation(
+    css::uno::XComponentContext *,
+    css::uno::Sequence<css::uno::Any> const &arguments)
+{
+    rtl::Reference<OwnSubFilterService> x(new OwnSubFilterService(arguments));
+    x->acquire();
+    return static_cast<cppu::OWeakObject *>(x.get());
+}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/ownsubfilterservice.hxx b/sfx2/source/inc/ownsubfilterservice.hxx
deleted file mode 100644
index 3a2be4f..0000000
--- a/sfx2/source/inc/ownsubfilterservice.hxx
+++ /dev/null
@@ -1,81 +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_SFX2_SOURCE_INC_OWNSUBFILTERSERVICE_HXX
-#define INCLUDED_SFX2_SOURCE_INC_OWNSUBFILTERSERVICE_HXX
-
-#include <com/sun/star/document/XFilter.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/io/XStream.hpp>
-#include <cppuhelper/implbase3.hxx>
-
-class SfxObjectShell;
-
-namespace sfx2 {
-
-class OwnSubFilterService : public cppu::WeakImplHelper3 < ::com::sun::star::document::XFilter
-                                                        ,::com::sun::star::lang::XInitialization
-                                                        ,::com::sun::star::lang::XServiceInfo >
-{
-    ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory;
-    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel;
-    ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xStream;
-    SfxObjectShell* m_pObjectShell;
-
-public:
-
-    OwnSubFilterService(const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > &xNewFactory);
-    virtual ~OwnSubFilterService();
-
-    static ::com::sun::star::uno::Sequence< OUString > SAL_CALL
-            impl_getStaticSupportedServiceNames();
-
-    static OUString SAL_CALL impl_getStaticImplementationName();
-
-    static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
-        impl_staticCreateSelfInstance(
-            const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
-
-    static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > SAL_CALL
-        impl_createFactory(
-            const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
-
-
-    // XFilter
-    virtual ::sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) throw (::com::sun::star::uno::RuntimeException);
-    virtual void SAL_CALL cancel() throw (::com::sun::star::uno::RuntimeException);
-
-    // XInitialization
-    virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
-    // XServiceInfo
-    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);
-
-};
-
-} // namespace sfx2
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/util/sfx.component b/sfx2/util/sfx.component
index d1fee9b..286c202 100644
--- a/sfx2/util/sfx.component
+++ b/sfx2/util/sfx.component
@@ -32,7 +32,8 @@
   <implementation name="com.sun.star.comp.desktop.QuickstartWrapper">
     <service name="com.sun.star.office.Quickstart"/>
   </implementation>
-  <implementation name="com.sun.star.comp.document.OwnSubFilter">
+  <implementation name="com.sun.star.comp.document.OwnSubFilter"
+      constructor="com_sun_star_comp_document_OwnSubFilter_get_implementation">
     <service name="com.sun.star.comp.document.OwnSubFilter"/>
     <service name="com.sun.star.document.OwnSubFilter"/>
   </implementation>
commit 0791e661aeb4161d20828472845f20fa4d3772c9
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Wed Jan 15 14:43:04 2014 +0100

    sfx: Use constructor feature for OPackageStructureCreator.
    
    Change-Id: I604132c35cf95ecb3a4dad0bfef5ec50dfa58645

diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 5fb2fb7..db5aea6 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -44,7 +44,6 @@
 #include "sfxslots.hxx"
 #include "sfxtypes.hxx"
 #include "shutdownicon.hxx"
-#include "xpackcreator.hxx"
 
 #include <sal/config.h>
 #include <basic/basmgr.hxx>
@@ -1800,7 +1799,6 @@ SFX2_DLLPUBLIC void* SAL_CALL sfx_component_getFactory(
         IF_NAME_CREATECOMPONENTFACTORY( TestKeyHandler )
         IF_NAME_CREATECOMPONENTFACTORY( TestMouseClickHandler )
 #endif
-        IF_NAME_CREATECOMPONENTFACTORY( OPackageStructureCreator )
         IF_NAME_CREATECOMPONENTFACTORY( ::sfx2::OwnSubFilterService )
         if ( ::comp_SfxDocumentMetaData::_getImplementationName().equals(
                  OUString::createFromAscii( pImplementationName ) ) )
diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx
index fbe0a40f7..5fcc445 100644
--- a/sfx2/source/appl/xpackcreator.cxx
+++ b/sfx2/source/appl/xpackcreator.cxx
@@ -19,11 +19,13 @@
 
 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
 #include <com/sun/star/io/XOutputStream.hpp>
-#include <cppuhelper/supportsservice.hxx>
-
-#include "xpackcreator.hxx"
+#include <com/sun/star/embed/XPackageStructureCreator.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
 
 #include <comphelper/processfactory.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
+#include <rtl/ref.hxx>
 #include <sot/stg.hxx>
 #include <sot/storage.hxx>
 #include <tools/stream.hxx>
@@ -32,40 +34,24 @@
 #include <ucbhelper/content.hxx>
 #include <ucbhelper/commandenvironment.hxx>
 
-using namespace ::com::sun::star;
+using namespace css;
 
-//-------------------------------------------------------------------------
-uno::Sequence< OUString > SAL_CALL OPackageStructureCreator::impl_getStaticSupportedServiceNames()
-{
-    uno::Sequence< OUString > aRet(2);
-    aRet[0] = "com.sun.star.embed.PackageStructureCreator";
-    aRet[1] = "com.sun.star.comp.embed.PackageStructureCreator";
-    return aRet;
-}
-
-//-------------------------------------------------------------------------
-OUString SAL_CALL OPackageStructureCreator::impl_getStaticImplementationName()
-{
-    return OUString("com.sun.star.comp.embed.PackageStructureCreator");
-}
+namespace {
 
-//-------------------------------------------------------------------------
-uno::Reference< lang::XSingleServiceFactory > SAL_CALL OPackageStructureCreator::impl_createFactory(
-            const uno::Reference< lang::XMultiServiceFactory >& xServiceManager )
+class OPackageStructureCreator : public ::cppu::WeakImplHelper2< embed::XPackageStructureCreator,
+                                                                lang::XServiceInfo >
 {
-    return ::cppu::createOneInstanceFactory( xServiceManager,
-                                OPackageStructureCreator::impl_getStaticImplementationName(),
-                                OPackageStructureCreator::impl_staticCreateSelfInstance,
-                                OPackageStructureCreator::impl_getStaticSupportedServiceNames() );
-}
+public:
+    OPackageStructureCreator() {}
 
-//-------------------------------------------------------------------------
-uno::Reference< uno::XInterface > SAL_CALL OPackageStructureCreator::impl_staticCreateSelfInstance(
-            const uno::Reference< lang::XMultiServiceFactory >& xServiceManager )
-{
-    return uno::Reference< uno::XInterface >( *new OPackageStructureCreator( xServiceManager ) );
-}
+    // XPackageStructureCreator
+    virtual void SAL_CALL convertToPackage( const OUString& aFolderUrl, const uno::Reference< io::XOutputStream >& xTargetStream ) throw (io::IOException, uno::RuntimeException);
 
+    // XServiceInfo
+    virtual OUString SAL_CALL getImplementationName() throw (uno::RuntimeException);
+    virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (uno::RuntimeException);
+    virtual uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (uno::RuntimeException);
+};
 
 //-------------------------------------------------------------------------
 void SAL_CALL OPackageStructureCreator::convertToPackage( const OUString& aFolderUrl,
@@ -167,7 +153,7 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const OUString& aFolde
 OUString SAL_CALL OPackageStructureCreator::getImplementationName()
     throw ( uno::RuntimeException )
 {
-    return impl_getStaticImplementationName();
+    return OUString("com.sun.star.comp.embed.PackageStructureCreator");
 }
 
 sal_Bool SAL_CALL OPackageStructureCreator::supportsService( const OUString& ServiceName )
@@ -179,7 +165,22 @@ sal_Bool SAL_CALL OPackageStructureCreator::supportsService( const OUString& Ser
 uno::Sequence< OUString > SAL_CALL OPackageStructureCreator::getSupportedServiceNames()
     throw ( uno::RuntimeException )
 {
-    return impl_getStaticSupportedServiceNames();
+    uno::Sequence< OUString > aRet(2);
+    aRet[0] = "com.sun.star.embed.PackageStructureCreator";
+    aRet[1] = "com.sun.star.comp.embed.PackageStructureCreator";
+    return aRet;
+}
+
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_embed_PackageStructureCreator_get_implementation(
+    css::uno::XComponentContext *,
+    css::uno::Sequence<css::uno::Any> const &)
+{
+    rtl::Reference<OPackageStructureCreator> x(new OPackageStructureCreator());
+    x->acquire();
+    return static_cast<cppu::OWeakObject *>(x.get());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/xpackcreator.hxx b/sfx2/source/appl/xpackcreator.hxx
deleted file mode 100644
index ca90b0c..0000000
--- a/sfx2/source/appl/xpackcreator.hxx
+++ /dev/null
@@ -1,68 +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_SFX2_SOURCE_APPL_XPACKCREATOR_HXX
-#define INCLUDED_SFX2_SOURCE_APPL_XPACKCREATOR_HXX
-
-#include <com/sun/star/embed/XPackageStructureCreator.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-
-#include <cppuhelper/implbase2.hxx>
-
-
-class OPackageStructureCreator : public ::cppu::WeakImplHelper2< ::com::sun::star::embed::XPackageStructureCreator,
-                                                                ::com::sun::star::lang::XServiceInfo >
-{
-    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
-
-public:
-    OPackageStructureCreator(
-            const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory )
-    : m_xFactory( xFactory )
-    {
-        OSL_ENSURE( xFactory.is(), "No service manager is provided!\n" );
-    }
-
-    static ::com::sun::star::uno::Sequence< OUString > SAL_CALL impl_getStaticSupportedServiceNames();
-
-    static OUString SAL_CALL impl_getStaticImplementationName();
-
-    static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > SAL_CALL
-        impl_createFactory(
-            const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
-
-    static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
-        impl_staticCreateSelfInstance(
-            const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
-
-    // XPackageStructureCreator
-    virtual void SAL_CALL convertToPackage( const OUString& aFolderUrl, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xTargetStream ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
-
-    // XServiceInfo
-    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);
-
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/util/sfx.component b/sfx2/util/sfx.component
index b12d30c..d1fee9b 100644
--- a/sfx2/util/sfx.component
+++ b/sfx2/util/sfx.component
@@ -36,7 +36,8 @@
     <service name="com.sun.star.comp.document.OwnSubFilter"/>
     <service name="com.sun.star.document.OwnSubFilter"/>
   </implementation>
-  <implementation name="com.sun.star.comp.embed.PackageStructureCreator">
+  <implementation name="com.sun.star.comp.embed.PackageStructureCreator"
+      constructor="com_sun_star_comp_embed_PackageStructureCreator_get_implementation">
     <service name="com.sun.star.comp.embed.PackageStructureCreator"/>
     <service name="com.sun.star.embed.PackageStructureCreator"/>
   </implementation>
commit a16bf89a1284246d53f397c33300164ce6027863
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Wed Jan 15 13:21:00 2014 +0100

    sfx: Use constructor feature for SfxFrameLoader_Impl.
    
    Change-Id: If0e20538b85057c52a953a7559f6e7cb75d2fe33

diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx
deleted file mode 100644
index 76b094b..0000000
--- a/sfx2/inc/frmload.hxx
+++ /dev/null
@@ -1,138 +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_SFX2_INC_FRMLOAD_HXX
-#define INCLUDED_SFX2_INC_FRMLOAD_HXX
-
-#include <sfx2/sfxuno.hxx>
-#include <sfx2/objsh.hxx>
-
-#include <com/sun/star/frame/XLoadEventListener.hpp>
-#include <com/sun/star/frame/XSynchronousFrameLoader.hpp>
-#include <com/sun/star/frame/XController2.hpp>
-#include <com/sun/star/frame/XModel2.hpp>
-#include <com/sun/star/document/XExtendedFilterDetection.hpp>
-#include <com/sun/star/uno/Exception.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/task/XInteractionHandler.hpp>
-
-#include <rtl/ustring.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase3.hxx>
-#include <cppuhelper/factory.hxx>
-#include <comphelper/namedvaluecollection.hxx>
-
-class SfxFilter;
-class SfxFilterMatcher;
-
-class SAL_DLLPRIVATE SfxFrameLoader_Impl : public ::cppu::WeakImplHelper2< ::com::sun::star::frame::XSynchronousFrameLoader, ::com::sun::star::lang::XServiceInfo >
-{
-    ::com::sun::star::uno::Reference < ::com::sun::star::uno::XComponentContext >  m_aContext;
-
-public:
-                            SfxFrameLoader_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::uno::XComponentContext >& _rxContext );
-
-    SFX_DECL_XSERVICEINFO
-
-    //----------------------------------------------------------------------------------
-    // XSynchronousFrameLoader
-    //----------------------------------------------------------------------------------
-    virtual sal_Bool SAL_CALL load( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArgs, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame ) throw( ::com::sun::star::uno::RuntimeException );
-    virtual void SAL_CALL cancel() throw( ::com::sun::star::uno::RuntimeException );
-
-protected:
-    virtual                 ~SfxFrameLoader_Impl();
-
-private:
-    const SfxFilter*    impl_getFilterFromServiceName_nothrow(
-                            const OUString& i_rServiceName
-                        ) const;
-
-    OUString     impl_askForFilter_nothrow(
-                            const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& i_rxHandler,
-                            const OUString& i_rDocumentURL
-                        ) const;
-
-    const SfxFilter*    impl_detectFilterForURL(
-                            const OUString& _rURL,
-                            const ::comphelper::NamedValueCollection& i_rDescriptor,
-                            const SfxFilterMatcher& rMatcher
-                        ) const;
-
-    sal_Bool            impl_createNewDocWithSlotParam(
-                            const sal_uInt16 _nSlotID,
-                            const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rxFrame,
-                            const bool i_bHidden
-                        );
-
-    void                impl_determineFilter(
-                                  ::comphelper::NamedValueCollection& io_rDescriptor
-                        ) const;
-
-    bool                impl_determineTemplateDocument(
-                            ::comphelper::NamedValueCollection& io_rDescriptor
-                        ) const;
-
-    sal_uInt16              impl_findSlotParam(
-                            const OUString& i_rFactoryURL
-                        ) const;
-
-    SfxObjectShellRef   impl_findObjectShell(
-                            const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel2 >& i_rxDocument
-                        ) const;
-
-    void                impl_lockHiddenDocument(
-                                  SfxObjectShell& i_rDocument,
-                            const ::comphelper::NamedValueCollection& i_rDescriptor
-                        ) const;
-
-    void                impl_handleCaughtError_nothrow(
-                            const ::com::sun::star::uno::Any& i_rCaughtError,
-                            const ::comphelper::NamedValueCollection& i_rDescriptor
-                        ) const;
-
-    void                impl_removeLoaderArguments(
-                            ::comphelper::NamedValueCollection& io_rDescriptor
-                        );
-
-    sal_Int16           impl_determineEffectiveViewId_nothrow(
-                            const SfxObjectShell& i_rDocument,
-                            const ::comphelper::NamedValueCollection& i_rDescriptor
-                        );
-
-    ::comphelper::NamedValueCollection
-                        impl_extractViewCreationArgs(
-                                  ::comphelper::NamedValueCollection& io_rDescriptor
-                        );
-
-    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >
-                        impl_createDocumentView(
-                            const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel2 >& i_rModel,
-                            const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame,
-                            const ::comphelper::NamedValueCollection& i_rViewFactoryArgs,
-                            const OUString& i_rViewName
-                        );
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 4ba407c..8c6d096 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -28,8 +28,7 @@
 #include <com/sun/star/frame/XDesktop.hpp>
 #include <com/sun/star/frame/XFramesSupplier.hpp>
 #include <com/sun/star/frame/XLayoutManager.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/frame/XSynchronousFrameLoader.hpp>
 #include <com/sun/star/sdbc/DriverManager.hpp>
 #include <com/sun/star/system/SystemShellExecute.hpp>
 #include <com/sun/star/system/SystemShellExecuteFlags.hpp>
@@ -82,7 +81,6 @@
 #include <com/sun/star/frame/ModuleManager.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 
-#include "frmload.hxx"
 #include <sfx2/app.hxx>
 #include <sfx2/request.hxx>
 #include <sfx2/dispatch.hxx>
@@ -1091,7 +1089,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
                     // mechanism, and the type detection (which doesn't know about the Basic IDE).
                     Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
                     Reference< XSynchronousFrameLoader > xLoader(
-                        xContext->getServiceManager()->createInstanceWithContext(SfxFrameLoader_Impl::impl_getStaticImplementationName(), xContext),
+                        xContext->getServiceManager()->createInstanceWithContext("com.sun.star.comp.office.FrameLoader", xContext),
                         UNO_QUERY_THROW );
                     ::comphelper::NamedValueCollection aLoadArgs;
                     aLoadArgs.put( "Model", pBasicIDE->GetModel() );
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 4c9374c..5fb2fb7 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -24,7 +24,6 @@
 #include "backingcomp.hxx"
 #include "SfxDocumentMetaData.hxx"
 #include "fltoptint.hxx"
-#include "frmload.hxx"
 #include "objshimp.hxx"
 #include <sfx2/app.hxx>
 #include <sfx2/brokenpackageint.hxx>
@@ -1796,7 +1795,6 @@ SFX2_DLLPUBLIC void* SAL_CALL sfx_component_getFactory(
         //      Write no ";" at end of line and dont forget "else" ! (see macro)
         //=============================================================================
         IF_NAME_CREATECOMPONENTFACTORY( BackingComp )
-        IF_NAME_CREATECOMPONENTFACTORY( SfxFrameLoader_Impl )
         IF_NAME_CREATECOMPONENTFACTORY( ShutdownIcon )
 #ifdef TEST_HANDLERS
         IF_NAME_CREATECOMPONENTFACTORY( TestKeyHandler )
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index 4c0560d..c565c3d 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -19,7 +19,6 @@
 
 
 #include <sal/macros.h>
-#include "frmload.hxx"
 #include "objshimp.hxx"
 #include <sfx2/app.hxx>
 #include <sfx2/dispatch.hxx>
@@ -29,6 +28,7 @@
 #include <sfx2/doctempl.hxx>
 #include <sfx2/fcontnr.hxx>
 #include <sfx2/frame.hxx>
+#include <sfx2/objsh.hxx>
 #include <sfx2/request.hxx>
 #include <sfx2/sfx.hrc>
 #include <sfx2/sfxsids.hrc>
@@ -42,17 +42,22 @@
 #include <com/sun/star/frame/XFrame.hpp>
 #include <com/sun/star/frame/XLoadable.hpp>
 #include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
 #include <com/sun/star/task/XInteractionHandler2.hpp>
 #include <com/sun/star/document/XViewDataSupplier.hpp>
 #include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/frame/XSynchronousFrameLoader.hpp>
+#include <com/sun/star/frame/XController2.hpp>
+#include <com/sun/star/frame/XModel2.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
 
 #include <comphelper/interaction.hxx>
 #include <comphelper/namedvaluecollection.hxx>
-#include <comphelper/sequenceashashmap.hxx>
-#include <comphelper/processfactory.hxx>
 #include <cppuhelper/exc_hlp.hxx>
+#include <cppuhelper/implbase2.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <framework/interaction.hxx>
+#include <rtl/ref.hxx>
 #include <rtl/ustring.h>
 #include <sot/storinfo.hxx>
 #include <svtools/ehdl.hxx>
@@ -87,7 +92,6 @@ using ::com::sun::star::uno::UNO_QUERY;
 using ::com::sun::star::uno::UNO_QUERY_THROW;
 using ::com::sun::star::uno::UNO_SET_THROW;
 using ::com::sun::star::uno::makeAny;
-using ::com::sun::star::uno::XComponentContext;
 using ::com::sun::star::util::XCloseable;
 using ::com::sun::star::document::XViewDataSupplier;
 using ::com::sun::star::container::XIndexAccess;
@@ -95,7 +99,105 @@ using ::com::sun::star::frame::XController2;
 using ::com::sun::star::frame::XController;
 using ::com::sun::star::frame::XModel2;
 
-SfxFrameLoader_Impl::SfxFrameLoader_Impl( const Reference< XComponentContext >& _rxContext )
+namespace {
+
+class SfxFrameLoader_Impl : public ::cppu::WeakImplHelper2< css::frame::XSynchronousFrameLoader, css::lang::XServiceInfo >
+{
+    css::uno::Reference < css::uno::XComponentContext >  m_aContext;
+
+public:
+    SfxFrameLoader_Impl( const css::uno::Reference < css::uno::XComponentContext >& _rxContext );
+
+    virtual OUString SAL_CALL getImplementationName()
+        throw (css::uno::RuntimeException);
+
+    virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
+        throw (css::uno::RuntimeException);
+
+    virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
+        throw (css::uno::RuntimeException);
+
+    //----------------------------------------------------------------------------------
+    // XSynchronousFrameLoader
+    //----------------------------------------------------------------------------------
+    virtual sal_Bool SAL_CALL load( const css::uno::Sequence< css::beans::PropertyValue >& _rArgs, const css::uno::Reference< css::frame::XFrame >& _rxFrame ) throw( css::uno::RuntimeException );
+    virtual void SAL_CALL cancel() throw( css::uno::RuntimeException );
+
+protected:
+    virtual                 ~SfxFrameLoader_Impl();
+
+private:
+    const SfxFilter*    impl_getFilterFromServiceName_nothrow(
+                            const OUString& i_rServiceName
+                        ) const;
+
+    OUString     impl_askForFilter_nothrow(
+                            const css::uno::Reference< css::task::XInteractionHandler >& i_rxHandler,
+                            const OUString& i_rDocumentURL
+                        ) const;
+
+    const SfxFilter*    impl_detectFilterForURL(
+                            const OUString& _rURL,
+                            const ::comphelper::NamedValueCollection& i_rDescriptor,
+                            const SfxFilterMatcher& rMatcher
+                        ) const;
+
+    sal_Bool            impl_createNewDocWithSlotParam(
+                            const sal_uInt16 _nSlotID,
+                            const css::uno::Reference< css::frame::XFrame >& i_rxFrame,
+                            const bool i_bHidden
+                        );
+
+    void                impl_determineFilter(
+                                  ::comphelper::NamedValueCollection& io_rDescriptor
+                        ) const;
+
+    bool                impl_determineTemplateDocument(
+                            ::comphelper::NamedValueCollection& io_rDescriptor
+                        ) const;
+
+    sal_uInt16              impl_findSlotParam(
+                            const OUString& i_rFactoryURL
+                        ) const;
+
+    SfxObjectShellRef   impl_findObjectShell(
+                            const css::uno::Reference< css::frame::XModel2 >& i_rxDocument
+                        ) const;
+
+    void                impl_lockHiddenDocument(
+                                  SfxObjectShell& i_rDocument,
+                            const ::comphelper::NamedValueCollection& i_rDescriptor
+                        ) const;
+
+    void                impl_handleCaughtError_nothrow(
+                            const css::uno::Any& i_rCaughtError,
+                            const ::comphelper::NamedValueCollection& i_rDescriptor
+                        ) const;
+
+    void                impl_removeLoaderArguments(
+                            ::comphelper::NamedValueCollection& io_rDescriptor
+                        );
+
+    sal_Int16           impl_determineEffectiveViewId_nothrow(
+                            const SfxObjectShell& i_rDocument,
+                            const ::comphelper::NamedValueCollection& i_rDescriptor
+                        );
+
+    ::comphelper::NamedValueCollection
+                        impl_extractViewCreationArgs(
+                                  ::comphelper::NamedValueCollection& io_rDescriptor
+                        );
+
+    css::uno::Reference< css::frame::XController2 >
+                        impl_createDocumentView(
+                            const css::uno::Reference< css::frame::XModel2 >& i_rModel,
+                            const css::uno::Reference< css::frame::XFrame >& i_rFrame,
+                            const ::comphelper::NamedValueCollection& i_rViewFactoryArgs,
+                            const OUString& i_rViewName
+                        );
+};
+
+SfxFrameLoader_Impl::SfxFrameLoader_Impl( const Reference< css::uno::XComponentContext >& _rxContext )
     :m_aContext( _rxContext )
 {
 }
@@ -648,12 +750,10 @@ void SfxFrameLoader_Impl::cancel() throw( RuntimeException )
 {
 }
 
-SFX_IMPL_SINGLEFACTORY( SfxFrameLoader_Impl )
-
 /* XServiceInfo */
 OUString SAL_CALL SfxFrameLoader_Impl::getImplementationName() throw( RuntimeException )
 {
-    return impl_getStaticImplementationName();
+    return OUString("com.sun.star.comp.office.FrameLoader");
 }
                                                                                                                                 \
 /* XServiceInfo */
@@ -665,28 +765,22 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::supportsService( const OUString& sService
 /* XServiceInfo */
 Sequence< OUString > SAL_CALL SfxFrameLoader_Impl::getSupportedServiceNames() throw( RuntimeException )
 {
-    return impl_getStaticSupportedServiceNames();
-}
-
-/* Helper for XServiceInfo */
-Sequence< OUString > SfxFrameLoader_Impl::impl_getStaticSupportedServiceNames()
-{
     Sequence< OUString > seqServiceNames( 2 );
     seqServiceNames.getArray() [0] = "com.sun.star.frame.SynchronousFrameLoader";
     seqServiceNames.getArray() [1] = "com.sun.star.frame.OfficeFrameLoader";
     return seqServiceNames ;
 }
 
-/* Helper for XServiceInfo */
-OUString SfxFrameLoader_Impl::impl_getStaticImplementationName()
-{
-    return OUString( "com.sun.star.comp.office.FrameLoader" );
 }
 
-/* Helper for registry */
-Reference< css::uno::XInterface > SAL_CALL SfxFrameLoader_Impl::impl_createInstance( const Reference< XMultiServiceFactory >& xServiceManager ) throw( Exception )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_office_FrameLoader_get_implementation(
+    css::uno::XComponentContext *context,
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return Reference< css::uno::XInterface >( *new SfxFrameLoader_Impl( comphelper::getComponentContext(xServiceManager) ) );
+    rtl::Reference<SfxFrameLoader_Impl> x(new SfxFrameLoader_Impl(context));
+    x->acquire();
+    return static_cast<cppu::OWeakObject *>(x.get());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/util/sfx.component b/sfx2/util/sfx.component
index d002e4b..b12d30c 100644
--- a/sfx2/util/sfx.component
+++ b/sfx2/util/sfx.component
@@ -40,7 +40,8 @@
     <service name="com.sun.star.comp.embed.PackageStructureCreator"/>
     <service name="com.sun.star.embed.PackageStructureCreator"/>
   </implementation>
-  <implementation name="com.sun.star.comp.office.FrameLoader">
+  <implementation name="com.sun.star.comp.office.FrameLoader"
+      constructor="com_sun_star_comp_office_FrameLoader_get_implementation">
     <service name="com.sun.star.frame.SynchronousFrameLoader"/>
     <service name="com.sun.star.frame.OfficeFrameLoader"/>
   </implementation>
commit 44592540c5c3ef12875cdcab41a058092cda378d
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Wed Jan 15 13:06:35 2014 +0100

    sfx: Constructor feature for pseudo implementations.
    
    Change-Id: I18ab7ed8785c63688eecdcdb77289e1691ba793d

diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx
index 15c539d..a980606 100644
--- a/sfx2/source/appl/appbaslib.cxx
+++ b/sfx2/source/appl/appbaslib.cxx
@@ -154,63 +154,32 @@ SfxBasicManagerHolder::LegacyPsswdBinaryLimitExceeded( Sequence< OUString >& sMo
 
 //============================================================================
 // Service for application library container
-SFX_IMPL_ONEINSTANCEFACTORY( SfxApplicationDialogLibraryContainer )
 
-Sequence< OUString > SfxApplicationDialogLibraryContainer::impl_getStaticSupportedServiceNames()
-{
-    static Sequence< OUString > seqServiceNames( 1 );
-    static sal_Bool bNeedsInit = sal_True;
-
-    MutexGuard aGuard( Mutex::getGlobalMutex() );
-    if( bNeedsInit )
-    {
-        OUString* pSeq = seqServiceNames.getArray();
-        pSeq[0] = "com.sun.star.script.ApplicationDialogLibraryContainer";
-        bNeedsInit = sal_False;
-    }
-    return seqServiceNames;
-}
-
-OUString SfxApplicationDialogLibraryContainer::impl_getStaticImplementationName()
-{
-    return OUString("com.sun.star.comp.sfx2.ApplicationDialogLibraryContainer");
-}
-
-Reference< XInterface > SAL_CALL SfxApplicationDialogLibraryContainer::impl_createInstance
-    ( const Reference< XMultiServiceFactory >& )
-        throw( Exception )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_sfx2_ApplicationDialogLibraryContainer_get_implementation(
+    css::uno::XComponentContext *,
+    css::uno::Sequence<css::uno::Any> const &)
 {
     SFX_APP()->GetBasicManager();
     Reference< XInterface > xRet =
         Reference< XInterface >( SFX_APP()->GetDialogContainer(), UNO_QUERY );
-    return xRet;
+    xRet->acquire();
+    return xRet.get();
 }
 
 //============================================================================
 // Service for application library container
-SFX_IMPL_ONEINSTANCEFACTORY( SfxApplicationScriptLibraryContainer )
-
-Sequence< OUString > SfxApplicationScriptLibraryContainer::impl_getStaticSupportedServiceNames()
-{
-    Sequence< OUString > seqServiceNames( 1 );
-    OUString* pSeq = seqServiceNames.getArray();
-    pSeq[0] = "com.sun.star.script.ApplicationScriptLibraryContainer";
-    return seqServiceNames;
-}
-
-OUString SfxApplicationScriptLibraryContainer::impl_getStaticImplementationName()
-{
-    return OUString("com.sun.star.comp.sfx2.ApplicationScriptLibraryContainer");
-}
 
-Reference< XInterface > SAL_CALL SfxApplicationScriptLibraryContainer::impl_createInstance
-    ( const Reference< XMultiServiceFactory >& )
-        throw( Exception )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_sfx2_ApplicationScriptLibraryContainer_get_implementation(
+    css::uno::XComponentContext *,
+    css::uno::Sequence<css::uno::Any> const &)
 {
     SFX_APP()->GetBasicManager();
     Reference< XInterface > xRet =
         Reference< XInterface >( SFX_APP()->GetBasicContainer(), UNO_QUERY );
-    return xRet;
+    xRet->acquire();
+    return xRet.get();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index bc725fe..4c9374c 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -23,7 +23,6 @@
 
 #include "backingcomp.hxx"
 #include "SfxDocumentMetaData.hxx"
-#include "appbaslib.hxx"
 #include "fltoptint.hxx"
 #include "frmload.hxx"
 #include "objshimp.hxx"
@@ -1799,8 +1798,6 @@ SFX2_DLLPUBLIC void* SAL_CALL sfx_component_getFactory(
         IF_NAME_CREATECOMPONENTFACTORY( BackingComp )
         IF_NAME_CREATECOMPONENTFACTORY( SfxFrameLoader_Impl )
         IF_NAME_CREATECOMPONENTFACTORY( ShutdownIcon )
-        IF_NAME_CREATECOMPONENTFACTORY( SfxApplicationScriptLibraryContainer )
-        IF_NAME_CREATECOMPONENTFACTORY( SfxApplicationDialogLibraryContainer )
 #ifdef TEST_HANDLERS
         IF_NAME_CREATECOMPONENTFACTORY( TestKeyHandler )
         IF_NAME_CREATECOMPONENTFACTORY( TestMouseClickHandler )
diff --git a/sfx2/source/inc/appbaslib.hxx b/sfx2/source/inc/appbaslib.hxx
index 8c47122..8f80420 100644
--- a/sfx2/source/inc/appbaslib.hxx
+++ b/sfx2/source/inc/appbaslib.hxx
@@ -21,8 +21,6 @@
 #define INCLUDED_SFX2_SOURCE_INC_APPBASLIB_HXX
 
 #include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
 #include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
 #include <com/sun/star/embed/XStorage.hpp>
 
@@ -95,34 +93,6 @@ private:
                 ::com::sun::star::uno::Reference< ::com::sun::star::script::XStorageBasedLibraryContainer >& _out_rxContainer );
 };
 
-class SfxApplicationScriptLibraryContainer
-{
-public:
-    // Service
-    static ::com::sun::star::uno::Sequence< OUString > impl_getStaticSupportedServiceNames();
-    static OUString impl_getStaticImplementationName();
-    static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance
-        ( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager )
-            throw( ::com::sun::star::uno::Exception );
-    static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory
-        ( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
-
-};
-
-class SfxApplicationDialogLibraryContainer
-{
-public:
-    // Service
-    static ::com::sun::star::uno::Sequence< OUString > impl_getStaticSupportedServiceNames();
-    static OUString impl_getStaticImplementationName();
-    static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance
-        ( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager )
-            throw( ::com::sun::star::uno::Exception );
-    static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory
-        ( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
-
-};
-
 #endif // INCLUDED_SFX2_SOURCE_INC_APPBASLIB_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/util/sfx.component b/sfx2/util/sfx.component
index afb1bd0..d002e4b 100644
--- a/sfx2/util/sfx.component
+++ b/sfx2/util/sfx.component
@@ -49,10 +49,12 @@
     <service name="com.sun.star.frame.ProtocolHandler"/>
     <service name="com.sun.star.frame.AppDispatchProvider"/>
   </implementation>
-  <implementation name="com.sun.star.comp.sfx2.ApplicationDialogLibraryContainer">
+  <implementation name="com.sun.star.comp.sfx2.ApplicationDialogLibraryContainer"
+      constructor="com.sun.star.comp.sfx2.ApplicationDialogLibraryContainer_get_implementation">
     <service name="com.sun.star.script.ApplicationDialogLibraryContainer"/>
   </implementation>
-  <implementation name="com.sun.star.comp.sfx2.ApplicationScriptLibraryContainer">
+  <implementation name="com.sun.star.comp.sfx2.ApplicationScriptLibraryContainer"
+      constructor="com.sun.star.comp.sfx2.ApplicationScriptLibraryContainer_get_implementation">
     <service name="com.sun.star.script.ApplicationScriptLibraryContainer"/>
   </implementation>
   <implementation name="com.sun.star.comp.sfx2.DocumentTemplates"
commit ea301c7c1d65064bbc9588534fc21f12b8e0d752
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Wed Jan 15 12:45:23 2014 +0100

    sfx: Use constructor feature for SfxDocTplService.
    
    Change-Id: Ib1eb1ccf9c5fbbec84eb8f49395651e9219b7b97

diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 77b2175..bc725fe 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -24,7 +24,6 @@
 #include "backingcomp.hxx"
 #include "SfxDocumentMetaData.hxx"
 #include "appbaslib.hxx"
-#include "doctemplates.hxx"
 #include "fltoptint.hxx"
 #include "frmload.hxx"
 #include "objshimp.hxx"
@@ -1799,7 +1798,6 @@ SFX2_DLLPUBLIC void* SAL_CALL sfx_component_getFactory(
         //=============================================================================
         IF_NAME_CREATECOMPONENTFACTORY( BackingComp )
         IF_NAME_CREATECOMPONENTFACTORY( SfxFrameLoader_Impl )
-        IF_NAME_CREATECOMPONENTFACTORY( SfxDocTplService )
         IF_NAME_CREATECOMPONENTFACTORY( ShutdownIcon )
         IF_NAME_CREATECOMPONENTFACTORY( SfxApplicationScriptLibraryContainer )
         IF_NAME_CREATECOMPONENTFACTORY( SfxApplicationDialogLibraryContainer )
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index ff07ef3..11461cd 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -17,8 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
-#include "doctemplates.hxx"
 #include <osl/mutex.hxx>
 #include <tools/debug.hxx>
 #include <tools/diagnose_ex.h>
@@ -33,6 +31,8 @@
 #include <comphelper/sequenceashashmap.hxx>
 #include <comphelper/storagehelper.hxx>
 #include <comphelper/string.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/beans/XPropertySetInfo.hpp>
@@ -54,7 +54,21 @@
 #include <com/sun/star/ucb/XContentAccess.hpp>
 #include <com/sun/star/frame/ModuleManager.hpp>
 #include <com/sun/star/uno/Exception.hpp>
-
+#include <com/sun/star/task/InteractionHandler.hpp>
+#include <com/sun/star/ucb/XProgressHandler.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/frame/XDocumentTemplates.hpp>
+#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/lang/XLocalizable.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/ucb/XContent.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include <rtl/ref.hxx>
 #include <svtools/templatefoldercache.hxx>
 #include <unotools/configmgr.hxx>
 #include <unotools/ucbhelper.hxx>
@@ -68,13 +82,9 @@
 
 #include <vector>
 
-//-----------------------------------------------------------------------------
 
 //=============================================================================
 
-#define TEMPLATE_SERVICE_NAME               "com.sun.star.frame.DocumentTemplates"
-#define TEMPLATE_IMPLEMENTATION_NAME        "com.sun.star.comp.sfx2.DocumentTemplates"
-
 #define SERVICENAME_TYPEDETECTION           "com.sun.star.document.TypeDetection"
 
 #define TEMPLATE_ROOT_URL       "vnd.sun.star.hier:/templates"
@@ -118,7 +128,7 @@ using namespace ::comphelper;
 
 using ::std::vector;
 
-//=============================================================================
+namespace {
 
 class WaitWindow_Impl : public WorkWindow
 {
@@ -150,9 +160,6 @@ class GroupData_Impl;
 typedef vector< NamePair_Impl* > NameList_Impl;
 typedef vector< GroupData_Impl* > GroupList_Impl;
 
-//=============================================================================
-#include <com/sun/star/task/InteractionHandler.hpp>
-#include <com/sun/star/ucb/XProgressHandler.hpp>
 
 class TplTaskEnvironment : public ::cppu::WeakImplHelper1< ucb::XCommandEnvironment >
 {
@@ -1073,22 +1080,6 @@ sal_Bool SfxDocTplService_Impl::getProperty( Content& rContent,
     return bGotProperty;
 }
 
-// -----------------------------------------------------------------------
-// static
-bool SfxURLRelocator_Impl::propertyCanContainOfficeDir(
-                                        const OUString & rPropName )
-{
-    // Note: TargetURL is handled by UCB itself (because it is a property
-    //       with a predefined semantic). Additional Core properties introduced
-    //       be a client app must be handled by the client app itself, because
-    //       the UCB does not know the semantics of those properties.
-    return ( rPropName == TARGET_DIR_URL || rPropName == PROPERTY_DIRLIST );
-}
-
-//-----------------------------------------------------------------------------
-// public SfxDocTplService_Impl
-//-----------------------------------------------------------------------------
-
 SfxDocTplService_Impl::SfxDocTplService_Impl( const uno::Reference< XComponentContext > & xContext )
 : maRelocator( xContext )
 {
@@ -1776,7 +1767,6 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
 
     try
     {
-        uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
         uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
 
         // get document service name
@@ -1815,7 +1805,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
         // find the related type name
         OUString aTypeName;
         uno::Reference< container::XNameAccess > xFilterFactory(
-            xFactory->createInstance("com.sun.star.document.FilterFactory"),
+            mxContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.FilterFactory", mxContext),
             uno::UNO_QUERY_THROW );
 
         uno::Sequence< beans::PropertyValue > aFilterData;
@@ -1834,7 +1824,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
             mxType.is() ?
                 uno::Reference< container::XNameAccess >( mxType, uno::UNO_QUERY_THROW ) :
                 uno::Reference< container::XNameAccess >(
-                    xFactory->createInstance("com.sun.star.document.TypeDetection"),
+                    mxContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.TypeDetection", mxContext),
                     uno::UNO_QUERY_THROW );
 
         SequenceAsHashMap aTypeProps( xTypeDetection->getByName( aTypeName ) );
@@ -2173,14 +2163,63 @@ sal_Bool SfxDocTplService_Impl::renameTemplate( const OUString& rGroupName,
 }
 
 //-----------------------------------------------------------------------------
+class SfxDocTplService: public ::cppu::WeakImplHelper3< css::lang::XLocalizable, css::frame::XDocumentTemplates, css::lang::XServiceInfo >
+{
+    SfxDocTplService_Impl       *pImp;
+
+public:
+    SfxDocTplService( const css::uno::Reference < uno::XComponentContext >& xContext );
+    ~SfxDocTplService();
+
+    virtual OUString SAL_CALL getImplementationName()
+        throw (css::uno::RuntimeException)
+    {
+        return OUString("com.sun.star.comp.sfx2.DocumentTemplates");
+    }
+
+    virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
+        throw (css::uno::RuntimeException)
+    {
+        return cppu::supportsService(this, ServiceName);
+    }
+
+    virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
+        throw (css::uno::RuntimeException)
+    {
+        css::uno::Sequence< OUString > aSeq(1);
+        aSeq[0] = OUString("com.sun.star.frame.DocumentTemplates");
+        return aSeq;
+    }
 
-SFX_IMPL_XSERVICEINFO( SfxDocTplService, TEMPLATE_SERVICE_NAME, TEMPLATE_IMPLEMENTATION_NAME )
-SFX_IMPL_SINGLEFACTORY( SfxDocTplService )
+
+    // --- XLocalizable ---
+    void SAL_CALL                   setLocale( const css::lang::Locale & eLocale ) throw( css::uno::RuntimeException );
+    css::lang::Locale SAL_CALL              getLocale() throw( css::uno::RuntimeException );
+
+    // --- XDocumentTemplates ---
+    css::uno::Reference< css::ucb::XContent > SAL_CALL  getContent() throw( css::uno::RuntimeException );
+    sal_Bool SAL_CALL               storeTemplate( const OUString& GroupName,
+                                                   const OUString& TemplateName,
+                                                   const css::uno::Reference< css::frame::XStorable >& Storable ) throw( css::uno::RuntimeException );
+    sal_Bool SAL_CALL               addTemplate( const OUString& GroupName,
+                                                 const OUString& TemplateName,
+                                                 const OUString& SourceURL ) throw( css::uno::RuntimeException );
+    sal_Bool SAL_CALL               removeTemplate( const OUString& GroupName,
+                                                    const OUString& TemplateName ) throw( css::uno::RuntimeException );
+    sal_Bool SAL_CALL               renameTemplate( const OUString& GroupName,
+                                                    const OUString& OldTemplateName,
+                                                    const OUString& NewTemplateName ) throw( css::uno::RuntimeException );
+    sal_Bool SAL_CALL               addGroup( const OUString& GroupName ) throw( css::uno::RuntimeException );
+    sal_Bool SAL_CALL               removeGroup( const OUString& GroupName ) throw( css::uno::RuntimeException );
+    sal_Bool SAL_CALL               renameGroup( const OUString& OldGroupName,
+                                                 const OUString& NewGroupName ) throw( css::uno::RuntimeException );
+    void SAL_CALL                   update() throw( css::uno::RuntimeException );
+};
 
 //-----------------------------------------------------------------------------
-SfxDocTplService::SfxDocTplService( const uno::Reference< XMultiServiceFactory >& xFactory )
+SfxDocTplService::SfxDocTplService( const uno::Reference< XComponentContext >& xContext )
 {
-    pImp = new SfxDocTplService_Impl( comphelper::getComponentContext(xFactory) );
+    pImp = new SfxDocTplService_Impl(xContext);
 }
 
 //-----------------------------------------------------------------------------
@@ -2773,6 +2812,19 @@ DocTemplates_EntryData_Impl::DocTemplates_EntryData_Impl( const OUString& rTitle
     mbUpdateLink    = sal_False;
 }
 
+}
+
+// static
+bool SfxURLRelocator_Impl::propertyCanContainOfficeDir(
+                                        const OUString & rPropName )
+{
+    // Note: TargetURL is handled by UCB itself (because it is a property
+    //       with a predefined semantic). Additional Core properties introduced
+    //       be a client app must be handled by the client app itself, because
+    //       the UCB does not know the semantics of those properties.
+    return ( rPropName == TARGET_DIR_URL || rPropName == PROPERTY_DIRLIST );
+}
+
 // -----------------------------------------------------------------------
 SfxURLRelocator_Impl::SfxURLRelocator_Impl( const uno::Reference< XComponentContext > & xContext )
 : mxContext( xContext )
@@ -2843,5 +2895,14 @@ void SfxURLRelocator_Impl::makeAbsoluteURL( OUString & rURL )
     }
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_sfx2_DocumentTemplates_get_implementation(
+    css::uno::XComponentContext *context,
+    css::uno::Sequence<css::uno::Any> const &)
+{
+    rtl::Reference<SfxDocTplService> x(new SfxDocTplService(context));
+    x->acquire();
+    return static_cast<cppu::OWeakObject *>(x.get());
+}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/doctemplates.hxx b/sfx2/source/inc/doctemplates.hxx
deleted file mode 100644
index 7294a4b..0000000
--- a/sfx2/source/inc/doctemplates.hxx
+++ /dev/null
@@ -1,79 +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_SFX2_SOURCE_INC_DOCTEMPLATES_HXX
-#define INCLUDED_SFX2_SOURCE_INC_DOCTEMPLATES_HXX
-
-#include <cppuhelper/weak.hxx>
-#include <cppuhelper/implbase3.hxx>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/frame/XDocumentTemplates.hpp>
-#include <com/sun/star/frame/XStorable.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/lang/Locale.hpp>
-#include <com/sun/star/lang/XLocalizable.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/ucb/XContent.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/uno/RuntimeException.hpp>
-#include <com/sun/star/uno/XInterface.hpp>
-#include <ucbhelper/content.hxx>
-#include <sfx2/sfxuno.hxx>
-
-
-class SfxDocTplService_Impl;
-
-class SfxDocTplService: public ::cppu::WeakImplHelper3< css::lang::XLocalizable, css::frame::XDocumentTemplates, css::lang::XServiceInfo >
-{
-    SfxDocTplService_Impl       *pImp;
-
-public:
-                                    SFX_DECL_XSERVICEINFO
-
-                                    SfxDocTplService( const css::uno::Reference < css::lang::XMultiServiceFactory >& xFactory );
-                                   ~SfxDocTplService();
-
-    // --- XLocalizable ---
-    void SAL_CALL                   setLocale( const css::lang::Locale & eLocale ) throw( css::uno::RuntimeException );
-    css::lang::Locale SAL_CALL              getLocale() throw( css::uno::RuntimeException );
-
-    // --- XDocumentTemplates ---
-    css::uno::Reference< css::ucb::XContent > SAL_CALL  getContent() throw( css::uno::RuntimeException );
-    sal_Bool SAL_CALL               storeTemplate( const OUString& GroupName,
-                                                   const OUString& TemplateName,
-                                                   const css::uno::Reference< css::frame::XStorable >& Storable ) throw( css::uno::RuntimeException );
-    sal_Bool SAL_CALL               addTemplate( const OUString& GroupName,
-                                                 const OUString& TemplateName,
-                                                 const OUString& SourceURL ) throw( css::uno::RuntimeException );
-    sal_Bool SAL_CALL               removeTemplate( const OUString& GroupName,
-                                                    const OUString& TemplateName ) throw( css::uno::RuntimeException );
-    sal_Bool SAL_CALL               renameTemplate( const OUString& GroupName,
-                                                    const OUString& OldTemplateName,
-                                                    const OUString& NewTemplateName ) throw( css::uno::RuntimeException );
-    sal_Bool SAL_CALL               addGroup( const OUString& GroupName ) throw( css::uno::RuntimeException );
-    sal_Bool SAL_CALL               removeGroup( const OUString& GroupName ) throw( css::uno::RuntimeException );
-    sal_Bool SAL_CALL               renameGroup( const OUString& OldGroupName,
-                                                 const OUString& NewGroupName ) throw( css::uno::RuntimeException );
-    void SAL_CALL                   update() throw( css::uno::RuntimeException );
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/util/sfx.component b/sfx2/util/sfx.component
index 34de3eb..afb1bd0 100644
--- a/sfx2/util/sfx.component
+++ b/sfx2/util/sfx.component
@@ -55,7 +55,8 @@
   <implementation name="com.sun.star.comp.sfx2.ApplicationScriptLibraryContainer">
     <service name="com.sun.star.script.ApplicationScriptLibraryContainer"/>
   </implementation>
-  <implementation name="com.sun.star.comp.sfx2.DocumentTemplates">
+  <implementation name="com.sun.star.comp.sfx2.DocumentTemplates"
+      constructor="com_sun_star_comp_sfx2_DocumentTemplates_get_implementation">
     <service name="com.sun.star.frame.DocumentTemplates"/>
   </implementation>
   <implementation name="com.sun.star.comp.sfx2.GlobalEventBroadcaster"
commit 9b73d3a4cd9c1aea29b51b1b23d0a44c34f2f8a2
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Wed Jan 15 12:18:11 2014 +0100

    sfx: Use constructor feature for SfxGlobalEvents_Impl.
    
    Change-Id: Ie93235666e035d6a594cfbe112f7a0d935dae1c4

diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index bdd6812..f4eafa2 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -236,6 +236,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
     sfx2/source/menu/thessubmenu \
     sfx2/source/menu/virtmenu \
     sfx2/source/notify/eventsupplier \
+	sfx2/source/notify/globalevents \
     sfx2/source/notify/hintpost \
     sfx2/source/sidebar/Sidebar \
     sfx2/source/sidebar/SidebarChildWindow \
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 5699f89..77b2175 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -25,7 +25,6 @@
 #include "SfxDocumentMetaData.hxx"
 #include "appbaslib.hxx"
 #include "doctemplates.hxx"
-#include "eventsupplier.hxx"
 #include "fltoptint.hxx"
 #include "frmload.hxx"
 #include "objshimp.hxx"
@@ -1799,7 +1798,6 @@ SFX2_DLLPUBLIC void* SAL_CALL sfx_component_getFactory(
         //      Write no ";" at end of line and dont forget "else" ! (see macro)
         //=============================================================================
         IF_NAME_CREATECOMPONENTFACTORY( BackingComp )
-        IF_NAME_CREATECOMPONENTFACTORY( SfxGlobalEvents_Impl )
         IF_NAME_CREATECOMPONENTFACTORY( SfxFrameLoader_Impl )
         IF_NAME_CREATECOMPONENTFACTORY( SfxDocTplService )
         IF_NAME_CREATECOMPONENTFACTORY( ShutdownIcon )
diff --git a/sfx2/source/inc/eventsupplier.hxx b/sfx2/source/inc/eventsupplier.hxx
index 2465ca8..d8d2a8d 100644
--- a/sfx2/source/inc/eventsupplier.hxx
+++ b/sfx2/source/inc/eventsupplier.hxx
@@ -20,9 +20,9 @@
 #ifndef INCLUDED_SFX2_SOURCE_INC_EVENTSUPPLIER_HXX
 #define INCLUDED_SFX2_SOURCE_INC_EVENTSUPPLIER_HXX
 
-#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <sal/types.h>
+

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list