Skip to content

Commit 0e2ceb9

Browse files
committedOct 1, 2018
Fix rule based labeling does not permit moving labels using interactive tool
Fixes #19979
1 parent 750d868 commit 0e2ceb9

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed
 

‎src/core/qgsrulebasedlabeling.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,12 @@ QList<QgsAbstractLabelProvider *> QgsRuleBasedLabelProvider::subProviders()
5555
////////////////////
5656

5757
QgsRuleBasedLabeling::Rule::Rule( QgsPalLayerSettings *settings, int scaleMinDenom, int scaleMaxDenom, const QString &filterExp, const QString &description, bool elseRule )
58-
: mParent( nullptr )
59-
, mSettings( settings )
58+
: mSettings( settings )
6059
, mMaximumScale( scaleMinDenom )
6160
, mMinimumScale( scaleMaxDenom )
6261
, mFilterExp( filterExp )
6362
, mDescription( description )
6463
, mElseRule( elseRule )
65-
, mIsActive( true )
6664

6765
{
6866
initFilter();

‎src/core/qgsrulebasedlabeling.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,17 +324,18 @@ class CORE_EXPORT QgsRuleBasedLabeling : public QgsAbstractVectorLayerLabeling
324324
void updateElseRules();
325325

326326
private:
327-
Rule *mParent; // parent rule (NULL only for root rule)
327+
Rule *mParent = nullptr; // parent rule (NULL only for root rule)
328328
std::unique_ptr<QgsPalLayerSettings> mSettings;
329329
double mMaximumScale = 0;
330330
double mMinimumScale = 0;
331-
QString mFilterExp, mDescription;
332-
bool mElseRule;
331+
QString mFilterExp;
332+
QString mDescription;
333+
bool mElseRule = false;
333334
RuleList mChildren;
334335
RuleList mElseRules;
335-
bool mIsActive; // whether it is enabled or not
336+
bool mIsActive = true; // whether it is enabled or not
336337

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

339340
std::unique_ptr<QgsExpression> mFilter;
340341

0 commit comments

Comments
 (0)
Please sign in to comment.