diff options
| author | jhurst <jhurst@cinecert.com> | 2009-08-14 18:21:35 +0000 |
|---|---|---|
| committer | jhurst <> | 2009-08-14 18:21:35 +0000 |
| commit | 02e0d37bf7b192fcac4b8bb8c4c39a62d47c9531 (patch) | |
| tree | 1ffeb5db9b8458cb7bebebe32ce087c2f0dedb75 /src/KM_xml.cpp | |
| parent | 49d8c24675d057db801c68d0a3063ceb3eab366f (diff) | |
new mode
Diffstat (limited to 'src/KM_xml.cpp')
| -rw-r--r-- | src/KM_xml.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/KM_xml.cpp b/src/KM_xml.cpp index 412e5ca..6f2092f 100644 --- a/src/KM_xml.cpp +++ b/src/KM_xml.cpp @@ -310,11 +310,14 @@ void Kumu::XMLElement::DeleteAttrWithName(const char* name) { assert(name); - AttributeList::iterator i; - for ( i = m_AttrList.begin(); i != m_AttrList.end(); i++ ) + AttributeList::iterator i = m_AttrList.begin(); + + while ( i != m_AttrList.end() ) { if ( i->name == std::string(name) ) - m_AttrList.erase(i); + m_AttrList.erase(i++); + else + ++i; } } @@ -322,10 +325,10 @@ Kumu::XMLElement::DeleteAttrWithName(const char* name) void Kumu::XMLElement::DeleteChildren() { - for ( ElementList::iterator i = m_ChildList.begin(); i != m_ChildList.end(); i++ ) + while ( ! m_ChildList.empty() ) { - delete *i; - m_ChildList.erase(i); + delete m_ChildList.back(); + m_ChildList.pop_back(); } } @@ -763,7 +766,6 @@ Kumu::XMLElement::ParseString(const std::string& document) parser->setDoNamespaces(true); // optional MyTreeHandler* docHandler = new MyTreeHandler(this); - ErrorHandler* errHandler = (ErrorHandler*)docHandler; parser->setDocumentHandler(docHandler); parser->setErrorHandler(docHandler); |
