incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r1172101 - /incubator/ooo/trunk/main/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
Date Sat, 17 Sep 2011 22:36:36 GMT
Author: mst
Date: Sat Sep 17 22:36:36 2011
New Revision: 1172101

URL: http://svn.apache.org/viewvc?rev=1172101&view=rev
Log:
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

Modified:
    incubator/ooo/trunk/main/desktop/source/deployment/misc/dp_descriptioninfoset.cxx

Modified: incubator/ooo/trunk/main/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/desktop/source/deployment/misc/dp_descriptioninfoset.cxx?rev=1172101&r1=1172100&r2=1172101&view=diff
==============================================================================
--- incubator/ooo/trunk/main/desktop/source/deployment/misc/dp_descriptioninfoset.cxx (original)
+++ incubator/ooo/trunk/main/desktop/source/deployment/misc/dp_descriptioninfoset.cxx Sat
Sep 17 22:36:36 2011
@@ -479,12 +479,24 @@ void DescriptionInfoset::checkBlacklist(
                 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));



Mime
View raw message