Skip to content

Commit d2da7ed

Browse files
author
jef
committedFeb 4, 2010
fix r12869: if first feature has id 0 it wasn't retrieved
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12871 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/app/attributetable/qgsattributetablemodel.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include <QtGui>
2626
#include <QVariant>
27+
#include <limits>
2728

2829
////////////////////////////
2930
// QgsAttributeTableModel //
@@ -32,6 +33,7 @@
3233
QgsAttributeTableModel::QgsAttributeTableModel( QgsVectorLayer *theLayer, QObject *parent )
3334
: QAbstractTableModel( parent )
3435
{
36+
mFeat.setFeatureId( std::numeric_limits<int>::min() );
3537
mLayer = theLayer;
3638
mFeatureCount = mLayer->pendingFeatureCount();
3739
loadAttributes();
@@ -273,7 +275,7 @@ int QgsAttributeTableModel::rowToId( const int id ) const
273275
{
274276
QgsDebugMsg( QString( "rowToId: row %1 not in the map" ).arg( id ) );
275277
// return negative infinite (to avoid collision with newly added features)
276-
return -999999;
278+
return std::numeric_limits<int>::min();
277279
}
278280

279281
return mRowIdMap[id];

0 commit comments

Comments
 (0)
Please sign in to comment.