summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-02-27 13:18:36 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-03-05 10:16:08 -0600
commit42df210d4b2132bea2850e5320abf8d5984c2017 (patch)
tree3816b053b736105544b3143090481a9bfa5e3bfe
parent2ce63885fefe1e9a0fdf1ee983d9d19aa1426063 (diff)
fdo#75540 setProcessServiceFactory must be called before InitVCLlibreoffice-4-2-2
...because InitVCL now calls: > comphelper::getProcessServiceFactory > comphelper::getProcessComponentContext > utl::DefaultFontConfiguration::DefaultFontConfiguration > rtl::Static<utl::DefaultFontConfiguration, (anonymous namespace)::theDefaultFontConfiguration>::get > utl::DefaultFontConfiguration::get > ImplStyleData::SetStandardStyles > ImplStyleData::ImplStyleData > boost::make_shared<ImplStyleData> > StyleSettings::StyleSettings > ImplAllSettingsData::ImplAllSettingsData > boost::make_shared<ImplAllSettingsData> > AllSettings::AllSettings > Application::InitSettings > Application::GetSettings > GtkInstance::AfterAppInit > InitVCL > ImplSVMain > SVMain > sal_main > main and Application::Main is only called after InitVCL. (cherry picked from commit c828e3cc409077a1916911b8abf1d7b8dbb2078a) Conflicts: padmin/source/pamain.cxx Change-Id: I1126e33f454a4ea35ef295cbd3f48429c473efb4 Reviewed-on: https://gerrit.libreoffice.org/8381 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: David Tardon <dtardon@redhat.com>
-rw-r--r--padmin/source/pamain.cxx54
1 files changed, 30 insertions, 24 deletions
diff --git a/padmin/source/pamain.cxx b/padmin/source/pamain.cxx
index bbccadf032c1..b510f991cf6e 100644
--- a/padmin/source/pamain.cxx
+++ b/padmin/source/pamain.cxx
@@ -51,6 +51,11 @@ public:
virtual sal_uInt16 Exception( sal_uInt16 nError );
static OUString ReadStringHook( const OUString& );
+
+private:
+ virtual void Init() SAL_OVERRIDE;
+
+ Reference< XComponentContext > xCtx_;
};
void vclmain::createApplication()
@@ -84,35 +89,13 @@ int MyApp::Main()
EnableAutoHelpId();
- //-------------------------------------------------
- // create the global service-manager
- //-------------------------------------------------
- Reference< XComponentContext > xCtx;
- Reference< XMultiServiceFactory > xFactory;
- try
- {
- xCtx = defaultBootstrap_InitialComponentContext();
- xFactory = Reference< XMultiServiceFactory >( xCtx->getServiceManager(), UNO_QUERY );
- if( xFactory.is() )
- setProcessServiceFactory( xFactory );
- }
- catch( const com::sun::star::uno::Exception& )
- {
- }
-
- if( ! xFactory.is() )
- {
- fprintf( stderr, "Could not bootstrap UNO, installation must be in disorder. Exiting.\n" );
- exit( 1 );
- }
-
// Detect desktop environment - need to do this as early as possible
com::sun::star::uno::setCurrentContext(
new DesktopContext( com::sun::star::uno::getCurrentContext() ) );
// Create UCB (for backwards compatibility, in case some code still uses
// plain createInstance w/o args directly to obtain an instance):
- com::sun::star::ucb::UniversalContentBroker::create(xCtx);
+ com::sun::star::ucb::UniversalContentBroker::create(xCtx_);
/*
* Initialize the Java UNO AccessBridge if accessibility is turned on
@@ -139,7 +122,7 @@ int MyApp::Main()
*/
try
{
- Reference<XComponent> xComp(xCtx, UNO_QUERY_THROW);
+ Reference<XComponent> xComp(xCtx_, UNO_QUERY_THROW);
xComp->dispose();
}
catch(...)
@@ -149,4 +132,27 @@ int MyApp::Main()
return EXIT_SUCCESS;
}
+void MyApp::Init()
+{
+ // create the global service-manager
+
+ Reference< XMultiServiceFactory > xFactory;
+ try
+ {
+ xCtx_ = defaultBootstrap_InitialComponentContext();
+ xFactory = Reference< XMultiServiceFactory >( xCtx_->getServiceManager(), UNO_QUERY );
+ if( xFactory.is() )
+ setProcessServiceFactory( xFactory );
+ }
+ catch( const com::sun::star::uno::Exception& )
+ {
+ }
+
+ if( ! xFactory.is() )
+ {
+ fprintf( stderr, "Could not bootstrap UNO, installation must be in disorder. Exiting.\n" );
+ exit( 1 );
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */