Skip to content

Commit 8a90e2c

Browse files
committed
fix references to joined fields of vector layer
1 parent aab08cb commit 8a90e2c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/qgsvectorlayer.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -5566,14 +5566,14 @@ QVariant QgsVectorLayer::minimumValue( int index )
55665566
}
55675567
else // a joined field?
55685568
{
5569-
int indexOffset; //offset between layer index and joined provider index
5569+
int indexOffset = 0; //offset between layer index and joined provider index
55705570
const QgsVectorJoinInfo* join = mJoinBuffer->joinForFieldIndex( index, maxProviderIndex, indexOffset );
55715571
if ( join )
55725572
{
55735573
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( join->joinLayerId ) );
55745574
if ( vl )
55755575
{
5576-
return vl->minimumValue( index );
5576+
return vl->minimumValue( index - indexOffset );
55775577
}
55785578
}
55795579
}
@@ -5620,14 +5620,14 @@ QVariant QgsVectorLayer::maximumValue( int index )
56205620
}
56215621
else // a joined field?
56225622
{
5623-
int indexOffset; //offset between layer index and joined provider index
5623+
int indexOffset = 0; //offset between layer index and joined provider index
56245624
const QgsVectorJoinInfo* join = mJoinBuffer->joinForFieldIndex( index, maxProviderIndex, indexOffset );
56255625
if ( join )
56265626
{
56275627
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( join->joinLayerId ) );
56285628
if ( vl )
56295629
{
5630-
return vl->maximumValue( index );
5630+
return vl->maximumValue( index - indexOffset );
56315631
}
56325632
}
56335633
}

0 commit comments

Comments
 (0)