Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Preserve expression formatting
  • Loading branch information
m-kuhn committed Nov 30, 2014
1 parent 13255b1 commit 5a883c0
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/core/qgsexpression.h
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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
};
Expand Down

0 comments on commit 5a883c0

Please sign in to comment.