7 changes: 4 additions & 3 deletions src/core/qgsmaprenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ class QgsDistanceArea;
class QgsOverlayObjectPositionManager;
class QgsVectorLayer;

struct QgsDiagramLayerSettings;
class QgsDiagramLayerSettings;

struct CORE_EXPORT QgsLabelPosition
class CORE_EXPORT QgsLabelPosition
{
public:
QgsLabelPosition( int id, double r, const QVector< QgsPoint >& corners, const QgsRectangle& rect, double w, double h, const QString& layer, bool upside_down, bool diagram = false, bool pinned = false ):
featureId( id ), rotation( r ), cornerPoints( corners ), labelRect( rect ), width( w ), height( h ), layerID( layer ), upsideDown( upside_down ), isDiagram( diagram ), isPinned( pinned ) {}
QgsLabelPosition(): featureId( -1 ), rotation( 0 ), labelRect( QgsRectangle() ), width( 0 ), height( 0 ), layerID( "" ), upsideDown( false ), isDiagram( false ), isPinned( false ) {}
Expand All @@ -61,7 +62,7 @@ struct CORE_EXPORT QgsLabelPosition
/** Labeling engine interface.
* \note Added in QGIS v1.4
*/
class QgsLabelingEngineInterface
class CORE_EXPORT QgsLabelingEngineInterface
{
public:

Expand Down
35 changes: 21 additions & 14 deletions src/core/qgspallabeling.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class QgsMapRenderer;
class QgsRectangle;
class QgsCoordinateTransform;
class QgsLabelSearchTree;
struct QgsDiagramLayerSettings;
class QgsDiagramLayerSettings;

#include <QString>
#include <QFont>
Expand Down Expand Up @@ -121,8 +121,12 @@ class CORE_EXPORT QgsPalLayerSettings
unsigned int placementFlags;
// offset labels of point/centroid features default to center
// move label to quadrant: left/down, don't move, right/up (-1, 0, 1)
int xQuadOffset, yQuadOffset;
double xOffset, yOffset; // offset from point in mm or map units
int xQuadOffset;
int yQuadOffset;

// offset from point in mm or map units
double xOffset;
double yOffset;
double angleOffset; // rotation applied to offset labels
bool centroidWhole; // whether centroid calculated from whole or visible polygon
QFont textFont;
Expand All @@ -136,7 +140,10 @@ class CORE_EXPORT QgsPalLayerSettings
double dist; // distance from the feature (in mm)
double vectorScaleFactor; //scale factor painter units->pixels
double rasterCompressFactor; //pixel resolution scale factor
int scaleMin, scaleMax; // disabled if both are zero

// disabled if both are zero
int scaleMin;
int scaleMax;
double bufferSize; //buffer size (in mm)
QColor bufferColor;
int bufferTransp;
Expand Down Expand Up @@ -171,16 +178,6 @@ class CORE_EXPORT QgsPalLayerSettings
/**Set a property to static instead data defined*/
void removeDataDefinedProperty( DataDefinedProperties p );

// temporary stuff: set when layer gets prepared
pal::Layer* palLayer;
int fieldIndex;
QFontMetricsF* fontMetrics;
const QgsMapToPixel* xform;
const QgsCoordinateTransform* ct;
QgsPoint ptZero, ptOne;
QList<QgsPalGeometry*> geometries;
QgsGeometry* extentGeom;

/**Stores field indices for data defined layer properties*/
QMap< DataDefinedProperties, int > dataDefinedProperties;

Expand All @@ -193,6 +190,16 @@ class CORE_EXPORT QgsPalLayerSettings
@return font pixel size*/
int sizeToPixel( double size, const QgsRenderContext& c , bool buffer = false ) const;

// temporary stuff: set when layer gets prepared
pal::Layer* palLayer;
int fieldIndex;
QFontMetricsF* fontMetrics;
const QgsMapToPixel* xform;
const QgsCoordinateTransform* ct;
QgsPoint ptZero, ptOne;
QList<QgsPalGeometry*> geometries;
QgsGeometry* extentGeom;

private:
/**Checks if a feature is larger than a minimum size (in mm)
@return true if above size, false if below*/
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class QgsRectangle;
class QgsVectorLayerJoinBuffer;
class QgsFeatureRendererV2;
class QgsDiagramRendererV2;
struct QgsDiagramLayerSettings;
class QgsDiagramLayerSettings;

typedef QList<int> QgsAttributeList;
typedef QSet<int> QgsAttributeIds;
Expand Down
1 change: 0 additions & 1 deletion src/core/symbology-ng/qgssymbolv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ class CORE_EXPORT QgsSymbolV2
//! delete layer at specified index and set a new one
bool changeSymbolLayer( int index, QgsSymbolLayerV2* layer );


void startRender( QgsRenderContext& context, const QgsVectorLayer* layer = 0 );
void stopRender( QgsRenderContext& context );

Expand Down
13 changes: 8 additions & 5 deletions src/providers/postgres/qgspostgresprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1029,12 +1029,15 @@ bool QgsPostgresProvider::loadFields()
QString attnum = tresult.PQgetvalue( 0, 0 );
formattedFieldType = tresult.PQgetvalue( 0, 1 );

sql = QString( "SELECT description FROM pg_description WHERE objoid=%1 AND objsubid=%2" )
.arg( tableoid ).arg( attnum );
if( !attnum.isEmpty() )
{
sql = QString( "SELECT description FROM pg_description WHERE objoid=%1 AND objsubid=%2" )
.arg( tableoid ).arg( attnum );

tresult = mConnectionRO->PQexec( sql );
if ( tresult.PQntuples() > 0 )
fieldComment = tresult.PQgetvalue( 0, 0 );
tresult = mConnectionRO->PQexec( sql );
if ( tresult.PQntuples() > 0 )
fieldComment = tresult.PQgetvalue( 0, 0 );
}
}

QVariant::Type fieldType;
Expand Down