Skip to content

Commit

Permalink
Saver attribute map handling (no insertion of additional entry if a c…
Browse files Browse the repository at this point in the history
…olumn does not exist)

git-svn-id: http://svn.osgeo.org/qgis/trunk@15388 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Mar 8, 2011
1 parent dce9d14 commit caa0cae
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -1902,7 +1902,13 @@ void QgsOgrProvider::uniqueValues( int index, QList<QVariant> &uniqueValues, int

QVariant QgsOgrProvider::minimumValue( int index )
{
QgsField fld = mAttributeFields[index];
QgsFieldMap::const_iterator attIt = mAttributeFields.find( index );
if ( attIt == mAttributeFields.constEnd() )
{
return QVariant();
}
const QgsField& fld = attIt.value();

QString theLayerName = OGR_FD_GetName( OGR_L_GetLayerDefn( ogrLayer ) );

QString sql = QString( "SELECT MIN(%1) FROM %2" )
Expand Down Expand Up @@ -1936,7 +1942,13 @@ QVariant QgsOgrProvider::minimumValue( int index )

QVariant QgsOgrProvider::maximumValue( int index )
{
QgsField fld = mAttributeFields[index];
QgsFieldMap::const_iterator attIt = mAttributeFields.find( index );
if ( attIt == mAttributeFields.constEnd() )
{
return QVariant();
}
const QgsField& fld = mAttributeFields[index];

QString theLayerName = OGR_FD_GetName( OGR_L_GetLayerDefn( ogrLayer ) );

QString sql = QString( "SELECT MAX(%1) FROM %2" )
Expand Down

0 comments on commit caa0cae

Please sign in to comment.