Skip to content
Permalink
Browse files

Fix data defined properties in dxf export

  • Loading branch information
mhugent authored and nyalldawson committed Jun 11, 2018
1 parent 5cc97b5 commit bc41e0df1ce65db7d5fc43ef659ce3550cf375a6
Showing with 5 additions and 2 deletions.
  1. +5 −1 src/core/dxf/qgsdxfexport.cpp
  2. +0 −1 src/core/symbology/qgsmarkersymbollayer.cpp
@@ -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() );

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

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

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

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

engine.run( ctx );
@@ -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 )

0 comments on commit bc41e0d

Please sign in to comment.
You can’t perform that action at this time.