Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Convert composer entry in project file from 1.8 to 1.9 format for QGI…
…S Server
  • Loading branch information
mhugent committed Mar 15, 2013
1 parent 7431eb8 commit 9e16b51
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/core/qgsprojectfiletransform.cpp
Expand Up @@ -532,6 +532,40 @@ void QgsProjectFileTransform::transform1800to1900()
}
}

//Composer: move all items under Composition element
QDomNodeList composerList = mDom.elementsByTagName( "Composer" );
for ( int i = 0; i < composerList.size(); ++i )
{
QDomElement composerElem = composerList.at( i ).toElement();

//find <QgsComposition element
QDomElement compositionElem = composerElem.firstChildElement( "Composition" );
if ( compositionElem.isNull() )
{
continue;
}

QDomNodeList composerChildren = composerElem.childNodes();

if ( composerChildren.size() < 1 )
{
continue;
}

for ( int j = composerChildren.size() - 1; j >= 0; --j )
{
QDomElement childElem = composerChildren.at( j ).toElement();
if ( childElem.tagName() == "Composition" )
{
continue;
}

composerElem.removeChild( childElem );
compositionElem.appendChild( childElem );

}
}

// SimpleFill symbol layer v2: avoid double transparency
// replacing alpha value of symbol layer's color with 255 (the
// transparency value is already stored as symbol transparency).
Expand Down

0 comments on commit 9e16b51

Please sign in to comment.