Skip to content
Permalink
Browse files

Merge pull request #1462 from giohappy/master

Fix 10625 reverting addDrawingOrder to previous logic
  • Loading branch information
mhugent committed Jun 19, 2014
2 parents fcde595 + 304ced9 commit c05e342ab1fc09a1f9f09cf76840862dc3e038cf
Showing with 41 additions and 1 deletion.
  1. +38 −1 src/mapserver/qgswmsprojectparser.cpp
  2. +3 −0 src/mapserver/qgswmsprojectparser.h
@@ -709,7 +709,7 @@ void QgsWMSProjectParser::addDrawingOrder( QDomElement& parentElem, QDomDocument
parentElem.appendChild( layerDrawingOrderElem );
}

void QgsWMSProjectParser::addDrawingOrder( QDomElement groupElem, bool useDrawingOrder, QMap<int, QString>& orderedLayerList ) const
void QgsWMSProjectParser::addDrawingOrderEmbeddedGroup( QDomElement groupElem, bool useDrawingOrder, QMap<int, QString>& orderedLayerList ) const
{
if ( groupElem.isNull() )
{
@@ -801,6 +801,43 @@ void QgsWMSProjectParser::addDrawingOrder( QDomElement groupElem, bool useDrawin
}
}

void QgsWMSProjectParser::addDrawingOrder( QDomElement elem, bool useDrawingOrder, QMap<int, QString>& orderedLayerList ) const
{
if ( elem.isNull() )
{
return;
}

if ( elem.tagName() == "legendgroup" )
{
if ( elem.attribute( "embedded" ) == "1" )
{
addDrawingOrderEmbeddedGroup( elem, useDrawingOrder, orderedLayerList );
}
else
{
QDomNodeList groupChildren = elem.childNodes();
for ( int i = 0; i < groupChildren.size(); ++i )
{
addDrawingOrder( groupChildren.at( i ).toElement(), useDrawingOrder, orderedLayerList );
}
}
}
else if ( elem.tagName() == "legendlayer" )
{
QString layerName = elem.attribute( "name" );
if ( useDrawingOrder )
{
int drawingOrder = elem.attribute( "drawingOrder", "-1" ).toInt();
orderedLayerList.insert( drawingOrder, layerName );
}
else
{
orderedLayerList.insert( orderedLayerList.size(), layerName );
}
}
}

void QgsWMSProjectParser::addLayers( QDomDocument &doc,
QDomElement &parentLayer,
const QDomElement &legendElem,
@@ -129,6 +129,9 @@ class QgsWMSProjectParser: public QgsWMSConfigParser
/**Adds drawing order info from layer element or group element (recursive)*/
void addDrawingOrder( QDomElement groupElem, bool useDrawingOrder, QMap<int, QString>& orderedLayerList ) const;

/**Adds drawing order info from embedded layer element or embedded group element (recursive)*/
void addDrawingOrderEmbeddedGroup( QDomElement groupElem, bool useDrawingOrder, QMap<int, QString>& orderedLayerList ) const;

void addLayers( QDomDocument &doc,
QDomElement &parentLayer,
const QDomElement &legendElem,

0 comments on commit c05e342

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