[gnote] don't use doc->children. Call xmlDocGetRootElement() instead.



commit 573371f75afdfa297e201d3bbbefcb7f8c1f9de3
Author: Hubert Figuiere <hub figuiere net>
Date:   Thu May 28 21:36:11 2009 -0400

    don't use doc->children. Call xmlDocGetRootElement() instead.
---
 src/actionmanager.cpp |    3 ++-
 src/test/notetest.cpp |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp
index 7058150..beaae8f 100644
--- a/src/actionmanager.cpp
+++ b/src/actionmanager.cpp
@@ -127,7 +127,8 @@ namespace gnote {
                                                             path, "/") + 1);
     DBG_OUT("path = %s placeholdername = %s", path.c_str(), placeholderName.c_str());
 
-    sharp::XmlNodeSet nodes = sharp::xml_node_xpath_find(doc->children, "//placeholder");
+    sharp::XmlNodeSet nodes = sharp::xml_node_xpath_find(xmlDocGetRootElement(doc), 
+                                                         "//placeholder");
     // Find the placeholder specified in the path
     for(sharp::XmlNodeSet::const_iterator iter = nodes.begin();
         iter != nodes.end(); ++iter) {
diff --git a/src/test/notetest.cpp b/src/test/notetest.cpp
index b44d1e9..74bb1bb 100644
--- a/src/test/notetest.cpp
+++ b/src/test/notetest.cpp
@@ -38,7 +38,7 @@ int test_main(int /*argc*/, char ** /*argv*/)
 
   if(doc) {
     std::list<std::string> tags;
-    gnote::Note::parse_tags(doc->children, tags);
+    gnote::Note::parse_tags(xmlDocGetRootElement(doc), tags);
     BOOST_CHECK(!tags.empty());
 
     xmlFreeDoc(doc);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]