Skip to content

Commit e67eb4a

Browse files
committed
Fix crash in dxf export in no-symbology mode
1 parent adb9be1 commit e67eb4a

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/core/dxf/qgsdxfexport.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -834,8 +834,11 @@ void QgsDxfExport::writePolyline( const QgsPolyline& line, const QString& layer,
834834
writeGroup( 66, 1 );
835835
int type = polygon ? 1 : 0;
836836
writeGroup( 70, type );
837-
writeGroup( 40, width );
838-
writeGroup( 41, width );
837+
if ( width > 0 ) //width -1: use default width
838+
{
839+
writeGroup( 40, width );
840+
writeGroup( 41, width );
841+
}
839842

840843
QgsPolyline::const_iterator lineIt = line.constBegin();
841844
for ( ; lineIt != line.constEnd(); ++lineIt )
@@ -955,7 +958,11 @@ void QgsDxfExport::addFeature( const QgsSymbolV2RenderContext& ctx, const QStrin
955958
{
956959
c = colorFromSymbolLayer( symbolLayer, ctx );
957960
}
958-
double width = symbolLayer->dxfWidth( *this, ctx );
961+
double width = -1;
962+
if ( mSymbologyExport != NoSymbology && symbolLayer )
963+
{
964+
width = symbolLayer->dxfWidth( *this, ctx );
965+
}
959966
QString lineStyleName = "CONTINUOUS";
960967
if ( mSymbologyExport != NoSymbology )
961968
{

0 commit comments

Comments
 (0)