[Marble-commits] KDE/kdeedu/marble/src/lib/geodata/handlers/kml
Thibaut Gridel
tgridel at free.fr
Sat Jul 17 11:00:25 CEST 2010
SVN commit 1150963 by tgridel:
Kml handlers: use dynamic cast for tests
M +1 -1 KmlAreaTagHandler.cpp
M +1 -1 KmlColorTagHandler.cpp
M +1 -1 KmlCountrycodeTagHandler.cpp
M +1 -1 KmlDescriptionTagHandler.cpp
M +1 -1 KmlExtendedDataTagHandler.cpp
M +1 -1 KmlExtrudeTagHandler.cpp
M +1 -1 KmlLinearRingTagHandler.cpp
M +1 -1 KmlNameTagHandler.cpp
M +1 -1 KmlOpenTagHandler.cpp
M +1 -1 KmlPopTagHandler.cpp
M +1 -1 KmlRoleTagHandler.cpp
M +1 -1 KmlStyleMapTagHandler.cpp
M +1 -1 KmlStyleTagHandler.cpp
M +1 -1 KmlStyleUrlTagHandler.cpp
M +3 -3 KmlTessellateTagHandler.cpp
M +1 -1 KmlVisibilityTagHandler.cpp
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlAreaTagHandler.cpp #1150962:1150963
@@ -41,7 +41,7 @@
GeoStackItem parentItem = parser.parentElement();
- if( parentItem.nodeAs<GeoDataPlacemark>() ) {
+ if( parentItem.is<GeoDataPlacemark>() ) {
QString area = parser.readElementText().trimmed();
qreal ar = area.toDouble();
if( ar < 0.0 ) ar = 0.0;
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlColorTagHandler.cpp #1150962:1150963
@@ -40,7 +40,7 @@
GeoStackItem parentItem = parser.parentElement();
- if ( parentItem.nodeAs<GeoDataColorStyle>() ) {
+ if ( parentItem.is<GeoDataColorStyle>() ) {
bool ok;
QRgb abgr = parser.readElementText().trimmed().toUInt( &ok, 16 );
unsigned a = abgr >> 24; abgr = abgr << 8; //"rgb0"
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlCountrycodeTagHandler.cpp #1150962:1150963
@@ -41,7 +41,7 @@
GeoStackItem parentItem = parser.parentElement();
- if( parentItem.nodeAs<GeoDataPlacemark>() ) {
+ if( parentItem.is<GeoDataPlacemark>() ) {
QString countrycode = parser.readElementText().trimmed();
parentItem.nodeAs<GeoDataPlacemark>()->setCountryCode( countrycode );
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlDescriptionTagHandler.cpp #1150962:1150963
@@ -40,7 +40,7 @@
GeoStackItem parentItem = parser.parentElement();
- if( parentItem.nodeAs<GeoDataFeature>() ) {
+ if( parentItem.is<GeoDataFeature>() ) {
QString description = parser.readElementText().trimmed();
parentItem.nodeAs<GeoDataFeature>()->setDescription( description );
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlExtendedDataTagHandler.cpp #1150962:1150963
@@ -30,7 +30,7 @@
GeoStackItem parentItem = parser.parentElement();
- if( parentItem.nodeAs<GeoDataFeature>() ) {
+ if( parentItem.is<GeoDataFeature>() ) {
GeoDataExtendedData extendedData;
#ifdef DEBUG_TAGS
mDebug() << "Parsed <" << kmlTag_ExtendedData << ">"
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlExtrudeTagHandler.cpp #1150962:1150963
@@ -46,7 +46,7 @@
GeoDataGeometry* geometry;
bool validParents = false;
- if( parentItem.nodeAs<GeoDataPlacemark>() && parentItem.represents( kmlTag_Point ) ) {
+ if( parentItem.is<GeoDataPlacemark>() && parentItem.represents( kmlTag_Point ) ) {
geometry = parentItem.nodeAs<GeoDataPlacemark>()->geometry();
validParents = true;
} else if( parentItem.nodeAs<GeoDataGeometry>() ) {
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlLinearRingTagHandler.cpp #1150962:1150963
@@ -57,7 +57,7 @@
parentItem.nodeAs<GeoDataPolygon>()->appendInnerBoundary( linearRing );
return &parentItem.nodeAs<GeoDataPolygon>()->innerBoundaries().last();
- } else if( parentItem.nodeAs<GeoDataMultiGeometry>() ) {
+ } else if( parentItem.is<GeoDataMultiGeometry>() ) {
GeoDataLinearRing *linearRing = new GeoDataLinearRing;
parentItem.nodeAs<GeoDataMultiGeometry>()->append( linearRing );
return linearRing;
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlNameTagHandler.cpp #1150962:1150963
@@ -38,7 +38,7 @@
Q_ASSERT( parser.isStartElement() && parser.isValidElement( kmlTag_name ) );
GeoStackItem parentItem = parser.parentElement();
- if( parentItem.nodeAs<GeoDataFeature>() ) {
+ if( parentItem.is<GeoDataFeature>() ) {
QString name = parser.readElementText().trimmed();
parentItem.nodeAs<GeoDataFeature>()->setName( name );
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlOpenTagHandler.cpp #1150962:1150963
@@ -40,7 +40,7 @@
GeoStackItem parentItem = parser.parentElement();
- if( parentItem.nodeAs<GeoDataFeature>() ) {
+ if( parentItem.is<GeoDataFeature>() ) {
QString open = parser.readElementText().trimmed();
/* if( open == QString( "1" ) )
parentItem.nodeAs<GeoDataFeature>()->setOpen( true );
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlPopTagHandler.cpp #1150962:1150963
@@ -41,7 +41,7 @@
GeoStackItem parentItem = parser.parentElement();
- if( parentItem.nodeAs<GeoDataPlacemark>() ) {
+ if( parentItem.is<GeoDataPlacemark>() ) {
QString population = parser.readElementText().trimmed();
qint64 pop = population.toLongLong();
if( pop < 0 ) pop = 0;
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlRoleTagHandler.cpp #1150962:1150963
@@ -41,7 +41,7 @@
Q_ASSERT( parser.isStartElement() && parser.isValidElement( kmlTag_role ) );
GeoStackItem parentItem = parser.parentElement();
- if( parentItem.nodeAs<GeoDataPlacemark>() ) {
+ if( parentItem.is<GeoDataPlacemark>() ) {
QString role = parser.readElementText().trimmed();
if ( role.isEmpty() ) {
role = ' ';
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlStyleMapTagHandler.cpp #1150962:1150963
@@ -53,7 +53,7 @@
<< " parent item name: " << parentItem.qualifiedName().first;
#endif
return &parentItem.nodeAs<GeoDataDocument>()->styleMap( styleId );
- } else if( parentItem.nodeAs<GeoDataFeature>() ) {
+ } else if( parentItem.is<GeoDataFeature>() ) {
/* GeoDataStyleMap styleMap;
styleMap.setStyleId( parser.attribute( "id" ).trimmed() );
parentItem.nodeAs<GeoDataFeature>()->setStyleMap( styleMap );*/
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlStyleTagHandler.cpp #1150962:1150963
@@ -53,7 +53,7 @@
#endif // DEBUG_TAGS
return &parentItem.nodeAs<GeoDataDocument>()->style( styleId );
}
- else if ( parentItem.nodeAs<GeoDataFeature>() ) {
+ else if ( parentItem.is<GeoDataFeature>() ) {
/* style = new GeoDataStyle;
style->setStyleId( parser.attribute( "id" ).trimmed() );
parentItem.nodeAs<GeoDataFeature>()->setStyle( style );*/
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlStyleUrlTagHandler.cpp #1150962:1150963
@@ -54,7 +54,7 @@
mDebug() << "Parsed <" << kmlTag_styleUrl << "> containing: " << content
<< " parent item name: " << parentItem.qualifiedName().first;
#endif
- } else if( parentItem.nodeAs<GeoDataFeature>() ) {
+ } else if( parentItem.is<GeoDataFeature>() ) {
QString content = parser.readElementText().trimmed();
parentItem.nodeAs<GeoDataFeature>()->setStyleUrl( content );
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlTessellateTagHandler.cpp #1150962:1150963
@@ -47,7 +47,7 @@
QString content = parser.readElementText().trimmed();
- if( parentItem.nodeAs<GeoDataLineString>() ) {
+ if( parentItem.is<GeoDataLineString>() ) {
GeoDataLineString* lineString = parentItem.nodeAs<GeoDataLineString>();
if( content == QString( "1" ) ) {
@@ -58,7 +58,7 @@
validParents = true;
- } else if( parentItem.nodeAs<GeoDataLinearRing>() ) {
+ } else if( parentItem.is<GeoDataLinearRing>() ) {
GeoDataLinearRing* linearRing = parentItem.nodeAs<GeoDataLinearRing>();
if( content == QString( "1" ) ) {
@@ -69,7 +69,7 @@
validParents = true;
- } else if( parentItem.nodeAs<GeoDataPolygon>() ) {
+ } else if( parentItem.is<GeoDataPolygon>() ) {
GeoDataPolygon* polygon = parentItem.nodeAs<GeoDataPolygon>();
if( content == QString( "1" ) ) {
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlVisibilityTagHandler.cpp #1150962:1150963
@@ -39,7 +39,7 @@
GeoStackItem parentItem = parser.parentElement();
- if( parentItem.nodeAs<GeoDataFeature>() ) {
+ if( parentItem.is<GeoDataFeature>() ) {
QString visibility = parser.readElementText().trimmed();
if( visibility == QString( "1" ) )
parentItem.nodeAs<GeoDataFeature>()->setVisible( true );
More information about the Marble-commits
mailing list