[Libreoffice-commits] .: Branch 'libreoffice-3-6' - cppuhelper/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Aug 29 13:00:50 PDT 2012


 cppuhelper/source/defaultbootstrap.cxx |   26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

New commits:
commit b4f8acb41165a28b2db47acd3c6b624a4c507c54
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Aug 24 16:06:15 2012 +0200

    Fix removeRdbFiles (caused extension update to fail)
    
    removeRdbFiles suffered from a confusion that ImplementationInfo.uri denotes the
    corresponding component (.so, .jar, etc.), but not the .rdb file.  So removing
    an .rdb file silently failed to remove the corresponding implementations, so re-
    installing a similar enough .rdb (as typically happens during extension update)
    would fail due to duplicate implementation names.
    
    Change-Id: I25d4ff72656c99a3af509eef09e89c18cfd0aabe
    Reviewed-on: https://gerrit.libreoffice.org/476
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/cppuhelper/source/defaultbootstrap.cxx b/cppuhelper/source/defaultbootstrap.cxx
index c3bdba3..7fd1e4a 100644
--- a/cppuhelper/source/defaultbootstrap.cxx
+++ b/cppuhelper/source/defaultbootstrap.cxx
@@ -130,9 +130,10 @@ struct ImplementationInfo: private boost::noncopyable {
         rtl::OUString const & theName, rtl::OUString const & theLoader,
         rtl::OUString const & theUri, rtl::OUString const & thePrefix,
         css::uno::Reference< css::uno::XComponentContext > const &
-            theAlienContext):
+            theAlienContext,
+        rtl::OUString const & theRdbFile):
         name(theName), loader(theLoader), uri(theUri), prefix(thePrefix),
-        alienContext(theAlienContext)
+        alienContext(theAlienContext), rdbFile(theRdbFile)
     {}
 
     explicit ImplementationInfo(rtl::OUString const & theName): name(theName) {}
@@ -142,6 +143,7 @@ struct ImplementationInfo: private boost::noncopyable {
     rtl::OUString const uri;
     rtl::OUString const prefix;
     css::uno::Reference< css::uno::XComponentContext > const alienContext;
+    rtl::OUString const rdbFile;
     std::vector< rtl::OUString > services;
     std::vector< rtl::OUString > singletons;
 };
@@ -149,12 +151,12 @@ struct ImplementationInfo: private boost::noncopyable {
 struct Implementation: private boost::noncopyable {
     Implementation(
         rtl::OUString const & name, rtl::OUString const & loader,
-        rtl::OUString const & uri,
-        rtl::OUString const & prefix = rtl::OUString(),
-        css::uno::Reference< css::uno::XComponentContext > const &
-            alienContext
-                = css::uno::Reference< css::uno::XComponentContext >()):
-        info(new ImplementationInfo(name, loader, uri, prefix, alienContext)),
+        rtl::OUString const & uri, rtl::OUString const & prefix,
+        css::uno::Reference< css::uno::XComponentContext > const & alienContext,
+        rtl::OUString const & rdbFile):
+        info(
+            new ImplementationInfo(
+                name, loader, uri, prefix, alienContext, rdbFile)),
         loaded(false)
     {}
 
@@ -466,7 +468,7 @@ void Parser::handleImplementation() {
     implementation_.reset(
         new Implementation(
             attrImplementation_, attrLoader_, attrUri_, attrPrefix_,
-            alienContext_));
+            alienContext_, reader_.getUrl()));
     if (!data_->namedImplementations.insert(
             NamedImplementations::value_type(
                 attrImplementation_, implementation_)).
@@ -1502,7 +1504,9 @@ bool ServiceManager::readLegacyRdbFile(rtl::OUString const & uri) {
         boost::shared_ptr< Implementation > impl(
             new Implementation(
                 name, readLegacyRdbString(uri, implKey, "UNO/ACTIVATOR"),
-                readLegacyRdbString(uri, implKey, "UNO/LOCATION")));
+                readLegacyRdbString(uri, implKey, "UNO/LOCATION"),
+                rtl::OUString(),
+                css::uno::Reference< css::uno::XComponentContext >(), uri));
         if (!data_.namedImplementations.insert(
                 NamedImplementations::value_type(name, impl)).
             second)
@@ -1744,7 +1748,7 @@ void ServiceManager::removeRdbFiles(std::vector< rtl::OUString > const & uris) {
                  j != data_.namedImplementations.end();)
             {
                 assert(j->second.get() != 0);
-                if (j->second->info->uri == *i) {
+                if (j->second->info->rdbFile == *i) {
                     clear.push_back(j->second);
                     //TODO: The below leaves data_ in an inconsistent state upon
                     // exceptions:


More information about the Libreoffice-commits mailing list