Skip to content

Commit 327f3e9

Browse files
committedDec 2, 2014
Merge pull request #1717 from manisandro/int_ogrwkbgeometrytype
Store result of OGR_FD_GetGeomType into a OGRwkbGeometryType, not in an int, ...
2 parents d034a66 + 81895f9 commit 327f3e9

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed
 

‎src/core/qgsvectorlayer.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ bool QgsVectorLayer::hasGeometryType() const
650650

651651
QGis::WkbType QgsVectorLayer::wkbType() const
652652
{
653-
return ( QGis::WkbType )( mWkbType );
653+
return mWkbType;
654654
}
655655

656656
QgsRectangle QgsVectorLayer::boundingBoxOfSelected()
@@ -2143,7 +2143,7 @@ bool QgsVectorLayer::deleteAttributes( QList<int> attrs )
21432143

21442144
qSort( attrs.begin(), attrs.end(), qGreater<int>() );
21452145

2146-
Q_FOREACH ( int attr, attrs )
2146+
Q_FOREACH( int attr, attrs )
21472147
{
21482148
if ( deleteAttribute( attr ) )
21492149
{
@@ -2839,7 +2839,7 @@ void QgsVectorLayer::uniqueValues( int index, QList<QVariant> &uniqueValues, int
28392839
if ( mEditBuffer )
28402840
{
28412841
QSet<QString> vals;
2842-
Q_FOREACH ( const QVariant& v, uniqueValues )
2842+
Q_FOREACH( const QVariant& v, uniqueValues )
28432843
{
28442844
vals << v.toString();
28452845
}
@@ -3565,13 +3565,13 @@ void QgsVectorLayer::invalidateSymbolCountedFlag()
35653565

35663566
void QgsVectorLayer::onRelationsLoaded()
35673567
{
3568-
Q_FOREACH ( QgsAttributeEditorElement* elem, mAttributeEditorElements )
3568+
Q_FOREACH( QgsAttributeEditorElement* elem, mAttributeEditorElements )
35693569
{
35703570
if ( elem->type() == QgsAttributeEditorElement::AeTypeContainer )
35713571
{
35723572
QgsAttributeEditorContainer* cont = dynamic_cast< QgsAttributeEditorContainer* >( elem );
35733573
QList<QgsAttributeEditorElement*> relations = cont->findElements( QgsAttributeEditorElement::AeTypeRelation );
3574-
Q_FOREACH ( QgsAttributeEditorElement* relElem, relations )
3574+
Q_FOREACH( QgsAttributeEditorElement* relElem, relations )
35753575
{
35763576
QgsAttributeEditorRelation* rel = dynamic_cast< QgsAttributeEditorRelation* >( relElem );
35773577
rel->init( QgsProject::instance()->relationManager() );
@@ -3627,7 +3627,7 @@ QDomElement QgsAttributeEditorContainer::toDomElement( QDomDocument& doc ) const
36273627
QDomElement elem = doc.createElement( "attributeEditorContainer" );
36283628
elem.setAttribute( "name", mName );
36293629

3630-
Q_FOREACH ( QgsAttributeEditorElement* child, mChildren )
3630+
Q_FOREACH( QgsAttributeEditorElement* child, mChildren )
36313631
{
36323632
elem.appendChild( child->toDomElement( doc ) );
36333633
}
@@ -3643,7 +3643,7 @@ QList<QgsAttributeEditorElement*> QgsAttributeEditorContainer::findElements( Qgs
36433643
{
36443644
QList<QgsAttributeEditorElement*> results;
36453645

3646-
Q_FOREACH ( QgsAttributeEditorElement* elem, mChildren )
3646+
Q_FOREACH( QgsAttributeEditorElement* elem, mChildren )
36473647
{
36483648
if ( elem->type() == type )
36493649
{

‎src/core/qgsvectorlayer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
17351735
QList< TabData > mTabs;
17361736

17371737
/** Geometry type as defined in enum WkbType (qgis.h) */
1738-
int mWkbType;
1738+
QGis::WkbType mWkbType;
17391739

17401740
/** Renderer object which holds the information about how to display the features */
17411741
QgsFeatureRendererV2 *mRendererV2;

‎src/providers/ogr/qgsogrdataitems.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static QgsOgrLayerItem* dataItemForLayer( QgsDataItem* parentItem, QString name,
140140
OGRFeatureDefnH hDef = OGR_L_GetLayerDefn( hLayer );
141141

142142
QgsLayerItem::LayerType layerType = QgsLayerItem::Vector;
143-
int ogrType = QgsOgrProvider::getOgrGeomType( hLayer );
143+
OGRwkbGeometryType ogrType = QgsOgrProvider::getOgrGeomType( hLayer );
144144
switch ( ogrType )
145145
{
146146
case wkbUnknown:

‎src/providers/ogr/qgsogrprovider.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,10 @@ void QgsOgrProvider::setEncoding( const QString& e )
695695
}
696696

697697
// This is reused by dataItem
698-
int QgsOgrProvider::getOgrGeomType( OGRLayerH ogrLayer )
698+
OGRwkbGeometryType QgsOgrProvider::getOgrGeomType( OGRLayerH ogrLayer )
699699
{
700700
OGRFeatureDefnH fdef = OGR_L_GetLayerDefn( ogrLayer );
701-
int geomType = wkbUnknown;
701+
OGRwkbGeometryType geomType = wkbUnknown;
702702
if ( fdef )
703703
{
704704
geomType = OGR_FD_GetGeomType( fdef );
@@ -935,7 +935,7 @@ size_t QgsOgrProvider::layerCount() const
935935
*/
936936
QGis::WkbType QgsOgrProvider::geometryType() const
937937
{
938-
return ( QGis::WkbType ) geomType;
938+
return static_cast<QGis::WkbType>( geomType );
939939
}
940940

941941
/**

‎src/providers/ogr/qgsogrprovider.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ class QgsOgrProvider : public QgsVectorDataProvider
248248
virtual bool doesStrictFeatureTypeCheck() const { return false;}
249249

250250
/** return OGR geometry type */
251-
static int getOgrGeomType( OGRLayerH ogrLayer );
251+
static OGRwkbGeometryType getOgrGeomType( OGRLayerH ogrLayer );
252252

253253
/** Get single flatten geometry type */
254254
static OGRwkbGeometryType ogrWkbSingleFlatten( OGRwkbGeometryType type );
@@ -325,7 +325,7 @@ class QgsOgrProvider : public QgsVectorDataProvider
325325
bool valid;
326326
//! Flag to indicate that spatial intersect should be used in selecting features
327327
bool mUseIntersect;
328-
int geomType;
328+
OGRwkbGeometryType geomType;
329329
long featuresCounted;
330330

331331
//! Data has been modified - REPACK before creating a spatialindex

0 commit comments

Comments
 (0)
Please sign in to comment.