Bug report #19743

New lines character is weirdly rendered in layout label item text, breaking expressions

Added by Harrissou Santanna about 6 years ago. Updated about 6 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Expressions
Affected QGIS version:3.3(master) Regression?:Yes
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:27568

Description

Open a layout and add a label item
Using the "Insert expression" button, I wrote a long multiline expression, to improve readability.
Code looks valid and I applied.
Later on, I decided to add more details to the expression, hence selected the whole content of the label item's "main properties" frame, including the brackets and click "insert expression"
In the new dialog, the previously successful expression is marked as invalid and some weird characters are added to the command.
Give a look to the attached image showing the code I first wrote, and then how it's rendered at reopening the dialog.

It looks like the new line character is not handled in the code.

breaklines.png (43.4 KB) Harrissou Santanna, 2018-08-31 06:55 PM

Associated revisions

Revision bb911707
Added by Nyall Dawson about 6 years ago

[layouts] Fix label expression contains unicode characters when edited

Fixes #19743

Revision fbed86eb
Added by Nyall Dawson about 6 years ago

[layouts] Fix label expression contains unicode characters when edited

Fixes #19743

(cherry picked from commit bb9117075d14a748c8ca6632cd23cb5668abc4f5)

History

#1 Updated by Nyall Dawson about 6 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

#2 Updated by Giovanni Manghi about 6 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF