diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-08-24 16:06:15 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-08-24 17:18:28 +0200 |
commit | 35d474ff8c36d12e2afafee8a061745e47ef4fb0 (patch) | |
tree | 2fb0cd622a7c7e61bfff4c06a5ddf714f5511a61 /cppuhelper/source/defaultbootstrap.cxx | |
parent | 628aad2aec5e33dcf00b573891c122ad91438bc4 (diff) |
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
Diffstat (limited to 'cppuhelper/source/defaultbootstrap.cxx')
-rw-r--r-- | cppuhelper/source/defaultbootstrap.cxx | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/cppuhelper/source/defaultbootstrap.cxx b/cppuhelper/source/defaultbootstrap.cxx index 4e0ea17435e9..ba558c0b5909 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_)). @@ -1503,7 +1505,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) @@ -1745,7 +1749,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: |