Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D4F2F8E1B for ; Sat, 17 Sep 2011 22:36:59 +0000 (UTC) Received: (qmail 90600 invoked by uid 500); 17 Sep 2011 22:36:59 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 90563 invoked by uid 500); 17 Sep 2011 22:36:59 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 90556 invoked by uid 99); 17 Sep 2011 22:36:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Sep 2011 22:36:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Sep 2011 22:36:57 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 714CA2388A9C; Sat, 17 Sep 2011 22:36:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1172101 - /incubator/ooo/trunk/main/desktop/source/deployment/misc/dp_descriptioninfoset.cxx Date: Sat, 17 Sep 2011 22:36:36 -0000 To: ooo-commits@incubator.apache.org From: mst@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20110917223636.714CA2388A9C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 # 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 xNode(xDeps->item(i));