diff options
author | Michael Stahl <mst@apache.org> | 2011-09-17 21:36:36 +0000 |
---|---|---|
committer | Michael Stahl <mst@apache.org> | 2011-09-17 21:36:36 +0000 |
commit | f319ba09736857e0c8431489aea22af151f97c08 (patch) | |
tree | 18d90fe2340b864829524a594417f5d1803800b1 /desktop/source | |
parent | 6033e756839e24624cb3b5a40cc6024af4d2a368 (diff) |
jsc341: i117327: take care if no dependency node in current description exists, create one
# HG changeset patch
# User Juergen Schmidt <jsc@openoffice.org>
# Date 1300954744 -3600
# Node ID d77a8537e3454882a093ba4ca82b21cac06f9b98
# Parent aff128605d88cc21e0784f164ffdb31a9790e35b
Diffstat (limited to 'desktop/source')
-rw-r--r-- | desktop/source/deployment/misc/dp_descriptioninfoset.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx index 25d6584f7378..b5660708fa8b 100644 --- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx +++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx @@ -479,12 +479,24 @@ void DescriptionInfoset::checkBlacklist() const css::uno::Reference< css::xml::dom::XNodeList > xDeps(xElement->getChildNodes()); sal_Int32 nLen = xDeps->getLength(); + // get the parent xml document of current description info for the import + css::uno::Reference< css::xml::dom::XDocument > xCurrentDescInfo(m_element->getOwnerDocument()); + // get dependency node of current description info to merge the new dependencies from the blacklist css::uno::Reference< css::xml::dom::XNode > xCurrentDeps( m_xpath->selectSingleNode(m_element, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("desc:dependencies")))); - css::uno::Reference< css::xml::dom::XDocument > xCurrentDescInfo(xCurrentDeps->getOwnerDocument()); + // if no dependency node exists, create a new one in the current description info + if (!xCurrentDeps.is()) { + css::uno::Reference< css::xml::dom::XNode > xNewDepNode( + xCurrentDescInfo->createElementNS( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("http://openoffice.org/extensions/description/2006")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dependencies"))), css::uno::UNO_QUERY_THROW); + m_element->appendChild(xNewDepNode); + xCurrentDeps = m_xpath->selectSingleNode(m_element, ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("desc:dependencies"))); + } for (sal_Int32 i=0; i<nLen; i++) { css::uno::Reference< css::xml::dom::XNode > xNode(xDeps->item(i)); |