diff options
Diffstat (limited to 'ucbhelper')
-rw-r--r-- | ucbhelper/source/client/contentbroker.cxx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/ucbhelper/source/client/contentbroker.cxx b/ucbhelper/source/client/contentbroker.cxx index 0d865478bd8a..b38b421c4370 100644 --- a/ucbhelper/source/client/contentbroker.cxx +++ b/ucbhelper/source/client/contentbroker.cxx @@ -43,6 +43,12 @@ #include <com/sun/star/ucb/XCommandProcessor.hpp> #include <ucbhelper/contentbroker.hxx> +#ifdef ANDROID +#include <cppuhelper/bootstrap.hxx> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <ucbhelper/configurationkeys.hxx> +#endif + #ifdef DISABLE_DYNLOADING #define MSF_CREATEINSTANCE(Msf, Service) \ @@ -220,6 +226,38 @@ sal_Bool ContentBroker::initialize( return m_pTheBroker != 0; } +#ifdef ANDROID + +extern "C" __attribute__ ((visibility("default"))) void +InitUCBHelper() +{ + Reference< XMultiServiceFactory > xFactory; + try + { + Reference< XComponentContext > xCtx = ::cppu::defaultBootstrap_InitialComponentContext(); + xFactory = Reference< XMultiServiceFactory >( xCtx->getServiceManager(), + UNO_QUERY ); + } + catch( Exception& ) + { + } + + if( !xFactory.is() ) + { + fprintf( stderr, + "Could not bootstrap UNO, installation must be in disorder. Exiting.\n" ); + exit( 1 ); + } + + // Create UCB. + Sequence< Any > aArgs( 2 ); + aArgs[ 0 ] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY1_LOCAL )); + aArgs[ 1 ] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY2_OFFICE )); + ::ucbhelper::ContentBroker::initialize( xFactory, aArgs ); +} + +#endif + //========================================================================= // static void ContentBroker::deinitialize() |