summaryrefslogtreecommitdiff
path: root/ucbhelper
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-03-28 11:22:52 +0300
committerTor Lillqvist <tml@iki.fi>2012-03-29 09:49:43 +0300
commit0487871af64c83ecfc9d424f64357655b44aa923 (patch)
tree5bbba817e65afc78fa7165caece807654a0ecfdb /ucbhelper
parent29e0cf9fe6f2ec084d78bfd37f30875ba9d3068d (diff)
Revert "Initial experiments with static linking of (some) ..."
Thist idea caused too intrusive changes to the code of call sites, I think. Will do it another way that leaves call sites as is. This reverts commit 25d114eec4d451acdda1ddff4c8ed9d47ba6275f.
Diffstat (limited to 'ucbhelper')
-rw-r--r--ucbhelper/inc/ucbhelper/macros.hxx39
-rw-r--r--ucbhelper/source/client/contentbroker.cxx34
2 files changed, 16 insertions, 57 deletions
diff --git a/ucbhelper/inc/ucbhelper/macros.hxx b/ucbhelper/inc/ucbhelper/macros.hxx
index 445de8a05e26..302be2132f05 100644
--- a/ucbhelper/inc/ucbhelper/macros.hxx
+++ b/ucbhelper/inc/ucbhelper/macros.hxx
@@ -732,40 +732,19 @@ XSERVICEINFO_CREATE_INSTANCE_IMPL( Class ) \
com::sun::star::uno::Sequence< rtl::OUString > \
Class::getSupportedServiceNames_Static()
-#ifdef DISABLE_DYNLOADING
-
-#define STATICALLY_LINKED_SERVICE( Class, ImplName, Service, Num ) \
-extern com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > service##Num( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &rSMgr ) \
- __asm("SSF:" Service); \
+// 1 service name
+#define XSERVICEINFO_IMPL_1( Class, ImplName, Service1 ) \
+XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
+XSERVICEINFO_CREATE_INSTANCE_IMPL( Class ) \
\
-com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > service##Num( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &rSMgr ) \
+com::sun::star::uno::Sequence< rtl::OUString > \
+Class::getSupportedServiceNames_Static() \
{ \
- com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > xFactory( Class::createServiceFactory( rSMgr ) ); \
- xFactory->acquire(); \
- return xFactory; \
+ com::sun::star::uno::Sequence< rtl::OUString > aSNS( 1 ); \
+ aSNS.getArray()[ 0 ] = Service1; \
+ return aSNS; \
}
-#else
-
-#define STATICALLY_LINKED_SERVICE( Class, ImplName, Service, Num ) // empty
-
-#endif
-
-// 1 service name
-#define XSERVICEINFO_IMPL_1( Class, ImplName, Service1 ) \
-XSERVICEINFO_COMMOM_IMPL( Class, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ImplName )) ) \
-XSERVICEINFO_CREATE_INSTANCE_IMPL( Class ) \
- \
-com::sun::star::uno::Sequence< rtl::OUString > \
-Class::getSupportedServiceNames_Static() \
-{ \
- com::sun::star::uno::Sequence< rtl::OUString > aSNS( 1 ); \
- aSNS.getArray()[ 0 ] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( Service1 )); \
- return aSNS; \
-} \
- \
-STATICALLY_LINKED_SERVICE( Class, ImplName, Service1, 1 )
-
#endif /* !_UCBHELPER_MACROS_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucbhelper/source/client/contentbroker.cxx b/ucbhelper/source/client/contentbroker.cxx
index b38b421c4370..d1eb179b5b78 100644
--- a/ucbhelper/source/client/contentbroker.cxx
+++ b/ucbhelper/source/client/contentbroker.cxx
@@ -34,7 +34,6 @@
*************************************************************************/
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/ucb/XContentIdentifierFactory.hpp>
@@ -49,30 +48,6 @@
#include <ucbhelper/configurationkeys.hxx>
#endif
-#ifdef DISABLE_DYNLOADING
-
-#define MSF_CREATEINSTANCE(Msf, Service) \
-({ \
- extern com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > service( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &rSMgr ) __asm("SSF:" Service); \
- com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > xFactory( service( Msf ) ); \
- xFactory->createInstance(); \
-})
-
-#define MSF_CREATEINSTANCE_WITHARGUMENTS(Msf, Service, Args) \
-({ \
- extern com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > service( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &rSMgr ) __asm("SSF:" Service); \
- com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > xFactory( service( Msf ) ); \
- xFactory->createInstanceWithArguments( Args ); \
-})
-
-#else
-
-#define MSF_CREATEINSTANCE(Msf, Service) Msf->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( Service )) )
-
-#define MSF_CREATEINSTANCE_WITHARGUMENTS(Msf, Service, Args) Msf->createInstanceWithArguments( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( Service )), Args )
-
-#endif
-
using namespace com::sun::star::lang;
using namespace com::sun::star::ucb;
using namespace com::sun::star::uno;
@@ -311,7 +286,9 @@ bool ContentBroker_Impl::initialize()
{
try
{
- xIfc = MSF_CREATEINSTANCE( m_xSMgr, "com.sun.star.ucb.UniversalContentBroker" );
+ xIfc = m_xSMgr->createInstance(
+ OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.ucb.UniversalContentBroker" )) );
}
catch ( Exception const & )
{
@@ -343,7 +320,10 @@ bool ContentBroker_Impl::initialize()
{
try
{
- xIfc = MSF_CREATEINSTANCE_WITHARGUMENTS( m_xSMgr, "com.sun.star.ucb.UniversalContentBroker", m_aArguments );
+ xIfc = m_xSMgr->createInstanceWithArguments(
+ OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.ucb.UniversalContentBroker" )),
+ m_aArguments );
}
catch ( Exception const & )
{