Kaydet (Commit) adfb02be authored tarafından Caolán McNamara's avatar Caolán McNamara

rework Init/Main ui-previewer post early language detect

i.e. due to d07e7d69
"wait until we know the UI language before initializing gtk"
we need to have uno working earlier

Change-Id: I77dbea78113c1c95b622a2367472a0111d0d32d1
üst 5712a06f
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment