Skip to content

Commit

Permalink
project file transform: don't imply we know the band count (fixes #7080
Browse files Browse the repository at this point in the history
…, fixes #8283)
  • Loading branch information
jef-n committed Jul 13, 2013
1 parent 603cd59 commit d6c16dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/core/qgsmaplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ bool QgsMapLayer::draw( QgsRenderContext& rendererContext )
void QgsMapLayer::drawLabels( QgsRenderContext& rendererContext )
{
Q_UNUSED( rendererContext );
// QgsDebugMsg("entered.");
}

bool QgsMapLayer::readLayerXML( const QDomElement& layerElement )
Expand Down Expand Up @@ -411,7 +410,7 @@ bool QgsMapLayer::readLayerXML( const QDomElement& layerElement )
readCustomProperties( layerElement );

return true;
} // void QgsMapLayer::readXML
} // bool QgsMapLayer::readLayerXML


bool QgsMapLayer::readXml( const QDomNode& layer_node )
Expand Down
10 changes: 4 additions & 6 deletions src/core/qgsprojectfiletransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,13 +816,11 @@ int QgsProjectFileTransform::rasterBandNumber( const QDomElement& rasterProperti
QDomElement rasterBandElem = rasterPropertiesElem.firstChildElement( bandName );
if ( !rasterBandElem.isNull() )
{
for ( int i = 1; i <= rlayer->bandCount(); i++ )
QRegExp re( "(\\d+)" );

if ( re.indexIn( rasterBandElem.text() ) >= 0 )
{
if ( rlayer->bandName( i ) == rasterBandElem.text() )
{
band = i;
break;
}
return re.cap(1).toInt();
}
}
return band;
Expand Down

0 comments on commit d6c16dd

Please sign in to comment.