Skip to content

Commit

Permalink
Fix data defined properties in dxf export
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent authored and nyalldawson committed Jun 17, 2018
1 parent 5cc97b5 commit bc41e0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/core/dxf/qgsdxfexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -994,12 +994,14 @@ void QgsDxfExport::writeEntities()
QgsDebugMsg( QString( "%1: not override style" ).arg( vl->id() ) );
}

QgsSymbolRenderContext sctx( ctx, QgsUnitTypes::RenderMillimeters, 1.0, false, nullptr, nullptr );
if ( !vl->renderer() )
{
continue;
}

ctx.expressionContext().appendScope( QgsExpressionContextUtils::layerScope( ml ) );
QgsSymbolRenderContext sctx( ctx, QgsUnitTypes::RenderMillimeters, 1.0, false, nullptr, nullptr );

std::unique_ptr< QgsFeatureRenderer > renderer( vl->renderer()->clone() );
renderer->startRender( ctx, vl->fields() );

Expand Down Expand Up @@ -1046,6 +1048,7 @@ void QgsDxfExport::writeEntities()
writeEntitiesSymbolLevels( vl );
renderer->stopRender( ctx );

delete ctx.expressionContext().popScope();
continue;
}

Expand Down Expand Up @@ -1129,6 +1132,7 @@ void QgsDxfExport::writeEntities()
}

renderer->stopRender( ctx );
delete ctx.expressionContext().popScope();
}

engine.run( ctx );
Expand Down
1 change: 0 additions & 1 deletion src/core/symbology/qgsmarkersymbollayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,6 @@ bool QgsSimpleMarkerSymbolLayer::writeDxf( QgsDxfExport &e, double mmMapUnitScal
bool ok = true;
if ( hasDataDefinedSize )
{
context.setOriginalValueVariable( mSize );
size = mDataDefinedProperties.valueAsDouble( QgsSymbolLayer::PropertySize, context.renderContext().expressionContext(), mSize, &ok );

if ( ok )
Expand Down

0 comments on commit bc41e0d

Please sign in to comment.