@@ -113,11 +113,45 @@ QgsSymbolLayerV2* QgsSimpleFillSymbolLayerV2::create( const QgsStringMap& props
113
113
if ( props.contains ( " style" ) )
114
114
style = QgsSymbolLayerV2Utils::decodeBrushStyle ( props[" style" ] );
115
115
if ( props.contains ( " color_border" ) )
116
+ {
117
+ // pre 2.5 projects used "color_border"
116
118
borderColor = QgsSymbolLayerV2Utils::decodeColor ( props[" color_border" ] );
119
+ }
120
+ else if ( props.contains ( " outline_color" ) )
121
+ {
122
+ borderColor = QgsSymbolLayerV2Utils::decodeColor ( props[" outline_color" ] );
123
+ }
124
+ else if ( props.contains ( " line_color" ) )
125
+ {
126
+ borderColor = QgsSymbolLayerV2Utils::decodeColor ( props[" line_color" ] );
127
+ }
128
+
117
129
if ( props.contains ( " style_border" ) )
130
+ {
131
+ // pre 2.5 projects used "style_border"
118
132
borderStyle = QgsSymbolLayerV2Utils::decodePenStyle ( props[" style_border" ] );
133
+ }
134
+ else if ( props.contains ( " outline_style" ) )
135
+ {
136
+ borderStyle = QgsSymbolLayerV2Utils::decodePenStyle ( props[" outline_style" ] );
137
+ }
138
+ else if ( props.contains ( " line_style" ) )
139
+ {
140
+ borderStyle = QgsSymbolLayerV2Utils::decodePenStyle ( props[" line_style" ] );
141
+ }
119
142
if ( props.contains ( " width_border" ) )
143
+ {
144
+ // pre 2.5 projects used "width_border"
120
145
borderWidth = props[" width_border" ].toDouble ();
146
+ }
147
+ else if ( props.contains ( " outline_width" ) )
148
+ {
149
+ borderWidth = props[" outline_width" ].toDouble ();
150
+ }
151
+ else if ( props.contains ( " line_width" ) )
152
+ {
153
+ borderWidth = props[" line_width" ].toDouble ();
154
+ }
121
155
if ( props.contains ( " offset" ) )
122
156
offset = QgsSymbolLayerV2Utils::decodePoint ( props[" offset" ] );
123
157
if ( props.contains ( " joinstyle" ) )
@@ -126,7 +160,17 @@ QgsSymbolLayerV2* QgsSimpleFillSymbolLayerV2::create( const QgsStringMap& props
126
160
QgsSimpleFillSymbolLayerV2* sl = new QgsSimpleFillSymbolLayerV2 ( color, style, borderColor, borderStyle, borderWidth, penJoinStyle );
127
161
sl->setOffset ( offset );
128
162
if ( props.contains ( " border_width_unit" ) )
163
+ {
129
164
sl->setBorderWidthUnit ( QgsSymbolLayerV2Utils::decodeOutputUnit ( props[" border_width_unit" ] ) );
165
+ }
166
+ else if ( props.contains ( " outline_width_unit" ) )
167
+ {
168
+ sl->setBorderWidthUnit ( QgsSymbolLayerV2Utils::decodeOutputUnit ( props[" outline_width_unit" ] ) );
169
+ }
170
+ else if ( props.contains ( " line_width_unit" ) )
171
+ {
172
+ sl->setBorderWidthUnit ( QgsSymbolLayerV2Utils::decodeOutputUnit ( props[" line_width_unit" ] ) );
173
+ }
130
174
if ( props.contains ( " offset_unit" ) )
131
175
sl->setOffsetUnit ( QgsSymbolLayerV2Utils::decodeOutputUnit ( props[" offset_unit" ] ) );
132
176
@@ -227,10 +271,10 @@ QgsStringMap QgsSimpleFillSymbolLayerV2::properties() const
227
271
QgsStringMap map;
228
272
map[" color" ] = QgsSymbolLayerV2Utils::encodeColor ( mColor );
229
273
map[" style" ] = QgsSymbolLayerV2Utils::encodeBrushStyle ( mBrushStyle );
230
- map[" color_border " ] = QgsSymbolLayerV2Utils::encodeColor ( mBorderColor );
231
- map[" style_border " ] = QgsSymbolLayerV2Utils::encodePenStyle ( mBorderStyle );
232
- map[" width_border " ] = QString::number ( mBorderWidth );
233
- map[" border_width_unit " ] = QgsSymbolLayerV2Utils::encodeOutputUnit ( mBorderWidthUnit );
274
+ map[" outline_color " ] = QgsSymbolLayerV2Utils::encodeColor ( mBorderColor );
275
+ map[" outline_style " ] = QgsSymbolLayerV2Utils::encodePenStyle ( mBorderStyle );
276
+ map[" outline_width " ] = QString::number ( mBorderWidth );
277
+ map[" outline_width_unit " ] = QgsSymbolLayerV2Utils::encodeOutputUnit ( mBorderWidthUnit );
234
278
map[" border_width_map_unit_scale" ] = QgsSymbolLayerV2Utils::encodeMapUnitScale ( mBorderWidthMapUnitScale );
235
279
map[" joinstyle" ] = QgsSymbolLayerV2Utils::encodePenJoinStyle ( mPenJoinStyle );
236
280
map[" offset" ] = QgsSymbolLayerV2Utils::encodePoint ( mOffset );
@@ -404,9 +448,19 @@ QgsSymbolLayerV2* QgsGradientFillSymbolLayerV2::create( const QgsStringMap& prop
404
448
if ( props.contains ( " color_type" ) )
405
449
colorType = ( GradientColorType )props[" color_type" ].toInt ();
406
450
if ( props.contains ( " gradient_color" ) )
451
+ {
452
+ // pre 2.5 projects used "gradient_color"
407
453
color = QgsSymbolLayerV2Utils::decodeColor ( props[" gradient_color" ] );
454
+ }
455
+ else if ( props.contains ( " color" ) )
456
+ {
457
+ color = QgsSymbolLayerV2Utils::decodeColor ( props[" color" ] );
458
+ }
408
459
if ( props.contains ( " gradient_color2" ) )
460
+ {
409
461
color2 = QgsSymbolLayerV2Utils::decodeColor ( props[" gradient_color2" ] );
462
+ }
463
+
410
464
if ( props.contains ( " reference_point1" ) )
411
465
referencePoint1 = QgsSymbolLayerV2Utils::decodePoint ( props[" reference_point1" ] );
412
466
if ( props.contains ( " reference_point1_iscentroid" ) )
@@ -417,6 +471,7 @@ QgsSymbolLayerV2* QgsGradientFillSymbolLayerV2::create( const QgsStringMap& prop
417
471
refPoint2IsCentroid = props[" reference_point2_iscentroid" ].toInt ();
418
472
if ( props.contains ( " angle" ) )
419
473
angle = props[" angle" ].toDouble ();
474
+
420
475
if ( props.contains ( " offset" ) )
421
476
offset = QgsSymbolLayerV2Utils::decodePoint ( props[" offset" ] );
422
477
@@ -764,7 +819,7 @@ void QgsGradientFillSymbolLayerV2::renderPolygon( const QPolygonF& points, QList
764
819
QgsStringMap QgsGradientFillSymbolLayerV2::properties () const
765
820
{
766
821
QgsStringMap map;
767
- map[" gradient_color " ] = QgsSymbolLayerV2Utils::encodeColor ( mColor );
822
+ map[" color " ] = QgsSymbolLayerV2Utils::encodeColor ( mColor );
768
823
map[" gradient_color2" ] = QgsSymbolLayerV2Utils::encodeColor ( mColor2 );
769
824
map[" color_type" ] = QString::number ( mGradientColorType );
770
825
map[" type" ] = QString::number ( mGradientType );
@@ -870,12 +925,23 @@ QgsSymbolLayerV2* QgsShapeburstFillSymbolLayerV2::create( const QgsStringMap& pr
870
925
}
871
926
if ( props.contains ( " shapeburst_color" ) )
872
927
{
928
+ // pre 2.5 projects used "shapeburst_color"
873
929
color = QgsSymbolLayerV2Utils::decodeColor ( props[" shapeburst_color" ] );
874
930
}
931
+ else if ( props.contains ( " color" ) )
932
+ {
933
+ color = QgsSymbolLayerV2Utils::decodeColor ( props[" color" ] );
934
+ }
935
+
875
936
if ( props.contains ( " shapeburst_color2" ) )
876
937
{
938
+ // pre 2.5 projects used "shapeburst_color2"
877
939
color2 = QgsSymbolLayerV2Utils::decodeColor ( props[" shapeburst_color2" ] );
878
940
}
941
+ else if ( props.contains ( " gradient_color2" ) )
942
+ {
943
+ color2 = QgsSymbolLayerV2Utils::decodeColor ( props[" gradient_color2" ] );
944
+ }
879
945
if ( props.contains ( " blur_radius" ) )
880
946
{
881
947
blurRadius = props[" blur_radius" ].toInt ();
@@ -1328,8 +1394,8 @@ void QgsShapeburstFillSymbolLayerV2::dtArrayToQImage( double * array, QImage *im
1328
1394
QgsStringMap QgsShapeburstFillSymbolLayerV2::properties () const
1329
1395
{
1330
1396
QgsStringMap map;
1331
- map[" shapeburst_color " ] = QgsSymbolLayerV2Utils::encodeColor ( mColor );
1332
- map[" shapeburst_color2 " ] = QgsSymbolLayerV2Utils::encodeColor ( mColor2 );
1397
+ map[" color " ] = QgsSymbolLayerV2Utils::encodeColor ( mColor );
1398
+ map[" gradient_color2 " ] = QgsSymbolLayerV2Utils::encodeColor ( mColor2 );
1333
1399
map[" color_type" ] = QString::number ( mColorType );
1334
1400
map[" blur_radius" ] = QString::number ( mBlurRadius );
1335
1401
map[" use_whole_shape" ] = QString::number ( mUseWholeShape );
@@ -1677,16 +1743,39 @@ QgsSymbolLayerV2* QgsSVGFillSymbolLayer::create( const QgsStringMap& properties
1677
1743
// svg parameters
1678
1744
if ( properties.contains ( " svgFillColor" ) )
1679
1745
{
1746
+ // pre 2.5 projects used "svgFillColor"
1680
1747
symbolLayer->setSvgFillColor ( QgsSymbolLayerV2Utils::decodeColor ( properties[" svgFillColor" ] ) );
1681
1748
}
1749
+ else if ( properties.contains ( " color" ) )
1750
+ {
1751
+ symbolLayer->setSvgFillColor ( QgsSymbolLayerV2Utils::decodeColor ( properties[" color" ] ) );
1752
+ }
1682
1753
if ( properties.contains ( " svgOutlineColor" ) )
1683
1754
{
1755
+ // pre 2.5 projects used "svgOutlineColor"
1684
1756
symbolLayer->setSvgOutlineColor ( QgsSymbolLayerV2Utils::decodeColor ( properties[" svgOutlineColor" ] ) );
1685
1757
}
1758
+ else if ( properties.contains ( " outline_color" ) )
1759
+ {
1760
+ symbolLayer->setSvgOutlineColor ( QgsSymbolLayerV2Utils::decodeColor ( properties[" outline_color" ] ) );
1761
+ }
1762
+ else if ( properties.contains ( " line_color" ) )
1763
+ {
1764
+ symbolLayer->setSvgOutlineColor ( QgsSymbolLayerV2Utils::decodeColor ( properties[" line_color" ] ) );
1765
+ }
1686
1766
if ( properties.contains ( " svgOutlineWidth" ) )
1687
1767
{
1768
+ // pre 2.5 projects used "svgOutlineWidth"
1688
1769
symbolLayer->setSvgOutlineWidth ( properties[" svgOutlineWidth" ].toDouble () );
1689
1770
}
1771
+ else if ( properties.contains ( " outline_width" ) )
1772
+ {
1773
+ symbolLayer->setSvgOutlineWidth ( properties[" outline_width" ].toDouble () );
1774
+ }
1775
+ else if ( properties.contains ( " line_width" ) )
1776
+ {
1777
+ symbolLayer->setSvgOutlineWidth ( properties[" line_width" ].toDouble () );
1778
+ }
1690
1779
1691
1780
// units
1692
1781
if ( properties.contains ( " pattern_width_unit" ) )
@@ -1829,9 +1918,9 @@ QgsStringMap QgsSVGFillSymbolLayer::properties() const
1829
1918
map.insert ( " angle" , QString::number ( mAngle ) );
1830
1919
1831
1920
// svg parameters
1832
- map.insert ( " svgFillColor " , QgsSymbolLayerV2Utils::encodeColor ( mSvgFillColor ) );
1833
- map.insert ( " svgOutlineColor " , QgsSymbolLayerV2Utils::encodeColor ( mSvgOutlineColor ) );
1834
- map.insert ( " svgOutlineWidth " , QString::number ( mSvgOutlineWidth ) );
1921
+ map.insert ( " color " , QgsSymbolLayerV2Utils::encodeColor ( mSvgFillColor ) );
1922
+ map.insert ( " outline_color " , QgsSymbolLayerV2Utils::encodeColor ( mSvgOutlineColor ) );
1923
+ map.insert ( " outline_width " , QString::number ( mSvgOutlineWidth ) );
1835
1924
1836
1925
// units
1837
1926
map.insert ( " pattern_width_unit" , QgsSymbolLayerV2Utils::encodeOutputUnit ( mPatternWidthUnit ) );
@@ -2195,8 +2284,13 @@ QgsSymbolLayerV2* QgsLinePatternFillSymbolLayer::create( const QgsStringMap& pro
2195
2284
2196
2285
if ( properties.contains ( " lineangle" ) )
2197
2286
{
2287
+ // pre 2.5 projects used "lineangle"
2198
2288
lineAngle = properties[" lineangle" ].toDouble ();
2199
2289
}
2290
+ else if ( properties.contains ( " angle" ) )
2291
+ {
2292
+ lineAngle = properties[" angle" ].toDouble ();
2293
+ }
2200
2294
patternLayer->setLineAngle ( lineAngle );
2201
2295
2202
2296
if ( properties.contains ( " distance" ) )
@@ -2207,14 +2301,31 @@ QgsSymbolLayerV2* QgsLinePatternFillSymbolLayer::create( const QgsStringMap& pro
2207
2301
2208
2302
if ( properties.contains ( " linewidth" ) )
2209
2303
{
2304
+ // pre 2.5 projects used "linewidth"
2210
2305
lineWidth = properties[" linewidth" ].toDouble ();
2211
2306
}
2307
+ else if ( properties.contains ( " outline_width" ) )
2308
+ {
2309
+ lineWidth = properties[" outline_width" ].toDouble ();
2310
+ }
2311
+ else if ( properties.contains ( " line_width" ) )
2312
+ {
2313
+ lineWidth = properties[" line_width" ].toDouble ();
2314
+ }
2212
2315
patternLayer->setLineWidth ( lineWidth );
2213
2316
2214
2317
if ( properties.contains ( " color" ) )
2215
2318
{
2216
2319
color = QgsSymbolLayerV2Utils::decodeColor ( properties[" color" ] );
2217
2320
}
2321
+ else if ( properties.contains ( " outline_color" ) )
2322
+ {
2323
+ color = QgsSymbolLayerV2Utils::decodeColor ( properties[" outline_color" ] );
2324
+ }
2325
+ else if ( properties.contains ( " line_color" ) )
2326
+ {
2327
+ color = QgsSymbolLayerV2Utils::decodeColor ( properties[" line_color" ] );
2328
+ }
2218
2329
patternLayer->setColor ( color );
2219
2330
2220
2331
if ( properties.contains ( " offset" ) )
@@ -2236,6 +2347,10 @@ QgsSymbolLayerV2* QgsLinePatternFillSymbolLayer::create( const QgsStringMap& pro
2236
2347
{
2237
2348
patternLayer->setLineWidthUnit ( QgsSymbolLayerV2Utils::decodeOutputUnit ( properties[" line_width_unit" ] ) );
2238
2349
}
2350
+ else if ( properties.contains ( " outline_width_unit" ) )
2351
+ {
2352
+ patternLayer->setLineWidthUnit ( QgsSymbolLayerV2Utils::decodeOutputUnit ( properties[" outline_width_unit" ] ) );
2353
+ }
2239
2354
if ( properties.contains ( " line_width_map_unit_scale" ) )
2240
2355
{
2241
2356
patternLayer->setLineWidthMapUnitScale ( QgsSymbolLayerV2Utils::decodeMapUnitScale ( properties[" line_width_map_unit_scale" ] ) );
@@ -2590,9 +2705,9 @@ void QgsLinePatternFillSymbolLayer::stopRender( QgsSymbolV2RenderContext & )
2590
2705
QgsStringMap QgsLinePatternFillSymbolLayer::properties () const
2591
2706
{
2592
2707
QgsStringMap map;
2593
- map.insert ( " lineangle " , QString::number ( mLineAngle ) );
2708
+ map.insert ( " angle " , QString::number ( mLineAngle ) );
2594
2709
map.insert ( " distance" , QString::number ( mDistance ) );
2595
- map.insert ( " linewidth " , QString::number ( mLineWidth ) );
2710
+ map.insert ( " line_width " , QString::number ( mLineWidth ) );
2596
2711
map.insert ( " color" , QgsSymbolLayerV2Utils::encodeColor ( mColor ) );
2597
2712
map.insert ( " offset" , QString::number ( mOffset ) );
2598
2713
map.insert ( " distance_unit" , QgsSymbolLayerV2Utils::encodeOutputUnit ( mDistanceUnit ) );
0 commit comments