[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - wizards/source
Jean-Pierre Ledure (via logerrit)
logerrit at kemper.freedesktop.org
Thu Aug 19 16:40:08 UTC 2021
wizards/source/scriptforge/SF_String.xba | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 852454a487aefc17523804dc93892f34047365a0
Author: Jean-Pierre Ledure <jp at ledure.be>
AuthorDate: Thu Aug 19 17:24:59 2021 +0200
Commit: Jean-Pierre Ledure <jp at ledure.be>
CommitDate: Thu Aug 19 18:39:31 2021 +0200
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 at libreoffice.org>
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
More information about the Libreoffice-commits
mailing list