Skip to content

Commit

Permalink
Merge pull request #5061 from nouanda/fix16887
Browse files Browse the repository at this point in the history
Fix #16887: creating a memory scratch layer with Z/M values does not add Z/M to the layer
  • Loading branch information
nyalldawson authored Aug 25, 2017
2 parents 65455c4 + 018c13a commit 233f25a
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/app/nodetool/qgsnodeeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,19 @@ QgsNodeEditorModel::QgsNodeEditorModel( QgsVectorLayer *layer, QgsSelectedFeatur
, mRCol( -1 )
{

if ( !mSelectedFeature->vertexMap().isEmpty() )
{
mHasZ = mSelectedFeature->vertexMap().at( 0 )->point().is3D();
mHasM = mSelectedFeature->vertexMap().at( 0 )->point().isMeasure();
QgsWkbTypes::Type layerWKBType = mLayer->wkbType();

if ( mHasZ )
mZCol = 2;
mHasZ = QgsWkbTypes::hasZ( layerWKBType );
mHasM = QgsWkbTypes::hasM( layerWKBType );

if ( mHasM )
mMCol = 2 + ( mHasZ ? 1 : 0 );
if ( mHasZ )
mZCol = 2;

if ( mHasR )
mRCol = 2 + ( mHasZ ? 1 : 0 ) + ( mHasM ? 1 : 0 );
}
if ( mHasM )
mMCol = 2 + ( mHasZ ? 1 : 0 );

if ( mHasR )
mRCol = 2 + ( mHasZ ? 1 : 0 ) + ( mHasM ? 1 : 0 );

QWidget *parentWidget = dynamic_cast< QWidget * >( parent );
if ( parentWidget )
Expand Down

0 comments on commit 233f25a

Please sign in to comment.