Skip to content
Permalink
Browse files

Fix #8727

  • Loading branch information
elpaso committed Jan 7, 2014
1 parent 5c307b7 commit 1f9c378c77160f64612391e4e40824b853d59ddd
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/mapserver/qgsprojectparser.cpp
@@ -1543,9 +1543,7 @@ void QgsProjectParser::addLayerProjectSettings( QDomElement& layerElem, QDomDocu
{
QgsVectorLayer* vLayer = static_cast<QgsVectorLayer*>( currentLayer );
const QSet<QString>& excludedAttributes = vLayer->excludeAttributesWMS();

//displayfield
layerElem.setAttribute( "displayField", vLayer->displayField() );
QString displayField = vLayer->displayField();

//attributes
QDomElement attributesElem = doc.createElement( "Attributes" );
@@ -1557,6 +1555,11 @@ void QgsProjectParser::addLayerProjectSettings( QDomElement& layerElem, QDomDocu
{
continue;
}
// field alias in case of displayField
if ( field.name() == displayField )
{
displayField = vLayer->attributeDisplayName( idx );
}
QDomElement attributeElem = doc.createElement( "Attribute" );
attributeElem.setAttribute( "name", vLayer->attributeDisplayName( idx ) );
attributeElem.setAttribute( "type", QVariant::typeToName( field.type() ) );
@@ -1569,6 +1572,8 @@ void QgsProjectParser::addLayerProjectSettings( QDomElement& layerElem, QDomDocu
attributeElem.setAttribute( "precision", field.precision() );
attributesElem.appendChild( attributeElem );
}
//displayfield
layerElem.setAttribute( "displayField", displayField );
layerElem.appendChild( attributesElem );
}
}

0 comments on commit 1f9c378

Please sign in to comment.
You can’t perform that action at this time.