diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-18 20:31:56 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-18 20:33:37 +0100 |
commit | adfb02be9a326e3be37bcb0511986826027ce5f5 (patch) | |
tree | 95d5f66bc289f1f4ae3ec6ce5f3f97b2f420fc6e /vcl/source | |
parent | 5712a06f2c6f0616df777053242803c3723bc743 (diff) |
rework Init/Main ui-previewer post early language detect
i.e. due to d07e7d692ddd2a9ab956a59bcc0f676c7d76bc10
"wait until we know the UI language before initializing gtk"
we need to have uno working earlier
Change-Id: I77dbea78113c1c95b622a2367472a0111d0d32d1
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/uipreviewer/previewer.cxx | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/vcl/source/uipreviewer/previewer.cxx b/vcl/source/uipreviewer/previewer.cxx index 9cf4fe7177a5..923c79dfb946 100644 --- a/vcl/source/uipreviewer/previewer.cxx +++ b/vcl/source/uipreviewer/previewer.cxx @@ -23,11 +23,28 @@ class UIPreviewApp : public Application { public: + virtual void Init(); virtual int Main(); }; using namespace com::sun::star; +void UIPreviewApp::Init() +{ + uno::Reference<uno::XComponentContext> xContext = + cppu::defaultBootstrap_InitialComponentContext(); + uno::Reference<lang::XMultiComponentFactory> xFactory = + xContext->getServiceManager(); + uno::Reference<lang::XMultiServiceFactory> xSFactory = + uno::Reference<lang::XMultiServiceFactory> (xFactory, uno::UNO_QUERY_THROW); + comphelper::setProcessServiceFactory(xSFactory); + + // Create UCB (for backwards compatibility, in case some code still uses + // plain createInstance w/o args directly to obtain an instance): + ::ucb::UniversalContentBroker::create( + comphelper::getProcessComponentContext() ); +} + int UIPreviewApp::Main() { std::vector<OUString> uifiles; @@ -44,19 +61,6 @@ int UIPreviewApp::Main() return EXIT_FAILURE; } - uno::Reference<uno::XComponentContext> xContext = - cppu::defaultBootstrap_InitialComponentContext(); - uno::Reference<lang::XMultiComponentFactory> xFactory = - xContext->getServiceManager(); - uno::Reference<lang::XMultiServiceFactory> xSFactory = - uno::Reference<lang::XMultiServiceFactory> (xFactory, uno::UNO_QUERY_THROW); - comphelper::setProcessServiceFactory(xSFactory); - - // Create UCB (for backwards compatibility, in case some code still uses - // plain createInstance w/o args directly to obtain an instance): - ::ucb::UniversalContentBroker::create( - comphelper::getProcessComponentContext() ); - // turn on tooltips Help::EnableQuickHelp(); |