Bug report #10365

QgsExpression::expression() incorrectly returns escaped strings

Added by Nyall Dawson over 7 years ago. Updated over 7 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Jürgen Fischer
Category:Expressions
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:18784

Description

I'm pretty sure I've tracked this down to QgsExpression::expression() - steps to reproduce:

1. Add a layer to the map
2. In the layer's style, click data defined properties
3. Add an expression for a parameter " '\\\
' "
4. Click OK
5. Click "Data defined properties" again. The expression has stripped the extra "\\" and is now just " '\
' ".
6. Click OK then reopen the data defined properties dialog - the expression will now be just ''.

Labeling doesn't seem to suffer this same issue, I can only reproduce it in the data defined properties dialog.

Associated revisions

Revision 882912f7
Added by Martin Dobias over 7 years ago

Fix #10365 (incorrectly escaped strings from QgsExpression)

History

#1 Updated by Nathan Woodrow over 7 years ago

This problem lives somewhere else because:


exp = QgsExpression(r"'\\\
'")
exp.dump()
u"'\\\
'"

#2 Updated by Jürgen Fischer over 7 years ago

  • Assignee set to Jürgen Fischer

#3 Updated by Martin Dobias over 7 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF