Skip to content
Permalink
Browse files
dxf export: fix output of offset linestrings
  • Loading branch information
jef-n committed Sep 14, 2021
1 parent e53a2e0 commit 077083a7a690c34210ea33371f86f54d74287995
Showing with 17 additions and 9 deletions.
  1. +17 −9 src/core/dxf/qgsdxfexport.cpp
@@ -1625,11 +1625,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:
@@ -1645,14 +1650,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;
}

0 comments on commit 077083a

Please sign in to comment.