Skip to content
Permalink
Browse files
-Fix a bug setting the color amp interpolation method, when loading f…
…rom a project file

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9407 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
ersts committed Sep 24, 2008
1 parent 317291f commit b2185ab7cccf16f918e166214b6929bf715420b9
Showing with 14 additions and 3 deletions.
  1. +14 −3 src/core/raster/qgsrasterlayer.cpp
@@ -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
@@ -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 );

0 comments on commit b2185ab

Please sign in to comment.