Skip to content

Commit

Permalink
Fix crash in dxf export in no-symbology mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Feb 10, 2014
1 parent adb9be1 commit e67eb4a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/core/dxf/qgsdxfexport.cpp
Expand Up @@ -834,8 +834,11 @@ void QgsDxfExport::writePolyline( const QgsPolyline& line, const QString& layer,
writeGroup( 66, 1 );
int type = polygon ? 1 : 0;
writeGroup( 70, type );
writeGroup( 40, width );
writeGroup( 41, width );
if ( width > 0 ) //width -1: use default width
{
writeGroup( 40, width );
writeGroup( 41, width );
}

QgsPolyline::const_iterator lineIt = line.constBegin();
for ( ; lineIt != line.constEnd(); ++lineIt )
Expand Down Expand Up @@ -955,7 +958,11 @@ void QgsDxfExport::addFeature( const QgsSymbolV2RenderContext& ctx, const QStrin
{
c = colorFromSymbolLayer( symbolLayer, ctx );
}
double width = symbolLayer->dxfWidth( *this, ctx );
double width = -1;
if ( mSymbologyExport != NoSymbology && symbolLayer )
{
width = symbolLayer->dxfWidth( *this, ctx );
}
QString lineStyleName = "CONTINUOUS";
if ( mSymbologyExport != NoSymbology )
{
Expand Down

0 comments on commit e67eb4a

Please sign in to comment.