Blame SOURCES/0193-lok-Document-initializeForRendering-handle-lack-of-l.patch

135360
From ad9dac7f0a8c7f2e9225a519334a274c215ad351 Mon Sep 17 00:00:00 2001
135360
From: Miklos Vajna <vmiklos@collabora.co.uk>
135360
Date: Thu, 8 Oct 2015 10:27:53 +0200
135360
Subject: [PATCH 193/398] lok::Document::initializeForRendering(): handle lack
135360
 of lok_init()
135360
135360
Normally lok_init() sets the component context, but not e.g. during unit
135360
testing.
135360
135360
Change-Id: If3760f31af2e4b870f65e5aa7557607e8b6a1114
135360
(cherry picked from commit de1f156c6a35757d74b0e337b02743f1962ff0ae)
135360
---
135360
 desktop/source/lib/init.cxx | 8 ++++++++
135360
 1 file changed, 8 insertions(+)
135360
135360
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
135360
index 836fc00e1042..b69e58a4af1f 100644
135360
--- a/desktop/source/lib/init.cxx
135360
+++ b/desktop/source/lib/init.cxx
135360
@@ -568,6 +568,14 @@ static void doc_iniUnoCommands ()
135360
         return;
135360
     }
135360
 
135360
+    if (!xContext.is())
135360
+        xContext = comphelper::getProcessComponentContext();
135360
+    if (!xContext.is())
135360
+    {
135360
+        SAL_WARN("lok", "iniUnoCommands: Component context is not available");
135360
+        return;
135360
+    }
135360
+
135360
     SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool(pViewFrame);
135360
     uno::Reference<util::XURLTransformer> xParser(util::URLTransformer::create(xContext));
135360
 
135360
-- 
135360
2.12.0
135360