Skip to content
Permalink
Browse files
Properly encode direction symbols in style templates (#6812)
NOTE: this commit does NOT fix the project save operation,
      but only an output of that operation
  • Loading branch information
Sandro Santilli committed Dec 3, 2012
1 parent 1dc75f3 commit 9dd4a92524d43b4a1232a209f7b5d190a5ab6f38
@@ -77,7 +77,7 @@
<property key="labeling/isExpression" value="false"/>
<property key="labeling/labelOffsetInMapUnits" value="true"/>
<property key="labeling/labelPerPart" value="false"/>
<property key="labeling/leftDirectionSymbol" value="< "/>
<property key="labeling/leftDirectionSymbol" value="&lt; "/>
<property key="labeling/mergeLines" value="false"/>
<property key="labeling/minFeatureSize" value="0"/>
<property key="labeling/multiLineLabels" value="false"/>
@@ -93,7 +93,7 @@
<property key="labeling/previewBkgrdColor" value="#ffffff"/>
<property key="labeling/priority" value="2"/>
<property key="labeling/reverseDirectionSymbol" value="false"/>
<property key="labeling/rightDirectionSymbol" value=" >"/>
<property key="labeling/rightDirectionSymbol" value=" &gt;"/>
<property key="labeling/scaleMax" value="0"/>
<property key="labeling/scaleMin" value="0"/>
<property key="labeling/textColorB" value="0"/>
@@ -77,7 +77,7 @@
<property key="labeling/isExpression" value="false"/>
<property key="labeling/labelOffsetInMapUnits" value="true"/>
<property key="labeling/labelPerPart" value="false"/>
<property key="labeling/leftDirectionSymbol" value="< "/>
<property key="labeling/leftDirectionSymbol" value="&lt; "/>
<property key="labeling/mergeLines" value="false"/>
<property key="labeling/minFeatureSize" value="0"/>
<property key="labeling/multiLineLabels" value="false"/>
@@ -93,7 +93,7 @@
<property key="labeling/previewBkgrdColor" value="#ffffff"/>
<property key="labeling/priority" value="3"/>
<property key="labeling/reverseDirectionSymbol" value="true"/>
<property key="labeling/rightDirectionSymbol" value=" >"/>
<property key="labeling/rightDirectionSymbol" value=" &gt;"/>
<property key="labeling/scaleMax" value="0"/>
<property key="labeling/scaleMin" value="0"/>
<property key="labeling/textColorB" value="0"/>

2 comments on commit 9dd4a92

@dakcarto

This comment has been minimized.

Copy link
Member

@dakcarto dakcarto replied Dec 3, 2012

Hi Sandro,

Whoa! That's quite the oversight on my part. I should have time to fix the encoding of XML reserved characters later on this week (maybe Thursday). Swamped with work until then.

Do you think anymore than this needs done before writing?

data.replace(QRegExp("&"), "&amp;"); //first on write, last of read
data.replace(QRegExp("<"), "&lt;");
data.replace(QRegExp(">"), "&gt;");
data.replace(QRegExp("\""), "&quot;");
data.replace(QRegExp("'"), "&apos;");

Then reverse it on read.

For more exotic characters, I was entrusting the base UTF-8 encoding of the project file.

@strk

This comment has been minimized.

Copy link
Contributor

@strk strk replied Dec 4, 2012

Maybe it makes more sense to define an xmlEncode(data) function, if not already available. I'm surprised it's not automatic though, how is that handled by other parts of the project file values ? What if I name a layer "" ?

Please sign in to comment.