Kaydet (Commit) c7e35d99 authored tarafından Miklos Vajna's avatar Miklos Vajna

lok::Document::initializeForRendering(): handle lack of lok_init()

Normally lok_init() sets the component context, but not e.g. during unit
testing.

Change-Id: If3760f31af2e4b870f65e5aa7557607e8b6a1114
(cherry picked from commit de1f156c)
üst c2ab2f9a
...@@ -573,6 +573,14 @@ static void doc_iniUnoCommands () ...@@ -573,6 +573,14 @@ static void doc_iniUnoCommands ()
return; return;
} }
if (!xContext.is())
xContext = comphelper::getProcessComponentContext();
if (!xContext.is())
{
SAL_WARN("lok", "iniUnoCommands: Component context is not available");
return;
}
SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool(pViewFrame); SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool(pViewFrame);
uno::Reference<util::XURLTransformer> xParser(util::URLTransformer::create(xContext)); uno::Reference<util::XURLTransformer> xParser(util::URLTransformer::create(xContext));
......
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