Skip to content
Permalink
Browse files

revert changes to old QgsLabel class

  • Loading branch information
NathanW2 committed Oct 19, 2011
1 parent 9d3079b commit 665e92e4ef257f79c1ce656a1f9ec2b3d768d244
Showing with 5 additions and 30 deletions.
  1. +5 −30 src/core/qgslabel.cpp
@@ -34,14 +34,10 @@
#include "qgsmaptopixel.h"
#include "qgscoordinatetransform.h"
#include "qgsrendercontext.h"
#include "qgssearchtreenode.h"
#include "qgssearchstring.h"

#include "qgslabelattributes.h"
#include "qgslabel.h"

#include <QMessageBox>

// use M_PI define PI 3.141592654
#ifdef WIN32
#undef M_PI
@@ -88,11 +84,9 @@ QString QgsLabel::fieldValue( int attr, QgsFeature &feature )
}

void QgsLabel::renderLabel( QgsRenderContext &renderContext,
QgsFeature &feature,
bool selected,
QgsFeature &feature, bool selected,
QgsLabelAttributes *classAttributes )
{
Q_UNUSED( classAttributes );
if ( mLabelAttributes->selectedOnly() && !selected )
return;

@@ -109,37 +103,16 @@ void QgsLabel::renderLabel( QgsRenderContext &renderContext,
double x2 = point.x();
double scale = ( x2 - x1 ) * 0.001;

QgsSearchString searchString;
if ( !searchString.setString( " to string (Diameter) + 'mm'" ) )
{
//expression not valid
QMessageBox::critical( 0, "Syntax error", "Invalid expression syntax. The error message of the parser is: '" + searchString.parserErrorMsg() + "'" );
return;
}

//get QgsSearchTreeNode
QgsSearchTreeNode* searchTree = searchString.tree();
if ( !searchTree )
{
return;
}

QgsSearchTreeValue outValue;
searchTree->getValue( outValue, searchTree, mField , feature );
if (outValue.isError())
QMessageBox::critical( 0, "Error in expression tree" , "Error" );
text = outValue.string();

/* Text */
/*value = fieldValue( Text, feature );
value = fieldValue( Text, feature );
if ( value.isEmpty() )
{
text = mLabelAttributes->text();
}
else
{
text = value;
} */
}

/* Font */
value = fieldValue( Family, feature );
@@ -1057,6 +1030,8 @@ void QgsLabel::readXML( const QDomNode& node )

} // QgsLabel::readXML()



void QgsLabel::writeXML( QDomNode & layer_node, QDomDocument & document ) const
{
QDomElement labelattributes = document.createElement( "labelattributes" );

0 comments on commit 665e92e

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