Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[labeling] allows data defined to align multiline when wordwrap function is used as expression (fix #11805) #1724

Merged
merged 1 commit into from
Dec 15, 2014

Conversation

slarosa
Copy link
Member

@slarosa slarosa commented Dec 8, 2014

Currently it is not possible to use data defined to align multiline text if wordwrap function is used for the label expression. This change allows to do it working. See: http://hub.qgis.org/issues/11805

@@ -3548,7 +3548,7 @@ void QgsPalLabeling::dataDefinedTextFormatting( QgsPalLayerSettings& tmpLyr,
tmpLyr.wrapChar = ddValues.value( QgsPalLayerSettings::MultiLineWrapChar ).toString();
}

if ( !tmpLyr.wrapChar.isEmpty() )
if ( !tmpLyr.wrapChar.isEmpty() || tmpLyr.getLabelExpression()->expression().indexOf("wordwrap", 0) != -1 )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably just be:

if ( !tmpLyr.wrapChar.isEmpty() || tmpLyr.getLabelExpression()->expression().contains( "wordwrap" ) )

It is easier to read and is the same function underneath.

Note: please run scripts/prepare-commit.sh before submitting C++ code. It would have fixed up some of the spacing in your code. I recommend staging your changes before running the script, then you will see any diffs in your working tree (though there is also a diff saved by the script if anything is changed).

@dakcarto
Copy link
Member

Once you have cleaned up the code, and it passes CI, feel free to push the change yourself.

@slarosa
Copy link
Member Author

slarosa commented Dec 14, 2014

Thanks @dakcarto for reviewing.

slarosa added a commit that referenced this pull request Dec 15, 2014
[labeling] allows data defined to align multiline when wordwrap function is used as expression (fix #11805)
@slarosa slarosa merged commit d28619d into qgis:master Dec 15, 2014
@slarosa slarosa deleted the dd_wrapword branch October 12, 2020 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants