Skip to content

Commit

Permalink
Some cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Jan 28, 2019
1 parent 8e3f7b1 commit 0f24e72
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -2312,27 +2312,27 @@ namespace QgsWms
QgsFeatureList features;
QgsAttributeList attributes;
const QDomNodeList featuresNode = layerElem.elementsByTagName( QStringLiteral( "Feature" ) );
if ( !featuresNode.isEmpty() )
if ( featuresNode.isEmpty() )
continue;

for ( int j = 0; j < featuresNode.size(); ++j )
{
for ( int j = 0; j < featuresNode.size(); ++j )
{
const QDomElement featureNode = featuresNode.at( j ).toElement();
const qint64 fid = featureNode.attribute( QStringLiteral( "id" ) ).toLongLong();
const QgsFeature feature = vl->getFeature( fid );
features.append( feature );
const QDomElement featureNode = featuresNode.at( j ).toElement();
const qint64 fid = featureNode.attribute( QStringLiteral( "id" ) ).toLongLong();
const QgsFeature feature = vl->getFeature( fid );
features << feature;

// search attributes to export (one time only)
if ( not attributes.isEmpty() )
continue;
// search attributes to export (one time only)
if ( not attributes.isEmpty() )
continue;

const QDomNodeList attributesNode = featureNode.elementsByTagName( QStringLiteral( "Attribute" ) );
for ( int k = 0; k < attributesNode.size(); ++k )
{
const QDomElement attributeElement = attributesNode.at( k ).toElement();
const QString fieldName = attributeElement.attribute( QStringLiteral( "name" ) );
const QDomNodeList attributesNode = featureNode.elementsByTagName( QStringLiteral( "Attribute" ) );
for ( int k = 0; k < attributesNode.size(); ++k )
{
const QDomElement attributeElement = attributesNode.at( k ).toElement();
const QString fieldName = attributeElement.attribute( QStringLiteral( "name" ) );

attributes << feature.fieldNameIndex( fieldName );
}
attributes << feature.fieldNameIndex( fieldName );
}
}

Expand Down Expand Up @@ -2369,7 +2369,7 @@ namespace QgsWms
}
}

json.append( ( "]}" ) );
json.append( QStringLiteral( "]}" ) );

return json.toUtf8();
}
Expand Down
1 change: 1 addition & 0 deletions src/server/services/wms/qgswmsrenderer.h
Expand Up @@ -255,6 +255,7 @@ namespace QgsWms
//! Converts a feature info xml document to Text
QByteArray convertFeatureInfoToText( const QDomDocument &doc ) const;

//! Converts a feature info xml document to json
QByteArray convertFeatureInfoToJson( const QList<QgsMapLayer *> &layers, const QDomDocument &doc ) const;

QDomElement createFeatureGML(
Expand Down

0 comments on commit 0f24e72

Please sign in to comment.