Skip to content

Commit 7d70f32

Browse files
committedMay 29, 2016
Fix style in previous commit regarding comparisons against nullptr
Cherry-picked from ed08ffb
1 parent 05953cb commit 7d70f32

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed
 

‎src/providers/ogr/qgsogrfeatureiterator.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource* source, bool
4444
mFeatureFetched = false;
4545

4646
mConn = QgsOgrConnPool::instance()->acquireConnection( mSource->mProvider->dataSourceUri() );
47-
if ( mConn->ds == nullptr )
47+
if ( !mConn->ds )
4848
{
4949
return;
5050
}
@@ -57,15 +57,15 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource* source, bool
5757
{
5858
ogrLayer = OGR_DS_GetLayerByName( mConn->ds, TO8( mSource->mLayerName ) );
5959
}
60-
if ( ogrLayer == nullptr )
60+
if ( !ogrLayer )
6161
{
6262
return;
6363
}
6464

6565
if ( !mSource->mSubsetString.isEmpty() )
6666
{
6767
ogrLayer = QgsOgrUtils::setSubsetString( ogrLayer, mConn->ds, mSource->mEncoding, mSource->mSubsetString );
68-
if ( ogrLayer == nullptr )
68+
if ( !ogrLayer )
6969
{
7070
return;
7171
}
@@ -216,7 +216,7 @@ bool QgsOgrFeatureIterator::fetchFeature( QgsFeature& feature )
216216
{
217217
feature.setValid( false );
218218

219-
if ( mClosed || ogrLayer == nullptr )
219+
if ( mClosed || !ogrLayer )
220220
return false;
221221

222222
if ( mRequest.filterType() == QgsFeatureRequest::FilterFid )
@@ -261,7 +261,7 @@ bool QgsOgrFeatureIterator::fetchFeature( QgsFeature& feature )
261261

262262
bool QgsOgrFeatureIterator::rewind()
263263
{
264-
if ( mClosed || ogrLayer == nullptr )
264+
if ( mClosed || !ogrLayer )
265265
return false;
266266

267267
OGR_L_ResetReading( ogrLayer );

‎src/providers/ogr/qgsogrprovider.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ bool QgsOgrProvider::setSubsetString( const QString& theSQL, bool updateFeatureC
395395
{
396396
QgsCPLErrorHandler handler;
397397

398-
if ( ogrDataSource == nullptr )
398+
if ( !ogrDataSource )
399399
return false;
400400

401401
if ( theSQL == mSubsetString && mFeaturesCounted >= 0 )
@@ -695,7 +695,7 @@ void QgsOgrProvider::loadFields()
695695
QgsOgrConnPool::instance()->invalidateConnections( dataSourceUri() );
696696
//the attribute fields need to be read again when the encoding changes
697697
mAttributeFields.clear();
698-
if ( ogrLayer == nullptr )
698+
if ( !ogrLayer )
699699
return;
700700

701701
if ( mOgrGeometryTypeFilter != wkbUnknown )
@@ -2694,7 +2694,7 @@ bool QgsOgrProvider::syncToDisc()
26942694

26952695
void QgsOgrProvider::recalculateFeatureCount()
26962696
{
2697-
if ( ogrLayer == nullptr )
2697+
if ( !ogrLayer )
26982698
{
26992699
mFeaturesCounted = 0;
27002700
return;
@@ -2927,7 +2927,7 @@ void QgsOgrProvider::open( OpenMode mode )
29272927

29282928
ogrLayer = ogrOrigLayer;
29292929
}
2930-
if ( ogrLayer != nullptr )
2930+
if ( ogrLayer )
29312931
{
29322932
mValid = true;
29332933
mDynamicWriteAccess = true;
@@ -2999,7 +2999,7 @@ bool QgsOgrProvider::enterUpdateMode()
29992999
QgsDebugMsg( QString( "Reopening %1 in update mode" ).arg( dataSourceUri() ) );
30003000
close();
30013001
open( OpenModeForceUpdate );
3002-
if ( ogrDataSource == nullptr || !mWriteAccess )
3002+
if ( !ogrDataSource || !mWriteAccess )
30033003
{
30043004
QgsMessageLog::logMessage( tr( "Cannot reopen datasource %1 in update mode" ).arg( dataSourceUri() ), tr( "OGR" ) );
30053005
pushError( tr( "Cannot reopen datasource %1 in update mode" ).arg( dataSourceUri() ) );
@@ -3032,7 +3032,7 @@ bool QgsOgrProvider::leaveUpdateMode()
30323032
QgsDebugMsg( QString( "Reopening %1 in read-only mode" ).arg( dataSourceUri() ) );
30333033
close();
30343034
open( OpenModeForceReadOnly );
3035-
if ( ogrDataSource == nullptr )
3035+
if ( !ogrDataSource )
30363036
{
30373037
QgsMessageLog::logMessage( tr( "Cannot reopen datasource %1 in read-only mode" ).arg( dataSourceUri() ), tr( "OGR" ) );
30383038
pushError( tr( "Cannot reopen datasource %1 in read-only mode" ).arg( dataSourceUri() ) );

0 commit comments

Comments
 (0)
Please sign in to comment.