Skip to content
Permalink
Browse files
Merge pull request #345 from bischofia/joined_minmax
fix references to joined fields of vector layer
  • Loading branch information
mhugent committed Dec 6, 2012
2 parents b304df8 + 8a90e2c commit fcedd5db2bf64341a140087fabd5bf63d0bd3c1a
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/core/qgsvectorlayer.cpp
@@ -5566,14 +5566,14 @@ QVariant QgsVectorLayer::minimumValue( int index )
}
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 );
if ( join )
{
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( join->joinLayerId ) );
if ( vl )
{
return vl->minimumValue( index );
return vl->minimumValue( index - indexOffset );
}
}
}
@@ -5620,14 +5620,14 @@ QVariant QgsVectorLayer::maximumValue( int index )
}
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 );
if ( join )
{
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( join->joinLayerId ) );
if ( vl )
{
return vl->maximumValue( index );
return vl->maximumValue( index - indexOffset );
}
}
}

0 comments on commit fcedd5d

Please sign in to comment.