diff options
author | Joachim Lingner <jl@openoffice.org> | 2010-06-10 16:55:56 +0200 |
---|---|---|
committer | Joachim Lingner <jl@openoffice.org> | 2010-06-10 16:55:56 +0200 |
commit | 463d6da2397ff113907eaa710fe711ee444ed3da (patch) | |
tree | deefda76d64c96576be2d47dca30eeff0f39fd3c /desktop | |
parent | 2d03198027d5422eb374696b827268033338e73e (diff) |
jl152 #i77196# backend db wrote double entries if there was an ambiguous extension, and XExtensionManager::synchronize was run
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/deployment/registry/dp_backenddb.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx index 1f4a62e696d7..14b4f2374c5b 100644 --- a/desktop/source/deployment/registry/dp_backenddb.cxx +++ b/desktop/source/deployment/registry/dp_backenddb.cxx @@ -425,14 +425,24 @@ Reference<css::xml::dom::XNode> BackendDb::writeKeyElement( const Reference<css::xml::dom::XDocument> doc = getDocument(); const Reference<css::xml::dom::XNode> root = doc->getFirstChild(); -#if OSL_DEBUG_LEVEL > 0 - //There must not be yet an entry with the same url + //Check if there are an entry with the same url. This can be the case if the + //the status of an XPackage is ambiguous. In this case a call to activateExtension + //(dp_extensionmanager.cxx), will register the package again. See also + //Package::processPackage_impl in dp_backend.cxx. + //A package can become + //invalid after its successful registration, for example if a second extension with + //the same service is installed. const OUString sExpression( sPrefix + OUSTR(":") + sElementName + OUSTR("[@url = \"") + url + OUSTR("\"]")); - const Reference<css::xml::dom::XNode> _extensionNode = + const Reference<css::xml::dom::XNode> existingNode = getXPathAPI()->selectSingleNode(root, sExpression); - OSL_ASSERT(! _extensionNode.is()); -#endif + if (existingNode.is()) + { + OSL_ASSERT(0); + //replace the existing entry. + removeEntry(url); + } + const Reference<css::xml::dom::XElement> keyElement( doc->createElementNS(sNameSpace, sPrefix + OUSTR(":") + sElementName)); |