Skip to content

Commit 8389918

Browse files
committedMay 25, 2015
fix some warnings
1 parent b7a4e98 commit 8389918

File tree

5 files changed

+64
-43
lines changed

5 files changed

+64
-43
lines changed
 

‎src/browser/browser.ico

21.9 KB
Binary file not shown.

‎src/core/geometry/qgsgeometry.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ int QgsGeometry::addRing( QgsCurveV2* ring )
522522

523523
int QgsGeometry::addPart( const QList<QgsPoint> &points, QGis::GeometryType geomType )
524524
{
525+
Q_UNUSED( geomType );
525526
if ( !d || !d->geometry )
526527
{
527528
return 2;
@@ -1084,6 +1085,7 @@ double QgsGeometry::area() const
10841085
}
10851086
QgsGeos g( d->geometry );
10861087

1088+
#if 0
10871089
//debug: compare geos area with calculation in QGIS
10881090
double geosArea = g.area();
10891091
double qgisArea = 0;
@@ -1092,6 +1094,7 @@ double QgsGeometry::area() const
10921094
{
10931095
qgisArea = surface->area();
10941096
}
1097+
#endif
10951098

10961099
return g.area();
10971100
}

‎src/core/geometry/qgsgeometryengine.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@ class CORE_EXPORT QgsGeometryEngine
5959
virtual int splitGeometry( const QgsLineStringV2& splitLine,
6060
QList<QgsAbstractGeometryV2*>& newGeometries,
6161
bool topological,
62-
QList<QgsPointV2> &topologyTestPoints ) const { return 2; } //= 0;
62+
QList<QgsPointV2> &topologyTestPoints ) const
63+
{
64+
Q_UNUSED( splitLine );
65+
Q_UNUSED( newGeometries );
66+
Q_UNUSED( topological );
67+
Q_UNUSED( topologyTestPoints );
68+
return 2;
69+
} //= 0;
6370

6471
virtual QgsAbstractGeometryV2* offsetCurve( double distance, int segments, int joinStyle, double mitreLimit ) const = 0;
6572

‎src/core/geometry/qgsgeos.cpp

+45-42
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ QgsAbstractGeometryV2* QgsGeos::symDifference( const QgsAbstractGeometryV2& geom
204204

205205
double QgsGeos::distance( const QgsAbstractGeometryV2& geom ) const
206206
{
207+
Q_UNUSED( geom );
207208
return 0.0;
208209
}
209210

@@ -1230,6 +1231,10 @@ bool QgsGeos::pointOnSurface( QgsPointV2& pt ) const
12301231
double x, y;
12311232
GEOSGeomGetX_r( geosinit.ctxt, geos, &x );
12321233
GEOSGeomGetY_r( geosinit.ctxt, geos, &y );
1234+
1235+
pt.setX( x );
1236+
pt.setY( y );
1237+
12331238
return true;
12341239
}
12351240

@@ -1354,69 +1359,67 @@ GEOSCoordSequence* QgsGeos::createCoordinateSequence( const QgsCurveV2* curve )
13541359
GEOSGeometry* QgsGeos::createGeosPoint( const QgsAbstractGeometryV2* point, int coordDims )
13551360
{
13561361
const QgsPointV2* pt = dynamic_cast<const QgsPointV2*>( point );
1357-
if ( pt )
1362+
if ( !pt )
1363+
return 0;
1364+
1365+
GEOSCoordSequence* coordSeq = GEOSCoordSeq_create_r( geosinit.ctxt, 1, coordDims );
1366+
GEOSCoordSeq_setX_r( geosinit.ctxt, coordSeq, 0, pt->x() );
1367+
GEOSCoordSeq_setY_r( geosinit.ctxt, coordSeq, 0, pt->y() );
1368+
if ( pt->is3D() )
13581369
{
1359-
GEOSCoordSequence* coordSeq = GEOSCoordSeq_create_r( geosinit.ctxt, 1, coordDims );
1360-
GEOSCoordSeq_setX_r( geosinit.ctxt, coordSeq, 0, pt->x() );
1361-
GEOSCoordSeq_setY_r( geosinit.ctxt, coordSeq, 0, pt->y() );
1362-
if ( pt->is3D() )
1363-
{
1364-
GEOSCoordSeq_setOrdinate_r( geosinit.ctxt, coordSeq, 0, 2, pt->z() );
1365-
}
1366-
if ( pt->isMeasure() )
1367-
{
1368-
GEOSCoordSeq_setOrdinate_r( geosinit.ctxt, coordSeq, 0, 3, pt->m() );
1369-
}
1370-
return GEOSGeom_createPoint_r( geosinit.ctxt, coordSeq );
1370+
GEOSCoordSeq_setOrdinate_r( geosinit.ctxt, coordSeq, 0, 2, pt->z() );
13711371
}
1372+
if ( pt->isMeasure() )
1373+
{
1374+
GEOSCoordSeq_setOrdinate_r( geosinit.ctxt, coordSeq, 0, 3, pt->m() );
1375+
}
1376+
return GEOSGeom_createPoint_r( geosinit.ctxt, coordSeq );
13721377
}
13731378

13741379
GEOSGeometry* QgsGeos::createGeosLinestring( const QgsAbstractGeometryV2* curve )
13751380
{
13761381
const QgsCurveV2* c = dynamic_cast<const QgsCurveV2*>( curve );
1377-
if ( c )
1378-
{
1379-
GEOSCoordSequence* coordSeq = createCoordinateSequence( c );
1380-
if ( !coordSeq )
1381-
{
1382-
return 0;
1383-
}
1384-
return GEOSGeom_createLineString_r( geosinit.ctxt, coordSeq );
1385-
}
1382+
if ( !c )
1383+
return 0;
1384+
1385+
GEOSCoordSequence* coordSeq = createCoordinateSequence( c );
1386+
if ( !coordSeq )
1387+
return 0;
1388+
1389+
return GEOSGeom_createLineString_r( geosinit.ctxt, coordSeq );
13861390
}
13871391

13881392
GEOSGeometry* QgsGeos::createGeosPolygon( const QgsAbstractGeometryV2* poly )
13891393
{
13901394
const QgsCurvePolygonV2* polygon = dynamic_cast<const QgsCurvePolygonV2*>( poly );
1391-
if ( polygon )
1392-
{
1393-
const QgsCurveV2* exteriorRing = polygon->exteriorRing();
1394-
GEOSGeometry* exteriorRingGeos = GEOSGeom_createLinearRing_r( geosinit.ctxt, createCoordinateSequence( exteriorRing ) );
1395+
if ( !polygon )
1396+
return 0;
13951397

1396-
int nHoles = polygon->numInteriorRings();
1397-
GEOSGeometry** holes = 0;
1398-
if ( nHoles > 0 )
1399-
{
1400-
holes = new GEOSGeometry*[ nHoles ];
1401-
}
1398+
const QgsCurveV2* exteriorRing = polygon->exteriorRing();
1399+
GEOSGeometry* exteriorRingGeos = GEOSGeom_createLinearRing_r( geosinit.ctxt, createCoordinateSequence( exteriorRing ) );
14021400

1403-
for ( int i = 0; i < nHoles; ++i )
1404-
{
1405-
const QgsCurveV2* interiorRing = polygon->interiorRing( i );
1406-
holes[i] = GEOSGeom_createLinearRing_r( geosinit.ctxt, createCoordinateSequence( interiorRing ) );
1407-
}
1408-
GEOSGeometry* geosPolygon = GEOSGeom_createPolygon_r( geosinit.ctxt, exteriorRingGeos, holes, nHoles );
1409-
delete[] holes;
1410-
return geosPolygon;
1401+
int nHoles = polygon->numInteriorRings();
1402+
GEOSGeometry** holes = 0;
1403+
if ( nHoles > 0 )
1404+
{
1405+
holes = new GEOSGeometry*[ nHoles ];
1406+
}
1407+
1408+
for ( int i = 0; i < nHoles; ++i )
1409+
{
1410+
const QgsCurveV2* interiorRing = polygon->interiorRing( i );
1411+
holes[i] = GEOSGeom_createLinearRing_r( geosinit.ctxt, createCoordinateSequence( interiorRing ) );
14111412
}
1413+
GEOSGeometry* geosPolygon = GEOSGeom_createPolygon_r( geosinit.ctxt, exteriorRingGeos, holes, nHoles );
1414+
delete[] holes;
1415+
1416+
return geosPolygon;
14121417
}
14131418

14141419
QgsAbstractGeometryV2* QgsGeos::offsetCurve( double distance, int segments, int joinStyle, double mitreLimit ) const
14151420
{
14161421
if ( !mGeos )
1417-
{
14181422
return 0;
1419-
}
14201423

14211424
GEOSGeometry* offset = 0;
14221425
try

‎src/server/qgssldconfigparser.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,10 @@ bool QgsSLDConfigParser::labelSettingsFromUserStyle( const QDomElement& userStyl
958958
if ( userStyleElement.isNull() || !vec )
959959
return false;
960960

961+
Q_NOWARN_DEPRECATED_PUSH
961962
vec->enableLabels( false );
963+
Q_NOWARN_DEPRECATED_POP
964+
962965
QDomNodeList featureTypeList = userStyleElement.elementsByTagName( "FeatureTypeStyle" );
963966
if ( featureTypeList.size() <= 0 )
964967
return false;
@@ -1010,7 +1013,10 @@ bool QgsSLDConfigParser::labelSettingsFromUserStyle( const QDomElement& userStyl
10101013
if ( propertyNameList.size() <= 0 )
10111014
return false;
10121015

1016+
Q_NOWARN_DEPRECATED_PUSH
10131017
vec->enableLabels( true );
1018+
Q_NOWARN_DEPRECATED_POP
1019+
10141020
QDomElement propertyNameElement = propertyNameList.item( 0 ).toElement();
10151021
QString labelAttribute = propertyNameElement.text();
10161022
vec->label()->setLabelField( QgsLabel::Text, vec->dataProvider()->fieldNameIndex( labelAttribute ) );
@@ -1301,7 +1307,9 @@ bool QgsSLDConfigParser::labelSettingsFromUserStyle( const QDomElement& userStyl
13011307
myLabelAttributes->setAngle( rotationAngle );
13021308
}
13031309
} // end labelPlacement
1310+
Q_NOWARN_DEPRECATED_PUSH
13041311
vec->enableLabels( true );
1312+
Q_NOWARN_DEPRECATED_POP
13051313

13061314
return true;
13071315
}

0 commit comments

Comments
 (0)
Please sign in to comment.