diff options
-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(); |