diff options
author | Jörg Budischewski <jbu@openoffice.org> | 2002-10-01 09:41:46 +0000 |
---|---|---|
committer | Jörg Budischewski <jbu@openoffice.org> | 2002-10-01 09:41:46 +0000 |
commit | 4f5976c38322a993c5c7f9afd000178dd9f3322c (patch) | |
tree | e53b5e54f7965c5ad6af12b47a039dd96a467e66 /padmin/source/pamain.cxx | |
parent | new version for SRC641 (diff) | |
download | core-4f5976c38322a993c5c7f9afd000178dd9f3322c.tar.gz core-4f5976c38322a993c5c7f9afd000178dd9f3322c.zip |
#103263# switched to default bootstrapping
Diffstat (limited to 'padmin/source/pamain.cxx')
-rw-r--r-- | padmin/source/pamain.cxx | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/padmin/source/pamain.cxx b/padmin/source/pamain.cxx index 8a9456e400a1..610081459a31 100644 --- a/padmin/source/pamain.cxx +++ b/padmin/source/pamain.cxx @@ -2,9 +2,9 @@ * * $RCSfile: pamain.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: pl $ $Date: 2001-09-04 16:24:50 $ + * last change: $Author: jbu $ $Date: 2002-10-01 10:41:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,8 +78,8 @@ #include <helper.hxx> #endif -#ifndef _CPPUHELPER_SERVICEFACTORY_HXX_ -#include <cppuhelper/servicefactory.hxx> +#ifndef _CPPUHELPER_BOOTSTRAP_HXX_ +#include <cppuhelper/bootstrap.hxx> #endif #ifndef _COMPHELPER_PROCESSFACTORY_HXX_ @@ -94,6 +94,10 @@ #include <ucbhelper/configurationkeys.hxx> #endif +#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#endif + using namespace padmin; using namespace rtl; using namespace cppu; @@ -133,30 +137,8 @@ void MyApp::Main() //------------------------------------------------- // create the global service-manager //------------------------------------------------- - - OUString aReadRdbName( Application::GetAppFileName() ); - int nLastSlash = aReadRdbName.lastIndexOf( '/' ); - if( nLastSlash >= 0 ) - aReadRdbName = aReadRdbName.copy( 0, nLastSlash+1 ); - else - aReadRdbName = OUString(); - aReadRdbName += OUString::createFromAscii( "applicat.rdb" ); - - OUString aWriteRdbName( OUString::createFromAscii( "/tmp/padmin" ) ); - aWriteRdbName += OUString::valueOf( (sal_Int32)getpid() ); - aWriteRdbName += OUString::createFromAscii( ".rdb" ); - -#ifdef DEBUG - printf( "using write registry %s\n", OUStringToOString( aWriteRdbName, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); - printf( "using read registry %s\n", OUStringToOString( aReadRdbName, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); -#endif - Reference< XMultiServiceFactory > xFactory( createRegistryServiceFactory( aWriteRdbName, aReadRdbName ) ); - if( xFactory.is() ) - setProcessServiceFactory( xFactory ); -#ifdef DEBUG - else - fprintf( stderr, "could not create service factory\n" ); -#endif + Reference< XComponentContext > xCtx = defaultBootstrap_InitialComponentContext(); + Reference< XMultiServiceFactory > xFactory( xCtx->getServiceManager(), UNO_QUERY ); /* * Create UCB. @@ -181,6 +163,4 @@ void MyApp::Main() */ ::ucb::ContentBroker::deinitialize(); - OString aTmp( OUStringToOString( aWriteRdbName, RTL_TEXTENCODING_ISO_8859_1 ) ); - unlink( aTmp.getStr() ); } |