[Libreoffice-commits] .: cppuhelper/source

Stephan Bergmann sbergmann at kemper.freedesktop.org
Mon May 14 09:20:41 PDT 2012


 cppuhelper/source/defaultbootstrap.cxx |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 3b1798a55bf7c193b911ce23e280e6a0e1e4314a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon May 14 18:20:30 2012 +0200

    Work around extension factories not implementing XServiceInfo
    
    ...that would otherwise lead to "Bad insert element" failure during live-insertion.
    
    Change-Id: I74f883c9b613f03256abb7be7657f25b418f821d

diff --git a/cppuhelper/source/defaultbootstrap.cxx b/cppuhelper/source/defaultbootstrap.cxx
index f948586..df13fd6 100644
--- a/cppuhelper/source/defaultbootstrap.cxx
+++ b/cppuhelper/source/defaultbootstrap.cxx
@@ -950,6 +950,22 @@ void ServiceManager::insert(css::uno::Any const & aElement)
         insertLegacyFactory(info);
         return;
     }
+// At least revisions up to 1.7 of LanguageTool.oxt (incl. the bundled 1.4.0 in
+// module languagetool) contain an (actively registered) factory that does not
+// implement XServiceInfo; the old OServiceManager::insert
+// (stoc/source/servicemanager/servicemanager.cxx) silently did not add such
+// broken factories to its m_ImplementationNameMap, so ignore them here for
+// backwards compatibility of live-insertion of extensions, too (can go again
+// for incompatible LO 4):
+#if SUPD < 400
+    css::uno::Reference< css::lang::XSingleComponentFactory > legacy;
+    if ((aElement >>= legacy) && legacy.is()) {
+        SAL_WARN(
+            "cppuhelper",
+            "Ignored XSingleComponentFactory not implementing XServiceInfo");
+        return;
+    }
+#endif
     throw css::lang::IllegalArgumentException(
         "Bad insert element", static_cast< cppu::OWeakObject * >(this), 0);
 }


More information about the Libreoffice-commits mailing list