Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c35ea6e

Browse files
committedOct 2, 2018
Finalize FID_NULL
1 parent 626ad6c commit c35ea6e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎src/core/qgsfeatureid.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ email : matthias@opengis.ch
2424
// 64 bit feature ids
2525
typedef qint64 QgsFeatureId SIP_SKIP;
2626
#define FID_NULL std::numeric_limits<QgsFeatureId>::min()
27-
#define FID_IS_NULL(fid) (fid==std::numeric_limits<QgsFeatureId>::min())
28-
#define FID_IS_NEW(fid) (fid<0)
29-
#define FID_TO_NUMBER(fid) static_cast<qint64>(fid)
30-
#define FID_TO_STRING(fid) QString::number( fid )
31-
#define STRING_TO_FID(str) (str).toLongLong()
27+
#define FID_IS_NULL(fid) ( fid == std::numeric_limits<QgsFeatureId>::min() )
28+
#define FID_IS_NEW(fid) ( fid < 0 && fid != std::numeric_limits<QgsFeatureId>::min() )
29+
#define FID_TO_NUMBER(fid) static_cast<qint64>( fid )
30+
#define FID_TO_STRING(fid) ( fid != std::numeric_limits<QgsFeatureId>::min() ? QString::number( fid ) : QStringLiteral( "NULL" ) )
31+
#define STRING_TO_FID(str) ( ( fid != QLatin1String( "NULL" ) ) ? (str).toLongLong() : std::numeric_limits<QgsFeatureId>::min() )
3232

3333
#ifndef SIP_RUN
3434
typedef QSet<QgsFeatureId> QgsFeatureIds;

0 commit comments

Comments
 (0)
Please sign in to comment.