Skip to content

Commit

Permalink
fix references to joined fields of vector layer
Browse files Browse the repository at this point in the history
  • Loading branch information
minorua committed Nov 30, 2012
1 parent aab08cb commit 8a90e2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -5566,14 +5566,14 @@ QVariant QgsVectorLayer::minimumValue( int index )
} }
else // a joined field? else // a joined field?
{ {
int indexOffset; //offset between layer index and joined provider index int indexOffset = 0; //offset between layer index and joined provider index
const QgsVectorJoinInfo* join = mJoinBuffer->joinForFieldIndex( index, maxProviderIndex, indexOffset ); const QgsVectorJoinInfo* join = mJoinBuffer->joinForFieldIndex( index, maxProviderIndex, indexOffset );
if ( join ) if ( join )
{ {
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( join->joinLayerId ) ); QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( join->joinLayerId ) );
if ( vl ) if ( vl )
{ {
return vl->minimumValue( index ); return vl->minimumValue( index - indexOffset );
} }
} }
} }
Expand Down Expand Up @@ -5620,14 +5620,14 @@ QVariant QgsVectorLayer::maximumValue( int index )
} }
else // a joined field? else // a joined field?
{ {
int indexOffset; //offset between layer index and joined provider index int indexOffset = 0; //offset between layer index and joined provider index
const QgsVectorJoinInfo* join = mJoinBuffer->joinForFieldIndex( index, maxProviderIndex, indexOffset ); const QgsVectorJoinInfo* join = mJoinBuffer->joinForFieldIndex( index, maxProviderIndex, indexOffset );
if ( join ) if ( join )
{ {
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( join->joinLayerId ) ); QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( join->joinLayerId ) );
if ( vl ) if ( vl )
{ {
return vl->maximumValue( index ); return vl->maximumValue( index - indexOffset );
} }
} }
} }
Expand Down

0 comments on commit 8a90e2c

Please sign in to comment.