diff options
author | Jean-Pierre Ledure <jp@ledure.be> | 2021-08-19 17:24:59 +0200 |
---|---|---|
committer | Jean-Pierre Ledure <jp@ledure.be> | 2021-08-19 18:39:31 +0200 |
commit | 852454a487aefc17523804dc93892f34047365a0 (patch) | |
tree | fc10418043686f88b5cf8d5787b19b9dfa8a5f69 | |
parent | tdf#134569 writerfilter: move tableParaProps on table endLevel (diff) | |
download | core-852454a487aefc17523804dc93892f34047365a0.tar.gz core-852454a487aefc17523804dc93892f34047365a0.zip |
ScriptForge - (SF_String) FIX misplaced brackets in _Repr()
Next Basic code:
Sub ReprNotPrintable()
Dim a,b
GlobalScope.BasicLibraries.loadLibrary("ScriptForge")
a = "abc" & Chr(31) & "def"
b = SF_String.Represent(a)
End Sub
gives a Basic runtime error « Invalid procedure call »
when error handling is disabled.
Reason: misplaced brackets in SF_String._Repr() when
the argument contains a non-printable character.
ScriptForge additional info :
Location : String.Represent/2113
Invalid procedure call.
Should give :
b = "abc\x1Fdef"
Bug fixed on master in commit https://gerrit.libreoffice.org/c/core/+/119824
Change-Id: I9d180de99c803a49a56c4c1b22847cfc5a1f9608
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120748
Tested-by: Jenkins
Reviewed-by: Alain Romedenne <alain.romedenne@libreoffice.org>
-rw-r--r-- | wizards/source/scriptforge/SF_String.xba | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/wizards/source/scriptforge/SF_String.xba b/wizards/source/scriptforge/SF_String.xba index f7c645981c8b..799c055942cb 100644 --- a/wizards/source/scriptforge/SF_String.xba +++ b/wizards/source/scriptforge/SF_String.xba @@ -2709,7 +2709,7 @@ Dim i As Long sChar = Mid(sString, lPos, 1) If Not SF_String.IsPrintable(sChar) Then lAsc = Asc(sChar) - sChar = "\x" & Iif(lAsc < 255, Right("00" & Hex(lAsc, 2)), Right("0000" & Hex(lAsc, 4))) + sChar = "\x" & Iif(lAsc < 255, Right("00" & Hex(lAsc), 2), Right("0000" & Hex(lAsc), 4)) If lPos < Len(sString) Then sString = Left(sString, lPos - 1) & sChar & Mid(sString, lPos + 1) Else |