Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 15, 2014
1 parent 8242a04 commit 1c0d5e2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/core/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2198,6 +2198,9 @@ int QgsExpression::NodeBinaryOperator::precedence() const
case boGT:
case boRegexp:
case boLike:
case boILike:
case boNotLike:
case boNotILike:
case boIs:
case boIsNot:
return 3;
Expand Down
15 changes: 9 additions & 6 deletions src/core/qgsmaplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,9 @@ bool QgsMapLayer::writeLayerXML( QDomElement& layerElement, QDomDocument& docume

} // bool QgsMapLayer::writeXML

QDomDocument QgsMapLayer::asLayerDefinition ()
QDomDocument QgsMapLayer::asLayerDefinition()
{
QDomDocument doc( "qgis-layer-definition");
QDomDocument doc( "qgis-layer-definition" );
QDomElement maplayer = doc.createElement( "maplayer" );
this->writeLayerXML( maplayer, doc );
maplayer.removeChild( maplayer.firstChildElement( "id" ) );
Expand All @@ -589,11 +589,11 @@ QDomDocument QgsMapLayer::asLayerDefinition ()

QgsMapLayer* QgsMapLayer::fromLayerDefinition( QDomDocument& document )
{
QDomNode layernode = document.elementsByTagName( "maplayer" ).at(0);
QDomNode layernode = document.elementsByTagName( "maplayer" ).at( 0 );
QDomElement layerElem = layernode.toElement();

QString type = layerElem.attribute( "type" );
QgsDebugMsg(type);
QgsDebugMsg( type );
QgsMapLayer *layer = NULL;

if ( type == "vector" )
Expand All @@ -613,21 +613,24 @@ QgsMapLayer* QgsMapLayer::fromLayerDefinition( QDomDocument& document )
bool ok = layer->readLayerXML( layerElem );
if ( ok )
return layer;

delete layer;
return 0;
}

QgsMapLayer* QgsMapLayer::fromLayerDefinitionFile( const QString qlrfile )
{
QFile file( qlrfile );
if ( !file.open( QIODevice::ReadOnly ) )
{
QgsDebugMsg("Can't open file");
QgsDebugMsg( "Can't open file" );
return 0;
}

QDomDocument doc;
if ( !doc.setContent( &file ) )
{
QgsDebugMsg("Can't set content");
QgsDebugMsg( "Can't set content" );
return 0;
}

Expand Down
3 changes: 3 additions & 0 deletions src/core/symbology-ng/qgssymbollayerv2utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,8 @@ void QgsSymbolLayerV2Utils::drawStippledBackround( QPainter* painter, QRect rect
#include <cfloat>


#if !defined(GEOS_VERSION_MAJOR) || !defined(GEOS_VERSION_MINOR) || \
((GEOS_VERSION_MAJOR<3) || ((GEOS_VERSION_MAJOR==3) && (GEOS_VERSION_MINOR<3)))
// calculate line's angle and tangent
static bool lineInfo( QPointF p1, QPointF p2, double& angle, double& t )
{
Expand Down Expand Up @@ -644,6 +646,7 @@ static QPointF linesIntersection( QPointF p1, double t1, QPointF p2, double t2 )
y = p1.y() + t1 * ( x - p1.x() );
return QPointF( x, y );
}
#endif


QPolygonF offsetLine( QPolygonF polyline, double dist )
Expand Down

0 comments on commit 1c0d5e2

Please sign in to comment.