Fix setting correct WKB type for compound curves when adding first curve

This commit is contained in:
Nyall Dawson 2017-09-20 08:28:45 +10:00
parent cee1f56159
commit 9d9c0e40a6

View File

@ -396,13 +396,13 @@ void QgsCompoundCurve::addCurve( QgsCurve *c )
{ {
if ( c ) if ( c )
{ {
mCurves.append( c ); if ( mCurves.empty() )
if ( mWkbType == QgsWkbTypes::Unknown )
{ {
setZMTypeFromSubGeometry( c, QgsWkbTypes::CompoundCurve ); setZMTypeFromSubGeometry( c, QgsWkbTypes::CompoundCurve );
} }
mCurves.append( c );
if ( QgsWkbTypes::hasZ( mWkbType ) && !QgsWkbTypes::hasZ( c->wkbType() ) ) if ( QgsWkbTypes::hasZ( mWkbType ) && !QgsWkbTypes::hasZ( c->wkbType() ) )
{ {
c->addZValue(); c->addZValue();