Skip to content

Commit

Permalink
Fix rule based labeling does not permit moving labels using interacti…
Browse files Browse the repository at this point in the history
…ve tool

Fixes #19979
  • Loading branch information
nyalldawson committed Oct 1, 2018
1 parent 750d868 commit 0e2ceb9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/core/qgsrulebasedlabeling.cpp
Expand Up @@ -55,14 +55,12 @@ QList<QgsAbstractLabelProvider *> QgsRuleBasedLabelProvider::subProviders()
////////////////////

QgsRuleBasedLabeling::Rule::Rule( QgsPalLayerSettings *settings, int scaleMinDenom, int scaleMaxDenom, const QString &filterExp, const QString &description, bool elseRule )
: mParent( nullptr )
, mSettings( settings )
: mSettings( settings )
, mMaximumScale( scaleMinDenom )
, mMinimumScale( scaleMaxDenom )
, mFilterExp( filterExp )
, mDescription( description )
, mElseRule( elseRule )
, mIsActive( true )

{
initFilter();
Expand Down
11 changes: 6 additions & 5 deletions src/core/qgsrulebasedlabeling.h
Expand Up @@ -324,17 +324,18 @@ class CORE_EXPORT QgsRuleBasedLabeling : public QgsAbstractVectorLayerLabeling
void updateElseRules();

private:
Rule *mParent; // parent rule (NULL only for root rule)
Rule *mParent = nullptr; // parent rule (NULL only for root rule)
std::unique_ptr<QgsPalLayerSettings> mSettings;
double mMaximumScale = 0;
double mMinimumScale = 0;
QString mFilterExp, mDescription;
bool mElseRule;
QString mFilterExp;
QString mDescription;
bool mElseRule = false;
RuleList mChildren;
RuleList mElseRules;
bool mIsActive; // whether it is enabled or not
bool mIsActive = true; // whether it is enabled or not

QString mRuleKey; // string used for unique identification of rule within labeling
QString mRuleKey = QUuid::createUuid().toString(); // string used for unique identification of rule within labeling

std::unique_ptr<QgsExpression> mFilter;

Expand Down

0 comments on commit 0e2ceb9

Please sign in to comment.