[Libreoffice-commits] .: Branch 'libreoffice-3-6' - desktop/inc desktop/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Sep 25 00:53:52 PDT 2012
desktop/inc/app.hxx | 6 +++---
desktop/source/app/app.cxx | 2 +-
desktop/source/app/appinit.cxx | 9 +++++----
desktop/source/app/sofficemain.cxx | 2 ++
4 files changed, 11 insertions(+), 8 deletions(-)
New commits:
commit 3223ae5224ee17a501f251ba88ea3e4debb18e07
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Sep 24 17:41:51 2012 +0200
fdo#54385: Displaying help/version early on UNX requires service manager
This regression was introduced with 6c6358a6822d3562b9b8c7668a7d60d6c644dfe8
"Related fdo#53006: Do not instantiate service manager too early."
Change-Id: If22ea3ac6474188bf0792246620e5c705a813445
(cherry picked from commit 2f14e2e67c58fe6948501d57a38cd0d2ad84dfff)
Reviewed-on: https://gerrit.libreoffice.org/694
Reviewed-by: Miklos Vajna <vmiklos at suse.cz>
Tested-by: Miklos Vajna <vmiklos at suse.cz>
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 8805c57..ecfd014 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -140,11 +140,11 @@ class Desktop : public Application
void SetSplashScreenText( const ::rtl::OUString& rText );
void SetSplashScreenProgress( sal_Int32 );
- private:
// Bootstrap methods
- static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > CreateApplicationServiceManager();
- // returns a non-null reference or throws an exception
+ static void InitApplicationServiceManager();
+ // throws an exception upon failure
+ private:
void RegisterServices();
void DeregisterServices();
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index ea350ca..a5177dd 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -592,7 +592,7 @@ void Desktop::Init()
// something to enforce this gotcha
try
{
- comphelper::setProcessServiceFactory(CreateApplicationServiceManager());
+ InitApplicationServiceManager();
}
catch (css::uno::Exception & e)
{
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index 4b33cb2..7a32d13 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -163,20 +163,21 @@ static bool configureUcb()
return ret;
}
-Reference< XMultiServiceFactory > Desktop::CreateApplicationServiceManager()
+void Desktop::InitApplicationServiceManager()
{
RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::createApplicationServiceManager" );
-
+ Reference<XMultiServiceFactory> sm;
#ifdef ANDROID
rtl::OUString aUnoRc( OUString( "file:///assets/program/unorc" ) );
- return Reference<XMultiServiceFactory>(
+ sm.set(
cppu::defaultBootstrap_InitialComponentContext( aUnoRc )->getServiceManager(),
UNO_QUERY_THROW);
#else
- return Reference<XMultiServiceFactory>(
+ sm.set(
cppu::defaultBootstrap_InitialComponentContext()->getServiceManager(),
UNO_QUERY_THROW);
#endif
+ comphelper::setProcessServiceFactory(sm);
}
void Desktop::DestroyApplicationServiceManager( Reference< XMultiServiceFactory >& xSMgr )
diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index e867601..9463b51 100755
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -62,11 +62,13 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main()
const desktop::CommandLineArgs& rCmdLineArgs = aDesktop.GetCommandLineArgs();
if ( rCmdLineArgs.IsHelp() )
{
+ desktop::Desktop::InitApplicationServiceManager();
desktop::displayCmdlineHelp();
return EXIT_SUCCESS;
}
else if ( rCmdLineArgs.IsVersion() )
{
+ desktop::Desktop::InitApplicationServiceManager();
desktop::displayVersion();
return EXIT_SUCCESS;
}
More information about the Libreoffice-commits
mailing list