[Marble-commits] KDE/kdeedu/marble/src/lib/geodata
Thibaut Gridel
tgridel at free.fr
Sun Sep 13 17:45:01 CEST 2009
SVN commit 1022937 by tgridel:
fix first Document tag case and discarded tag recursion
M +7 -6 handlers/kml/KmlDocumentTagHandler.cpp
M +14 -15 parser/GeoParser.cpp
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlDocumentTagHandler.cpp #1022936:1022937
@@ -51,16 +51,17 @@
<< " parent item name: " << parentItem.qualifiedName().first;
#endif // DEBUG_TAGS
return static_cast<GeoDataDocument*>(&parentItem.nodeAs<GeoDataContainer>()->last());
- } else {
- return 0;
}
- } else {
- GeoDataDocument* doc = geoDataDoc( parser );
+ else if ( parentItem.first.first == kmlTag_kml)
+ {
+ GeoDataDocument* doc = geoDataDoc( parser );
#ifdef DEBUG_TAGS
- qDebug() << "Parsed <" << kmlTag_Document << "> document: " << doc;
+ qDebug() << "Parsed <" << kmlTag_Document << "> document: " << doc;
#endif
- return doc;
+ return doc;
+ }
}
+ return 0;
}
}
--- trunk/KDE/kdeedu/marble/src/lib/geodata/parser/GeoParser.cpp #1022936:1022937
@@ -158,6 +158,20 @@
#if DUMP_PARENT_STACK > 0
dumpParentStack( name().toString(), m_nodeStack.size(), false );
#endif
+ while ( !atEnd() ) {
+ readNext();
+ if ( isEndElement() ) {
+ m_nodeStack.pop();
+#if DUMP_PARENT_STACK > 0
+ dumpParentStack( name().toString(), m_nodeStack.size(), true );
+#endif
+ break;
+ }
+
+ if ( isStartElement() ) {
+ parseDocument();
+ }
+ }
}
#if DUMP_PARENT_STACK > 0
else {
@@ -169,21 +183,6 @@
dumpParentStack( name().toString() + "-discarded", m_nodeStack.size(), true );
}
#endif
-
- while ( !atEnd() ) {
- readNext();
- if ( isEndElement() ) {
- m_nodeStack.pop();
-#if DUMP_PARENT_STACK > 0
- dumpParentStack( name().toString(), m_nodeStack.size(), true );
-#endif
- break;
- }
-
- if ( isStartElement() ) {
- parseDocument();
- }
- }
}
void GeoParser::raiseRootElementError()
More information about the Marble-commits
mailing list