Skip to content

Commit

Permalink
cleaning + more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
luipir committed Sep 26, 2017
1 parent d0859f1 commit 1aaad7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/core/qgsvectordataprovider.cpp
Expand Up @@ -715,6 +715,7 @@ QgsGeometry* QgsVectorDataProvider::convertToProviderType( const QgsGeometry* ge
}

// remove Z if provider does not have
// control added to fix https://issues.qgis.org/issues/16927
if ( !QgsWKBTypes::hasZ( providerGeomType ) && QgsWKBTypes::hasZ( geometry->wkbType() ) )
{
if ( !outputGeom )
Expand All @@ -725,6 +726,7 @@ QgsGeometry* QgsVectorDataProvider::convertToProviderType( const QgsGeometry* ge
}

// remove M if provider does not have
// control added as follow-up of https://issues.qgis.org/issues/16927
if ( !QgsWKBTypes::hasM( providerGeomType ) && QgsWKBTypes::hasM( geometry->wkbType() ) )
{
if ( !outputGeom )
Expand Down
11 changes: 7 additions & 4 deletions src/core/qgsvectorlayereditbuffer.cpp
Expand Up @@ -113,9 +113,6 @@ void QgsVectorLayerEditBuffer::updateChangedAttributes( QgsFeature &f )
f.setAttributes( attrs );
}




bool QgsVectorLayerEditBuffer::addFeature( QgsFeature& f )
{
QgsVectorDataProvider* provider = L->dataProvider();
Expand All @@ -135,7 +132,6 @@ bool QgsVectorLayerEditBuffer::addFeature( QgsFeature& f )
return true;
}


bool QgsVectorLayerEditBuffer::addFeatures( QgsFeatureList& features )
{
if ( !( L->dataProvider()->capabilities() & QgsVectorDataProvider::AddFeatures ) )
Expand Down Expand Up @@ -186,6 +182,13 @@ bool QgsVectorLayerEditBuffer::deleteFeatures( const QgsFeatureIds& fids )

bool QgsVectorLayerEditBuffer::adaptGeometry( QgsGeometry* geom )
{
/* this routine was introduced to fi the following issue:
* https://issues.qgis.org/issues/15741
* and later used in changeGeometry and addFeature to
* fix also the following issue
* https://issues.qgis.org/issues/16948
* https://issues.qgis.org/issues/15741
*/
QgsVectorDataProvider* provider = L->dataProvider();
if ( geom && geom->geometry() &&
!geom->isEmpty() &&
Expand Down

0 comments on commit 1aaad7b

Please sign in to comment.