Navigation Menu

Skip to content

Commit

Permalink
-Fix a bug setting the color amp interpolation method, when loading f…
Browse files Browse the repository at this point in the history
…rom a project file

git-svn-id: http://svn.osgeo.org/qgis/trunk@9407 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
ersts committed Sep 24, 2008
1 parent 8ee3e85 commit 051a37d
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -4023,8 +4023,19 @@ bool QgsRasterLayer::readXml( QDomNode & layer_node )
{
QgsColorRampShader* myColorRampShader = ( QgsColorRampShader* ) mRasterShader->getRasterShaderFunction();

QDomNode customColorRampTypeNode = customColorRampNode.namedItem( "colorRampType" );
myColorRampShader->setColorRampType( customColorRampTypeNode.toElement().text() );
//TODO: Remove the customColorRampType check and following if() in v2.0, added for compatability with older ( bugged ) project files
QDomNode customColorRampTypeNode = customColorRampNode.namedItem( "customColorRampType" );
QDomNode colorRampTypeNode = customColorRampNode.namedItem( "colorRampType" );
QString myRampType = "";
if( "" == customColorRampTypeNode.toElement().text() )
{
myRampType = colorRampTypeNode.toElement().text();
}
else
{
myRampType = customColorRampTypeNode.toElement().text();
}
myColorRampShader->setColorRampType( myRampType );


//entries
Expand Down Expand Up @@ -4378,7 +4389,7 @@ bool QgsRasterLayer::writeXml( QDomNode & layer_node,
{
QDomElement customColorRampElement = document.createElement( "customColorRamp" );

QDomElement customColorRampType = document.createElement( "customColorRampType" );
QDomElement customColorRampType = document.createElement( "colorRampType" );
QDomText customColorRampTypeText = document.createTextNode((( QgsColorRampShader* )mRasterShader->getRasterShaderFunction() )->getColorRampTypeAsQString() );
customColorRampType.appendChild( customColorRampTypeText );
customColorRampElement.appendChild( customColorRampType );
Expand Down

0 comments on commit 051a37d

Please sign in to comment.