Skip to content
Permalink
Browse files

Fix Qt5 build

  • Loading branch information
m-kuhn committed Sep 19, 2015
1 parent 1fe34b3 commit f631ff8b810deeaad60249423e4f47e917e9d4e2
@@ -21,6 +21,7 @@
#include <QString>
#include <QColor>
#include <QPair>
#include <QObject>

/** List of colors paired with a friendly display name identifying the color
* \note Added in version 2.5
@@ -21,6 +21,8 @@ email : sherman at mrcc.com

#include "qgsmessagelog.h"

#include <QDataStream>

QgsFeature::QgsFeature( QgsFeatureId id )
{
d = new QgsFeaturePrivate( id );
@@ -18,6 +18,7 @@
#include "qgsfield_p.h"

#include <QSettings>
#include <QDataStream>
#include <QtCore/qmath.h>


@@ -576,10 +576,10 @@ const unsigned char* QgsLabel::labelPoint( labelpoint& point, const unsigned cha
QGis::WkbType wkbType;
#ifndef QT_NO_DEBUG
const unsigned char *geomend = geom + geomlen;
Q_ASSERT( geom + 1 + sizeof( wkbType ) <= geomend );
#else
Q_UNUSED( geomlen );
#endif
Q_ASSERT( geom + 1 + sizeof( wkbType ) <= geomend );

geom++; // skip endianness
memcpy( &wkbType, geom, sizeof( wkbType ) );
@@ -592,7 +592,9 @@ const unsigned char* QgsLabel::labelPoint( labelpoint& point, const unsigned cha
case QGis::WKBPoint25D:
case QGis::WKBPoint:
{
#ifndef QT_NO_DEBUG
Q_ASSERT( geom + 2*sizeof( double ) <= geomend );
#endif
double *pts = ( double * )geom;
point.p.set( pts[0], pts[1] );
point.angle = 0.0;
@@ -605,11 +607,15 @@ const unsigned char* QgsLabel::labelPoint( labelpoint& point, const unsigned cha
//intentional fall-through
case QGis::WKBLineString: // Line center
{
#ifndef QT_NO_DEBUG
Q_ASSERT( geom + sizeof( int ) <= geomend );
#endif
int nPoints = *( unsigned int * )geom;
geom += sizeof( int );

#ifndef QT_NO_DEBUG
Q_ASSERT( geom + nPoints*sizeof( double )*dims <= geomend );
#endif

// get line center
double *pts = ( double * )geom;
@@ -652,17 +658,23 @@ const unsigned char* QgsLabel::labelPoint( labelpoint& point, const unsigned cha
//intentional fall-through
case QGis::WKBPolygon: // centroid of outer ring
{
#ifndef QT_NO_DEBUG
Q_ASSERT( geom + sizeof( int ) <= geomend );
#endif
int nRings = *( unsigned int * )geom;
geom += sizeof( int );

for ( int i = 0; i < nRings; ++i )
{
#ifndef QT_NO_DEBUG
Q_ASSERT( geom + sizeof( int ) <= geomend );
#endif
int nPoints = *( unsigned int * )geom;
geom += sizeof( int );

#ifndef QT_NO_DEBUG
Q_ASSERT( geom + nPoints*sizeof( double )*dims <= geomend );
#endif

if ( i == 0 )
{
@@ -22,6 +22,7 @@ class QgsMapLayer;
#include <QByteArray>
#include <QMap>
#include <QStringList>
#include <QObject>

class QDomElement;

@@ -24,6 +24,7 @@
#include <QMutex>
#include <QString>
#include <QUrl>
#include <QObject>

class QDomElement;
class QImage;
@@ -17,6 +17,7 @@

#include <Qt>
#include <QPair>
#include <QWidget>
#include <QStringList>

class QFont;
@@ -22,6 +22,8 @@
#include "qgsgpsdevice.h"
#include "qgisplugin.h"

#include <QObject>

class QgisInterface;
class QgsVectorLayer;
class QAction;
@@ -21,6 +21,7 @@
#include <QStringList>
#include <QRegExp>
#include <QUrl>
#include <QObject>

class QgsFeature;
class QgsField;

0 comments on commit f631ff8

Please sign in to comment.
You can’t perform that action at this time.