From f319ba09736857e0c8431489aea22af151f97c08 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Sat, 17 Sep 2011 21:36:36 +0000 Subject: jsc341: i117327: take care if no dependency node in current description exists, create one # HG changeset patch # User Juergen Schmidt # Date 1300954744 -3600 # Node ID d77a8537e3454882a093ba4ca82b21cac06f9b98 # Parent aff128605d88cc21e0784f164ffdb31a9790e35b --- desktop/source/deployment/misc/dp_descriptioninfoset.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'desktop/source') 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 xNode(xDeps->item(i)); -- cgit