summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorJean-Pierre Ledure <jp@ledure.be>2022-06-23 12:22:48 +0200
committerJean-Pierre Ledure <jp@ledure.be>2022-06-23 13:14:34 +0200
commitf79501f6fd42f58da091b525321f81495fd798fb (patch)
tree7a9405ce794e1036637aa89f94685224d3ece69d /wizards
parent7b7fc499c889277c6977dcf71f673880ebfb342e (diff)
ScriptForge - (SF_String) FIX Unquote() with "'" as quoting char
The quoting character (2nd argument of the method) can be the single or the double quote. The single quote was erroneously ignored. Additionally comments are added in the code about non-symmetrical escaping approaches: "" or \' (maybe to be added in help texts ?) Cfr. commit on master: https://gerrit.libreoffice.org/c/core/+/136292 Change-Id: Id2988e6c6cef3a07d46e4d67f33d47e56a4a6e29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136304 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins
Diffstat (limited to 'wizards')
-rw-r--r--wizards/source/scriptforge/SF_String.xba5
1 files changed, 4 insertions, 1 deletions
diff --git a/wizards/source/scriptforge/SF_String.xba b/wizards/source/scriptforge/SF_String.xba
index 10ce48045ab8..888cf672c5da 100644
--- a/wizards/source/scriptforge/SF_String.xba
+++ b/wizards/source/scriptforge/SF_String.xba
@@ -2539,6 +2539,9 @@ Public Function Unquote(Optional ByRef InputStr As Variant _
) As String
&apos;&apos;&apos; Reset a quoted string to its original content
&apos;&apos;&apos; (used f.i. for parsing of csv-like records)
+&apos;&apos;&apos; When the input string contains the quote character, the latter must be escaped:
+&apos;&apos;&apos; - QuoteChar = double quote, by doubling it (&quot;&quot;)
+&apos;&apos;&apos; - QuoteChar = single quote, with a preceding backslash (\&apos;)
&apos;&apos;&apos; Args:
&apos;&apos;&apos; InputStr: the input string
&apos;&apos;&apos; QuoteChar: either &quot; (default) or &apos;
@@ -2567,7 +2570,7 @@ Check:
End If
Try:
- If Left(InputStr, 1) &lt;&gt; &quot;&quot;&quot;&quot; Then &apos; No need to parse further
+ If Left(InputStr, 1) &lt;&gt; QuoteChar Then &apos; No need to parse further
sUnquote = InputStr
Else
Set oCharacterClass = SF_Utils._GetUNOService(&quot;CharacterClass&quot;)