Skip to content
Permalink
Browse files

fix r12869: if first feature has id 0 it wasn't retrieved

git-svn-id: http://svn.osgeo.org/qgis/trunk@12871 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Feb 4, 2010
1 parent e2fb63a commit f2d9cf34b93a863ab2cdcd935cdfdecec98c9a84
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/app/attributetable/qgsattributetablemodel.cpp
@@ -24,6 +24,7 @@

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

////////////////////////////
// QgsAttributeTableModel //
@@ -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();
@@ -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];

0 comments on commit f2d9cf3

Please sign in to comment.
You can’t perform that action at this time.