@@ -473,6 +473,7 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
473
473
bool ok = true ;
474
474
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_SIZE ) )
475
475
{
476
+ context.setOriginalValueVariable ( mSize );
476
477
scaledSize = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_SIZE, context, mSize , &ok ).toDouble ();
477
478
}
478
479
@@ -499,6 +500,7 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
499
500
bool usingDataDefinedRotation = false ;
500
501
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_ANGLE ) )
501
502
{
503
+ context.setOriginalValueVariable ( angle );
502
504
angle = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_ANGLE, context, mAngle , &ok ).toDouble () + mLineAngle ;
503
505
usingDataDefinedRotation = ok;
504
506
}
@@ -530,6 +532,7 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
530
532
bool createdNewPath = false ;
531
533
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_NAME ) )
532
534
{
535
+ context.setOriginalValueVariable ( mName );
533
536
QString name = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_NAME, context, QVariant (), &ok ).toString ();
534
537
if ( ok )
535
538
{
@@ -571,12 +574,14 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
571
574
572
575
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_COLOR ) )
573
576
{
577
+ context.setOriginalValueVariable ( QgsSymbolLayerV2Utils::encodeColor ( mBrush .color () ) );
574
578
QString colorString = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_COLOR, context, QVariant (), &ok ).toString ();
575
579
if ( ok )
576
580
mBrush .setColor ( QgsSymbolLayerV2Utils::decodeColor ( colorString ) );
577
581
}
578
582
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_COLOR_BORDER ) )
579
583
{
584
+ context.setOriginalValueVariable ( QgsSymbolLayerV2Utils::encodeColor ( mPen .color () ) );
580
585
QString colorString = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_COLOR_BORDER, context, QVariant (), &ok ).toString ();
581
586
if ( ok )
582
587
{
@@ -586,6 +591,7 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
586
591
}
587
592
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OUTLINE_WIDTH ) )
588
593
{
594
+ context.setOriginalValueVariable ( mOutlineWidth );
589
595
double outlineWidth = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OUTLINE_WIDTH, context, QVariant (), &ok ).toDouble ();
590
596
if ( ok )
591
597
{
@@ -595,6 +601,7 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
595
601
}
596
602
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OUTLINE_STYLE ) )
597
603
{
604
+ context.setOriginalValueVariable ( QgsSymbolLayerV2Utils::encodePenStyle ( mOutlineStyle ) );
598
605
QString outlineStyle = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OUTLINE_STYLE, context, QVariant (), &ok ).toString ();
599
606
if ( ok )
600
607
{
@@ -815,6 +822,7 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
815
822
{
816
823
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_SIZE ) )
817
824
{
825
+ context->setOriginalValueVariable ( mSize );
818
826
size = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_SIZE, *context, mSize , &ok ).toDouble ();
819
827
}
820
828
@@ -843,6 +851,7 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
843
851
844
852
if ( context && hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OUTLINE_WIDTH ) )
845
853
{
854
+ context->setOriginalValueVariable ( mOutlineWidth );
846
855
outlineWidth = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OUTLINE_WIDTH, *context, mOutlineWidth ).toDouble ();
847
856
}
848
857
if ( mSizeUnit == QgsSymbolV2::MM )
@@ -855,12 +864,14 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
855
864
QColor bc = mBrush .color ();
856
865
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_COLOR ) )
857
866
{
867
+ context->setOriginalValueVariable ( QgsSymbolLayerV2Utils::encodeColor ( bc ) );
858
868
QString colorString = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_COLOR, *context, QVariant (), &ok ).toString ();
859
869
if ( ok )
860
870
bc = QgsSymbolLayerV2Utils::decodeColor ( colorString );
861
871
}
862
872
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_COLOR_BORDER ) )
863
873
{
874
+ context->setOriginalValueVariable ( QgsSymbolLayerV2Utils::encodeColor ( pc ) );
864
875
QString colorString = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_COLOR_BORDER, *context, QVariant (), &ok ).toString ();
865
876
if ( ok )
866
877
pc = QgsSymbolLayerV2Utils::decodeColor ( colorString );
@@ -879,12 +890,14 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
879
890
double angle = mAngle + mLineAngle ;
880
891
if ( context && hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_ANGLE ) )
881
892
{
893
+ context->setOriginalValueVariable ( mAngle );
882
894
angle = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_ANGLE, *context, mAngle ).toDouble () + mLineAngle ;
883
895
}
884
896
885
897
QString name ( mName );
886
898
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_NAME ) )
887
899
{
900
+ context->setOriginalValueVariable ( mName );
888
901
name = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_NAME, *context, QVariant (), &ok ).toString ();
889
902
}
890
903
@@ -1197,6 +1210,7 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re
1197
1210
bool ok = true ;
1198
1211
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_SIZE ) )
1199
1212
{
1213
+ context.setOriginalValueVariable ( mSize );
1200
1214
scaledSize = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_SIZE, context, mSize , &ok ).toDouble ();
1201
1215
}
1202
1216
@@ -1231,6 +1245,7 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re
1231
1245
double angle = mAngle + mLineAngle ;
1232
1246
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_ANGLE ) )
1233
1247
{
1248
+ context.setOriginalValueVariable ( mAngle );
1234
1249
angle = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_ANGLE, context, mAngle ).toDouble () + mLineAngle ;
1235
1250
}
1236
1251
@@ -1265,18 +1280,21 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re
1265
1280
QString path = mPath ;
1266
1281
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_NAME ) )
1267
1282
{
1283
+ context.setOriginalValueVariable ( mPath );
1268
1284
path = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_NAME, context, mPath ).toString ();
1269
1285
}
1270
1286
1271
1287
double outlineWidth = mOutlineWidth ;
1272
1288
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OUTLINE_WIDTH ) )
1273
1289
{
1290
+ context.setOriginalValueVariable ( mOutlineWidth );
1274
1291
outlineWidth = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OUTLINE_WIDTH, context, mOutlineWidth ).toDouble ();
1275
1292
}
1276
1293
1277
1294
QColor fillColor = mFillColor ;
1278
1295
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_FILL ) )
1279
1296
{
1297
+ context.setOriginalValueVariable ( QgsSymbolLayerV2Utils::encodeColor ( mFillColor ) );
1280
1298
QString colorString = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_FILL, context, QVariant (), &ok ).toString ();
1281
1299
if ( ok )
1282
1300
fillColor = QgsSymbolLayerV2Utils::decodeColor ( colorString );
@@ -1285,6 +1303,7 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re
1285
1303
QColor outlineColor = mOutlineColor ;
1286
1304
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OUTLINE ) )
1287
1305
{
1306
+ context.setOriginalValueVariable ( QgsSymbolLayerV2Utils::encodeColor ( mOutlineColor ) );
1288
1307
QString colorString = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OUTLINE, context, QVariant (), &ok ).toString ();
1289
1308
if ( ok )
1290
1309
outlineColor = QgsSymbolLayerV2Utils::decodeColor ( colorString );
@@ -1510,6 +1529,7 @@ bool QgsSvgMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScale
1510
1529
bool ok = true ;
1511
1530
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_SIZE ) )
1512
1531
{
1532
+ context->setOriginalValueVariable ( mSize );
1513
1533
size = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_SIZE, *context, mSize , &ok ).toDouble ();
1514
1534
}
1515
1535
@@ -1537,6 +1557,7 @@ bool QgsSvgMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScale
1537
1557
1538
1558
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OFFSET ) )
1539
1559
{
1560
+ context->setOriginalValueVariable ( QgsSymbolLayerV2Utils::encodePoint ( mOffset ) );
1540
1561
QString offsetString = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OFFSET, *context, QVariant (), &ok ).toString ();
1541
1562
if ( ok )
1542
1563
offset = QgsSymbolLayerV2Utils::decodePoint ( offsetString );
@@ -1554,6 +1575,7 @@ bool QgsSvgMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScale
1554
1575
double angle = mAngle + mLineAngle ;
1555
1576
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_ANGLE ) )
1556
1577
{
1578
+ context->setOriginalValueVariable ( mAngle );
1557
1579
angle = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_ANGLE, *context, mAngle ).toDouble () + mLineAngle ;
1558
1580
}
1559
1581
// angle = -angle; //rotation in Qt is counterclockwise
@@ -1563,18 +1585,21 @@ bool QgsSvgMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScale
1563
1585
QString path = mPath ;
1564
1586
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_NAME ) )
1565
1587
{
1588
+ context->setOriginalValueVariable ( mPath );
1566
1589
path = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_NAME, *context, mPath ).toString ();
1567
1590
}
1568
1591
1569
1592
double outlineWidth = mOutlineWidth ;
1570
1593
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OUTLINE_WIDTH ) )
1571
1594
{
1595
+ context->setOriginalValueVariable ( mOutlineWidth );
1572
1596
outlineWidth = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OUTLINE_WIDTH, *context, mOutlineWidth ).toDouble ();
1573
1597
}
1574
1598
1575
1599
QColor fillColor = mFillColor ;
1576
1600
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_FILL ) )
1577
1601
{
1602
+ context->setOriginalValueVariable ( QgsSymbolLayerV2Utils::encodeColor ( mFillColor ) );
1578
1603
QString colorString = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_FILL, *context, QVariant (), &ok ).toString ();
1579
1604
if ( ok )
1580
1605
fillColor = QgsSymbolLayerV2Utils::decodeColor ( colorString );
@@ -1583,6 +1608,7 @@ bool QgsSvgMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScale
1583
1608
QColor outlineColor = mOutlineColor ;
1584
1609
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OUTLINE ) )
1585
1610
{
1611
+ context->setOriginalValueVariable ( QgsSymbolLayerV2Utils::encodeColor ( mOutlineColor ) );
1586
1612
QString colorString = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_OUTLINE, *context, QVariant (), &ok ).toString ();
1587
1613
if ( ok )
1588
1614
outlineColor = QgsSymbolLayerV2Utils::decodeColor ( colorString );
@@ -1716,6 +1742,7 @@ void QgsFontMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2R
1716
1742
bool ok;
1717
1743
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_COLOR ) )
1718
1744
{
1745
+ context.setOriginalValueVariable ( QgsSymbolLayerV2Utils::encodeColor ( mColor ) );
1719
1746
QString colorString = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_COLOR, context, QVariant (), &ok ).toString ();
1720
1747
if ( ok )
1721
1748
penColor = QgsSymbolLayerV2Utils::decodeColor ( colorString );
@@ -1732,6 +1759,7 @@ void QgsFontMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2R
1732
1759
QString charToRender = mChr ;
1733
1760
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_CHAR ) )
1734
1761
{
1762
+ context.setOriginalValueVariable ( mChr );
1735
1763
charToRender = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_CHAR, context, mChr ).toString ();
1736
1764
if ( charToRender != mChr )
1737
1765
{
@@ -1746,6 +1774,7 @@ void QgsFontMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2R
1746
1774
ok = true ;
1747
1775
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_SIZE ) )
1748
1776
{
1777
+ context.setOriginalValueVariable ( mSize );
1749
1778
scaledSize = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_SIZE, context, mSize , &ok ).toDouble ();
1750
1779
}
1751
1780
@@ -1770,6 +1799,7 @@ void QgsFontMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2R
1770
1799
double angle = mAngle + mLineAngle ;
1771
1800
if ( hasDataDefinedProperty ( QgsSymbolLayerV2::EXPR_ANGLE ) )
1772
1801
{
1802
+ context.setOriginalValueVariable ( mAngle );
1773
1803
angle = evaluateDataDefinedProperty ( QgsSymbolLayerV2::EXPR_ANGLE, context, mAngle ).toDouble () + mLineAngle ;
1774
1804
}
1775
1805
0 commit comments