wizards/source/scriptforge/SF_String.xba | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit f79501f6fd42f58da091b525321f81495fd798fb Author: Jean-Pierre Ledure <j...@ledure.be> AuthorDate: Thu Jun 23 12:22:48 2022 +0200 Commit: Jean-Pierre Ledure <j...@ledure.be> CommitDate: Thu Jun 23 13:14:34 2022 +0200 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 <j...@ledure.be> Reviewed-by: Jean-Pierre Ledure <j...@ledure.be> Tested-by: Jenkins 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 ''' Reset a quoted string to its original content ''' (used f.i. for parsing of csv-like records) +''' When the input string contains the quote character, the latter must be escaped: +''' - QuoteChar = double quote, by doubling it ("") +''' - QuoteChar = single quote, with a preceding backslash (\') ''' Args: ''' InputStr: the input string ''' QuoteChar: either " (default) or ' @@ -2567,7 +2570,7 @@ Check: End If Try: - If Left(InputStr, 1) <> """" Then ' No need to parse further + If Left(InputStr, 1) <> QuoteChar Then ' No need to parse further sUnquote = InputStr Else Set oCharacterClass = SF_Utils._GetUNOService("CharacterClass")