Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
dxf export: fix output of offset linestrings
(cherry picked from commit 077083a)
  • Loading branch information
jef-n committed Dec 14, 2021
1 parent 0837f20 commit cc1b49f
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/core/dxf/qgsdxfexport.cpp
Expand Up @@ -1612,11 +1612,16 @@ void QgsDxfExport::addFeature( QgsSymbolRenderContext &ctx, const QgsCoordinateT
}

const QgsCurve *curve = dynamic_cast<const QgsCurve *>( sourceGeom );
Q_ASSERT( curve );
writePolyline( *curve, layer, lineStyleName, penColor, width );
if ( curve )
{
writePolyline( *curve, layer, lineStyleName, penColor, width );
break;
}

break;
// Offset with miter might have turned the simple to a multiline string
offset = 0.0;
}
FALLTHROUGH

case QgsWkbTypes::MultiCurve:
case QgsWkbTypes::MultiLineString:
Expand All @@ -1632,14 +1637,17 @@ void QgsDxfExport::addFeature( QgsSymbolRenderContext &ctx, const QgsCoordinateT
}

const QgsGeometryCollection *gc = dynamic_cast<const QgsGeometryCollection *>( sourceGeom );
Q_ASSERT( gc );

for ( int i = 0; i < gc->numGeometries(); i++ )
if ( gc )
{
const QgsCurve *curve = dynamic_cast<const QgsCurve *>( gc->geometryN( i ) );
Q_ASSERT( curve );
writePolyline( *curve, layer, lineStyleName, penColor, width );
for ( int i = 0; i < gc->numGeometries(); i++ )
{
const QgsCurve *curve = dynamic_cast<const QgsCurve *>( gc->geometryN( i ) );
Q_ASSERT( curve );
writePolyline( *curve, layer, lineStyleName, penColor, width );
}
}
else
Q_ASSERT( gc );

break;
}
Expand Down

0 comments on commit cc1b49f

Please sign in to comment.