Skip to content

Commit

Permalink
[layouts] Fix label expression contains unicode characters when edited
Browse files Browse the repository at this point in the history
Fixes #19743
  • Loading branch information
nyalldawson committed Sep 4, 2018
1 parent 15e5809 commit bb91170
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/layout/qgslayoutlabelwidget.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit bb91170

Please sign in to comment.