diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-01-19 11:15:15 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-01-19 11:27:40 -0500 |
commit | c3ccdabbb73bf84fa7516892683a23b1aa9ce4dd (patch) | |
tree | 0750b1ef9bc6c24ae86463cfe3bae57e004d3ee3 /desktop | |
parent | 5d0fe3c2ee20168384330b59b3367c47a31225d6 (diff) |
Create process service factory early in all platforms.
Just so that we can remove one #ifdef UNX guard. The less of those
the easier to maintain.
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/inc/app.hxx | 4 | ||||
-rw-r--r-- | desktop/source/app/app.cxx | 19 | ||||
-rw-r--r-- | desktop/source/app/sofficemain.cxx | 2 |
3 files changed, 7 insertions, 18 deletions
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index d3c5c7f9d641..a525a2960440 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -137,9 +137,7 @@ class Desktop : public Application void SetSplashScreenText( const ::rtl::OUString& rText ); void SetSplashScreenProgress( sal_Int32 ); -#ifdef UNX - void EarlyCommandLineArgsPrepare(); -#endif + void CreateProcessServiceFactory(); private: // Bootstrap methods diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index eebde7d342bf..a521e3ff2706 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -670,18 +670,11 @@ void Desktop::Init() } } - // create service factory... - if( !::comphelper::getProcessServiceFactory().is()) // may be set from Desktop::EarlyCommandLineArgsPrepare() + // We need to have service factory before going further. + if( !::comphelper::getProcessServiceFactory().is()) { - Reference < XMultiServiceFactory > rSMgr = CreateApplicationServiceManager(); - if( rSMgr.is() ) - { - ::comphelper::setProcessServiceFactory( rSMgr ); - } - else - { - SetBootstrapError( BE_UNO_SERVICEMANAGER ); - } + OSL_ENSURE(0, "Service factory should have been crated in soffice_main()."); + SetBootstrapError( BE_UNO_SERVICEMANAGER ); } if ( GetBootstrapError() == BE_OK ) @@ -727,10 +720,9 @@ void Desktop::InitFinished() CloseSplashScreen(); } -#ifdef UNX // GetCommandLineArgs() requires this code to work, otherwise it will abort, and // on Unix command line args needs to be checked before Desktop::Init() -void Desktop::EarlyCommandLineArgsPrepare() +void Desktop::CreateProcessServiceFactory() { Reference < XMultiServiceFactory > rSMgr = CreateApplicationServiceManager(); if( rSMgr.is() ) @@ -738,7 +730,6 @@ void Desktop::EarlyCommandLineArgsPrepare() ::comphelper::setProcessServiceFactory( rSMgr ); } } -#endif void Desktop::DeInit() { diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index b964fd420c86..a4207ef97bfd 100644 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -49,10 +49,10 @@ extern "C" int soffice_main() desktop::Desktop aDesktop; // This string is used during initialization of the Gtk+ VCL module aDesktop.SetAppName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("soffice")) ); + aDesktop.CreateProcessServiceFactory(); #ifdef UNX // handle --version and --help already here, otherwise they would be handled // after VCL initialization that might fail if $DISPLAY is not set - aDesktop.EarlyCommandLineArgsPrepare(); desktop::CommandLineArgs* pCmdLineArgs = aDesktop.GetCommandLineArgs(); if ( pCmdLineArgs->IsHelp() ) { |