[QGIS Commit] r12871 - trunk/qgis/src/app/attributetable
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Thu Feb 4 04:31:43 EST 2010
Author: jef
Date: 2010-02-04 04:31:40 -0500 (Thu, 04 Feb 2010)
New Revision: 12871
Modified:
trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp
Log:
fix r12869: if first feature has id 0 it wasn't retrieved
Modified: trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp
===================================================================
--- trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp 2010-02-04 02:22:56 UTC (rev 12870)
+++ trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp 2010-02-04 09:31:40 UTC (rev 12871)
@@ -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 @@
{
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];
More information about the QGIS-commit
mailing list