Skip to content

Commit ed08ffb

Browse files
committedMay 4, 2016
Fix style in previous commit regarding comparisons against nullptr
1 parent dc18b5b commit ed08ffb

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
@@ -46,7 +46,7 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource* source, bool
4646
mFeatureFetched = false;
4747

4848
mConn = QgsOgrConnPool::instance()->acquireConnection( mSource->mProvider->dataSourceUri() );
49-
if ( mConn->ds == nullptr )
49+
if ( !mConn->ds )
5050
{
5151
return;
5252
}
@@ -59,15 +59,15 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource* source, bool
5959
{
6060
ogrLayer = OGR_DS_GetLayerByName( mConn->ds, TO8( mSource->mLayerName ) );
6161
}
62-
if ( ogrLayer == nullptr )
62+
if ( !ogrLayer )
6363
{
6464
return;
6565
}
6666

6767
if ( !mSource->mSubsetString.isEmpty() )
6868
{
6969
ogrLayer = QgsOgrProviderUtils::setSubsetString( ogrLayer, mConn->ds, mSource->mEncoding, mSource->mSubsetString );
70-
if ( ogrLayer == nullptr )
70+
if ( !ogrLayer )
7171
{
7272
return;
7373
}
@@ -224,7 +224,7 @@ bool QgsOgrFeatureIterator::fetchFeature( QgsFeature& feature )
224224
{
225225
feature.setValid( false );
226226

227-
if ( mClosed || ogrLayer == nullptr )
227+
if ( mClosed || !ogrLayer )
228228
return false;
229229

230230
if ( mRequest.filterType() == QgsFeatureRequest::FilterFid )
@@ -268,7 +268,7 @@ bool QgsOgrFeatureIterator::fetchFeature( QgsFeature& feature )
268268

269269
bool QgsOgrFeatureIterator::rewind()
270270
{
271-
if ( mClosed || ogrLayer == nullptr )
271+
if ( mClosed || !ogrLayer )
272272
return false;
273273

274274
OGR_L_ResetReading( ogrLayer );

‎src/providers/ogr/qgsogrprovider.cpp

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

399-
if ( ogrDataSource == nullptr )
399+
if ( !ogrDataSource )
400400
return false;
401401

402402
if ( theSQL == mSubsetString && mFeaturesCounted >= 0 )
@@ -729,7 +729,7 @@ void QgsOgrProvider::loadFields()
729729
QgsOgrConnPool::instance()->invalidateConnections( dataSourceUri() );
730730
//the attribute fields need to be read again when the encoding changes
731731
mAttributeFields.clear();
732-
if ( ogrLayer == nullptr )
732+
if ( !ogrLayer )
733733
return;
734734

735735
if ( mOgrGeometryTypeFilter != wkbUnknown )
@@ -2828,7 +2828,7 @@ bool QgsOgrProvider::syncToDisc()
28282828

28292829
void QgsOgrProvider::recalculateFeatureCount()
28302830
{
2831-
if ( ogrLayer == nullptr )
2831+
if ( !ogrLayer )
28322832
{
28332833
mFeaturesCounted = 0;
28342834
return;
@@ -3061,7 +3061,7 @@ void QgsOgrProvider::open( OpenMode mode )
30613061

30623062
ogrLayer = ogrOrigLayer;
30633063
}
3064-
if ( ogrLayer != nullptr )
3064+
if ( ogrLayer )
30653065
{
30663066
mValid = true;
30673067
mDynamicWriteAccess = true;
@@ -3133,7 +3133,7 @@ bool QgsOgrProvider::enterUpdateMode()
31333133
QgsDebugMsg( QString( "Reopening %1 in update mode" ).arg( dataSourceUri() ) );
31343134
close();
31353135
open( OpenModeForceUpdate );
3136-
if ( ogrDataSource == nullptr || !mWriteAccess )
3136+
if ( !ogrDataSource || !mWriteAccess )
31373137
{
31383138
QgsMessageLog::logMessage( tr( "Cannot reopen datasource %1 in update mode" ).arg( dataSourceUri() ), tr( "OGR" ) );
31393139
pushError( tr( "Cannot reopen datasource %1 in update mode" ).arg( dataSourceUri() ) );
@@ -3166,7 +3166,7 @@ bool QgsOgrProvider::leaveUpdateMode()
31663166
QgsDebugMsg( QString( "Reopening %1 in read-only mode" ).arg( dataSourceUri() ) );
31673167
close();
31683168
open( OpenModeForceReadOnly );
3169-
if ( ogrDataSource == nullptr )
3169+
if ( !ogrDataSource )
31703170
{
31713171
QgsMessageLog::logMessage( tr( "Cannot reopen datasource %1 in read-only mode" ).arg( dataSourceUri() ), tr( "OGR" ) );
31723172
pushError( tr( "Cannot reopen datasource %1 in read-only mode" ).arg( dataSourceUri() ) );

0 commit comments

Comments
 (0)
Please sign in to comment.