Skip to content
Permalink
Browse files

[layouts] Fix label expression contains unicode characters when edited

Fixes #19743

(cherry picked from commit bb91170)
  • Loading branch information
nyalldawson committed Sep 6, 2018
1 parent 1c3d1e7 commit fbed86ebd21e00e4435a0408b5dcebeb8be3a243
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/app/layout/qgslayoutlabelwidget.cpp
@@ -187,6 +187,9 @@ void QgsLayoutLabelWidget::mInsertExpressionButton_clicked()

QString selText = mTextEdit->textCursor().selectedText();

// html editor replaces newlines with Paragraph Separator characters - see https://issues.qgis.org/issues/19743
selText = selText.replace( QChar( 0x2029 ), QChar( '\n' ) );

// edit the selected expression if there's one
if ( selText.startsWith( QLatin1String( "[%" ) ) && selText.endsWith( QLatin1String( "%]" ) ) )
selText = selText.mid( 2, selText.size() - 4 );

0 comments on commit fbed86e

Please sign in to comment.
You can’t perform that action at this time.