Bug report #10365
QgsExpression::expression() incorrectly returns escaped strings
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
Fix #10365 (incorrectly escaped strings from QgsExpression)
History
#1 Updated by Nathan Woodrow over 10 years ago
This problem lives somewhere else because:
exp = QgsExpression(r"'\\\
'")
exp.dump()
u"'\\\
'"
#2 Updated by Jürgen Fischer over 10 years ago
- Assignee set to Jürgen Fischer
#3 Updated by Martin Dobias over 10 years ago
- Status changed from Open to Closed
Fixed in changeset 882912f748fa34b79b8f8deaa68f54b17233a498.