Skip to content

Commit 4109a10

Browse files
committed
fix some tests and some doxygen warnings
1 parent dd5e1b5 commit 4109a10

File tree

7 files changed

+53
-43
lines changed

7 files changed

+53
-43
lines changed

src/core/raster/qgsrastershader.cpp

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ QgsRasterShader::~QgsRasterShader()
3737
}
3838

3939
/**
40-
Generates and new RGB value based on one input value
40+
Generates and new RGBA value based on one input value
4141
42-
@param theValue The original value to base a new RGB value on
43-
@param theReturnRedValue The red component of the new RGB value
44-
@param theReturnGreenValue The green component of the new RGB value
45-
@param theReturnBlueValue The blue component of the new RGB value
42+
@param theValue The original value to base a new RGBA value on
43+
@param theReturnRedValue The red component of the new RGBA value
44+
@param theReturnGreenValue The green component of the new RGBA value
45+
@param theReturnBlueValue The blue component of the new RGBA value
46+
@param theReturnAlpha The alpha component of the new RGBA value
4647
@return True if the return values are valid otherwise false
4748
*/
4849
bool QgsRasterShader::shade( double theValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue , int *theReturnAlpha )
@@ -55,15 +56,17 @@ bool QgsRasterShader::shade( double theValue, int* theReturnRedValue, int* theRe
5556
return false;
5657
}
5758
/**
58-
Generates and new RGB value based on an original RGB value
59+
Generates and new RGBA value based on an original RGBA value
5960
6061
61-
@param theRedValue The red component of the original value to base a new RGB value on
62-
@param theGreenValue The green component of the original value to base a new RGB value on
63-
@param theBlueValue The blue component of the original value to base a new RGB value on
64-
@param theReturnRedValue The red component of the new RGB value
65-
@param theReturnGreenValue The green component of the new RGB value
66-
@param theReturnBlueValue The blue component of the new RGB value
62+
@param theRedValue The red component of the original value to base a new RGBA value on
63+
@param theGreenValue The green component of the original value to base a new RGBA value on
64+
@param theBlueValue The blue component of the original value to base a new RGBA value on
65+
@param theAlphaValue The alpha component of the original value to base a new RGBA value on
66+
@param theReturnRedValue The red component of the new RGBA value
67+
@param theReturnGreenValue The green component of the new RGBA value
68+
@param theReturnBlueValue The blue component of the new RGBA value
69+
@param theReturnAlphaValue The alpha component of the new RGBA value
6770
@return True if the return values are valid otherwise false
6871
*/
6972
bool QgsRasterShader::shade( double theRedValue, double theGreenValue, double theBlueValue, double theAlphaValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue, int* theReturnAlphaValue )

src/core/raster/qgsrastershaderfunction.cpp

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ void QgsRasterShaderFunction::setMinimumValue( double theValue )
5555
}
5656

5757
/**
58-
Generates and new RGB value based on one input value
58+
Generates and new RGBA value based on one input value
5959
60-
@param theValue The original value to base a new RGB value on
61-
@param theReturnRedValue The red component of the new RGB value
62-
@param theReturnGreenValue The green component of the new RGB value
63-
@param theReturnBlueValue The blue component of the new RGB value
60+
@param theValue The original value to base a new RGBA value on
61+
@param theReturnRedValue The red component of the new RGBA value
62+
@param theReturnGreenValue The green component of the new RGBA value
63+
@param theReturnBlueValue The blue component of the new RGBA value
64+
@param theReturnAlphaValue The blue component of the new RGBA value
6465
@return True if the return values are valid otherwise false
6566
*/
6667
bool QgsRasterShaderFunction::shade( double theValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue, int* theReturnAlphaValue )
@@ -76,15 +77,17 @@ bool QgsRasterShaderFunction::shade( double theValue, int* theReturnRedValue, in
7677
}
7778

7879
/**
79-
Generates and new RGB value based on an original RGB value
80+
Generates and new RGBA value based on an original RGBA value
8081
8182
82-
@param theRedValue The red component of the original value to base a new RGB value on
83-
@param theGreenValue The green component of the original value to base a new RGB value on
84-
@param theBlueValue The blue component of the original value to base a new RGB value on
85-
@param theReturnRedValue The red component of the new RGB value
86-
@param theReturnGreenValue The green component of the new RGB value
87-
@param theReturnBlueValue The blue component of the new RGB value
83+
@param theRedValue The red component of the original value to base a new RGBA value on
84+
@param theGreenValue The green component of the original value to base a new RGBA value on
85+
@param theBlueValue The blue component of the original value to base a new RGBA value on
86+
@param theAlphaValue The alpha component of the original value to base a new RGBA value on
87+
@param theReturnRedValue The red component of the new RGBA value
88+
@param theReturnGreenValue The green component of the new RGBA value
89+
@param theReturnBlueValue The blue component of the new RGBA value
90+
@param theReturnAlphaValue The alpha component of the new RGBA value
8891
@return True if the return values are valid otherwise false
8992
*/
9093
bool QgsRasterShaderFunction::shade( double theRedValue, double theGreenValue, double theBlueValue, double theAlphaValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue , int *theReturnAlphaValue )

src/core/symbology-ng/qgsmarkersymbollayerv2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class CORE_EXPORT QgsSimpleMarkerSymbolLayerV2 : public QgsMarkerSymbolLayerV2
103103

104104
//////////
105105

106-
#define DEFAULT_SVGMARKER_NAME "/symbol/Star1.svg"
106+
#define DEFAULT_SVGMARKER_NAME "/crosses/Star1.svg"
107107
#define DEFAULT_SVGMARKER_SIZE 2*DEFAULT_POINT_SIZE
108108
#define DEFAULT_SVGMARKER_ANGLE 0
109109

src/core/symbology-ng/qgssymbollayerv2utils.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,14 +1179,14 @@ bool QgsSymbolLayerV2Utils::needLinePatternFill( QDomElement &element )
11791179
QString name;
11801180
QColor fillColor, borderColor;
11811181
double size, borderWidth;
1182-
if ( !QgsSymbolLayerV2Utils::wellKnownMarkerFromSld( graphicElem, name, fillColor, borderColor, borderWidth, size ) )
1182+
if ( !wellKnownMarkerFromSld( graphicElem, name, fillColor, borderColor, borderWidth, size ) )
11831183
return false;
11841184

11851185
if ( name != "horline" )
11861186
return false;
11871187

11881188
QString angleFunc;
1189-
if ( !QgsSymbolLayerV2Utils::rotationFromSldElement( graphicElem, angleFunc ) )
1189+
if ( !rotationFromSldElement( graphicElem, angleFunc ) )
11901190
return false;
11911191

11921192
bool ok;
@@ -1197,7 +1197,11 @@ bool QgsSymbolLayerV2Utils::needLinePatternFill( QDomElement &element )
11971197
return true;
11981198
}
11991199

1200-
bool QgsSymbolLayerV2Utils::needPointPatternFill( QDomElement &element ) { Q_UNUSED( element ); return false; }
1200+
bool QgsSymbolLayerV2Utils::needPointPatternFill( QDomElement &element )
1201+
{
1202+
Q_UNUSED( element );
1203+
return false;
1204+
}
12011205

12021206
bool QgsSymbolLayerV2Utils::needSvgFill( QDomElement &element )
12031207
{
@@ -1256,11 +1260,11 @@ bool QgsSymbolLayerV2Utils::convertPolygonSymbolizerToPointMarker( QDomElement &
12561260
{
12571261
QgsStringMap map;
12581262
map["name"] = "square";
1259-
map["color"] = QgsSymbolLayerV2Utils::encodeColor( validFill ? fillColor : Qt::transparent );
1260-
map["color_border"] = QgsSymbolLayerV2Utils::encodeColor( validBorder ? borderColor : Qt::transparent );
1263+
map["color"] = encodeColor( validFill ? fillColor : Qt::transparent );
1264+
map["color_border"] = encodeColor( validBorder ? borderColor : Qt::transparent );
12611265
map["size"] = QString::number( 6 );
12621266
map["angle"] = QString::number( 0 );
1263-
map["offset"] = QgsSymbolLayerV2Utils::encodePoint( QPointF( 0, 0 ) );
1267+
map["offset"] = encodePoint( QPointF( 0, 0 ) );
12641268
layers.append( QgsSymbolLayerV2Registry::instance()->createSymbolLayer( "SimpleMarker", map ) );
12651269
}
12661270
}
@@ -1439,21 +1443,21 @@ bool QgsSymbolLayerV2Utils::convertPolygonSymbolizerToPointMarker( QDomElement &
14391443
if ( !qgsDoubleNear( angle, 0.0 ) )
14401444
map["angle"] = QString::number( angle );
14411445
if ( !offset.isNull() )
1442-
map["offset"] = QgsSymbolLayerV2Utils::encodePoint( offset );
1446+
map["offset"] = encodePoint( offset );
14431447
layers.append( QgsSymbolLayerV2Registry::instance()->createSymbolLayer( "SvgMarker", map ) );
14441448
}
14451449
else if ( format == "ttf" )
14461450
{
14471451
QgsStringMap map;
14481452
map["font"] = name;
14491453
map["chr"] = markIndex;
1450-
map["color"] = QgsSymbolLayerV2Utils::encodeColor( validFill ? fillColor : Qt::transparent );
1454+
map["color"] = encodeColor( validFill ? fillColor : Qt::transparent );
14511455
if ( size > 0 )
14521456
map["size"] = QString::number( size );
14531457
if ( !qgsDoubleNear( angle, 0.0 ) )
14541458
map["angle"] = QString::number( angle );
14551459
if ( !offset.isNull() )
1456-
map["offset"] = QgsSymbolLayerV2Utils::encodePoint( offset );
1460+
map["offset"] = encodePoint( offset );
14571461
layers.append( QgsSymbolLayerV2Registry::instance()->createSymbolLayer( "FontMarker", map ) );
14581462
}
14591463
}
@@ -2254,7 +2258,7 @@ bool QgsSymbolLayerV2Utils::functionFromSldElement( QDomElement &element, QStrin
22542258
}
22552259
else
22562260
{
2257-
function = expr->expression();
2261+
function = expr->dump();
22582262
}
22592263

22602264
delete expr;

tests/src/core/testqgsexpression.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,14 @@ class TestQgsExpression: public QObject
351351
QTest::newRow( "negative age" ) << "age('2012-06-28','2012-06-30')" << false << QVariant::fromValue( QgsExpression::Interval( -172800 ) );
352352

353353
// Color functions
354-
QTest::newRow( "ramp color" ) << "ramp_color('Spectral',0.3)" << false << QVariant( "#fdbe73" );
355-
QTest::newRow( "color rgb" ) << "color_rgb(255,127,0)" << false << QVariant( "#ff7f00" );
354+
QTest::newRow( "ramp color" ) << "ramp_color('Spectral',0.3)" << false << QVariant( "253,190,115,255" );
355+
QTest::newRow( "color rgb" ) << "color_rgb(255,127,0)" << false << QVariant( "255,127,0" );
356356
QTest::newRow( "color rgba" ) << "color_rgba(255,127,0,200)" << false << QVariant( "255,127,0,200" );
357-
QTest::newRow( "color hsl" ) << "color_hsl(100,50,70)" << false << QVariant( "#a6d98c" );
357+
QTest::newRow( "color hsl" ) << "color_hsl(100,50,70)" << false << QVariant( "166,217,140" );
358358
QTest::newRow( "color hsla" ) << "color_hsla(100,50,70,200)" << false << QVariant( "166,217,140,200" );
359-
QTest::newRow( "color hsv" ) << "color_hsv(40,100,100)" << false << QVariant( "#ffaa00" );
359+
QTest::newRow( "color hsv" ) << "color_hsv(40,100,100)" << false << QVariant( "255,170,0" );
360360
QTest::newRow( "color hsva" ) << "color_hsva(40,100,100,200)" << false << QVariant( "255,170,0,200" );
361-
QTest::newRow( "color cmyk" ) << "color_cmyk(100,50,33,10)" << false << QVariant( "#00739a" );
361+
QTest::newRow( "color cmyk" ) << "color_cmyk(100,50,33,10)" << false << QVariant( "0,115,154" );
362362
QTest::newRow( "color cmyka" ) << "color_cmyka(50,25,90,60,200)" << false << QVariant( "51,76,10,200" );
363363
}
364364

tests/testdata/symbol_layer/QgsSVGFillSymbolLayer.sld

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
<se:GraphicFill>
1313
<se:Graphic>
1414
<se:ExternalGraphic>
15-
<OnlineResource xlink:type="simple" xlink:href="C:/Program Files/qgis1.8.0/./svg/accommodation/accommodation_camping.svg"/>
15+
<OnlineResource xlink:type="simple" xlink:href="file:accommodation/accommodation_camping.svg"/>
1616
<Format>image/svg+xml</Format>
1717
</se:ExternalGraphic>
1818
<se:Size>6</se:Size>
1919
<se:SvgParameter name="stroke">#000000</se:SvgParameter>
2020
<se:SvgParameter name="stroke-width">3</se:SvgParameter>
2121
<se:Rotation>
22-
<ogc:Literal>4</ogc:Literal>
22+
<ogc:Literal>3</ogc:Literal>
2323
</se:Rotation>
2424
</se:Graphic>
2525
</se:GraphicFill>

tests/testdata/symbol_layer/QgsSvgMarkerSymbolLayerV2.sld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<se:PointSymbolizer>
1111
<se:Graphic>
1212
<se:ExternalGraphic>
13-
<OnlineResource xlink:type="simple" xlink:href="C:/Program Files/qgis1.8.0/svg/gpsicons/skull.svg"/>
13+
<OnlineResource xlink:type="simple" xlink:href="file:gpsicons/skull.svg"/>
1414
<Format>image/svg+xml</Format>
1515
</se:ExternalGraphic>
1616
<se:Size>12</se:Size>

0 commit comments

Comments
 (0)