Skip to content
Permalink
Browse files

Preserve expression formatting

  • Loading branch information
m-kuhn committed Nov 26, 2014
1 parent 13255b1 commit 5a883c0a9fd4f1f236047a0c96ce66836241e5b8
Showing with 16 additions and 7 deletions.
  1. +16 −7 src/core/qgsexpression.h
@@ -162,7 +162,13 @@ class CORE_EXPORT QgsExpression
double scale() { return mScale; }

//! Alias for dump()
const QString expression() const { return dump(); }
const QString expression() const
{
if ( !mExp.isNull() )
return mExp;
else
return dump();
}

//! Return the expression string that represents this QgsExpression.
QString dump() const;
@@ -620,7 +626,9 @@ class CORE_EXPORT QgsExpression
static QString group( QString group );

protected:
// internally used to create an empty expression
/**
* Used by QgsOgcUtils to create an empty
*/
QgsExpression() : mRootNode( 0 ), mRowNumber( 0 ), mCalc( 0 ) {}

void initGeomCalculator();
@@ -634,17 +642,18 @@ class CORE_EXPORT QgsExpression
double mScale;
QString mExp;

static QMap<QString, QVariant> gmSpecialColumns;
static QMap<QString, QString> gmSpecialColumnGroups;

QgsDistanceArea *mCalc;

friend class QgsOgcUtils;
static QMap<QString, QVariant> gmSpecialColumns;
static QMap<QString, QString> gmSpecialColumnGroups;

static void initFunctionHelp();
static QHash<QString, QString> gFunctionHelpTexts;
static QHash<QString, QString> gGroups;

static void initFunctionHelp();

friend class QgsOgcUtils;

private:
Q_DISABLE_COPY( QgsExpression ) // for now - until we have proper copy constructor / implicit sharing
};

0 comments on commit 5a883c0

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