Saver attribute map handling (no insertion of additional entry if a column does not exist)

git-svn-id: http://svn.osgeo.org/qgis/trunk@15388 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
mhugent 2011-03-08 08:10:37 +00:00
parent dce9d141ec
commit caa0cae3b9

View File

@ -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" )
@ -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" )