Skip to content

Commit

Permalink
fix r12869: if first feature has id 0 it wasn't retrieved
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12871 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Feb 4, 2010
1 parent e2fb63a commit f2d9cf3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/attributetable/qgsattributetablemodel.cpp
Expand Up @@ -24,6 +24,7 @@

#include <QtGui>
#include <QVariant>
#include <limits>

////////////////////////////
// QgsAttributeTableModel //
Expand All @@ -32,6 +33,7 @@
QgsAttributeTableModel::QgsAttributeTableModel( QgsVectorLayer *theLayer, QObject *parent )
: QAbstractTableModel( parent )
{
mFeat.setFeatureId( std::numeric_limits<int>::min() );
mLayer = theLayer;
mFeatureCount = mLayer->pendingFeatureCount();
loadAttributes();
Expand Down Expand Up @@ -273,7 +275,7 @@ int QgsAttributeTableModel::rowToId( const int id ) const
{
QgsDebugMsg( QString( "rowToId: row %1 not in the map" ).arg( id ) );
// return negative infinite (to avoid collision with newly added features)
return -999999;
return std::numeric_limits<int>::min();
}

return mRowIdMap[id];
Expand Down

0 comments on commit f2d9cf3

Please sign in to comment.