Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi there,

        I was just trying to chase down the reason why custom shapes would bust
loading in the android port; still not quite to the bottom of why they
initialize these language-checkers so early ;-) but - the attached fixes
it and prints:

        No ExtensionManager: exception 'component context fails to
        supply singleton com.sun.star.deployment.ExtensionManager of
        type ...

        Is it intended that that would throw an exception rather than returning
NULL ? that was apparently not clear to either to Caolan, or me reading
it :-)

        Having said that - it's some lovely work there Caolan to get the
caching right based on new extensions being installed - that is sexy :-)

        Of course - Android has no real need for the extension manager, we'll
bundle a static image - so this sort of thing is expected; so just a
question: is a nil return, or an exception ideal ? and/or is some
QUERY_THROW type annotation wanted ? :-)

        Either way - with this, I can load much more interesting writer
documents on Android/x86 Tor :-) [ though I have a batch of other
commits / cleanups to push Monday to make that fly ].

        Thanks,

                Michael.

-- 
michael.meeks@suse.com  <><, Pseudo Engineer, itinerant idiot
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 6dc2d69..40bc684 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -491,8 +493,15 @@ LngSvcMgr::LngSvcMgr()
     // request to be notified if an extension has been added/removed
     uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
 
-    uno::Reference<deployment::XExtensionManager> xExtensionManager(
-        deployment::ExtensionManager::get(xContext));
+    uno::Reference<deployment::XExtensionManager> xExtensionManager;
+    try {
+        xExtensionManager = deployment::ExtensionManager::get(xContext);
+    } catch (const uno::Exception &e) {
+        // FIXME: I'd really want the above to return a NULL pointer not
+        // throw an exception on error ...
+        fprintf( stderr, "No ExtensionManager: exception '%s'\n",
+                 rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+    }
     if (xExtensionManager.is())
     {
         xMB = uno::Reference<util::XModifyBroadcaster>(xExtensionManager, uno::UNO_QUERY_THROW);

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.