[Libreoffice-commits] core.git: wizards/source
Jean-Pierre Ledure (via logerrit)
logerrit at kemper.freedesktop.org
Sat Oct 2 11:50:14 UTC 2021
wizards/source/scriptforge/SF_Platform.xba | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit b42a94c6fdc3c1cf2b4266c3642ca20c696a9d9d
Author: Jean-Pierre Ledure <jp at ledure.be>
AuthorDate: Sat Oct 2 12:54:28 2021 +0200
Commit: Jean-Pierre Ledure <jp at ledure.be>
CommitDate: Sat Oct 2 13:49:40 2021 +0200
ScriptForge - (SF_Platform) increase speed of Fonts property
Tests have proven that the use of a case sensitive search
on long strings improves significantly the execution
performance.
The number of fonts being potentially huge (2-3K), the change
in the InStr() Basic function of the Compare argument
can divide the execution duration by factors in the range > 5.
Change-Id: I248ff88cd2cb5a2753e7749f8d512ad44b5fc8d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122979
Tested-by: Jean-Pierre Ledure <jp at ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp at ledure.be>
diff --git a/wizards/source/scriptforge/SF_Platform.xba b/wizards/source/scriptforge/SF_Platform.xba
index 703ae195b942..c504de6b9809 100644
--- a/wizards/source/scriptforge/SF_Platform.xba
+++ b/wizards/source/scriptforge/SF_Platform.xba
@@ -346,7 +346,7 @@ Const cstSubArgs = ""
' Select only not yet registered fonts
For i = 0 To UBound(oFontDescriptors)
sFont = oFontDescriptors(i).Name
- If InStr(sFonts, "," & sFont & ",") = 0 Then sFonts = sFonts & sFont & ","
+ If InStr(1, sFonts, "," & sFont & ",", 0) = 0 Then sFonts = sFonts & sFont & "," ' Case-sensitive comparison
Next i
' Remove leading and trailing commas
If Len(sFonts) > 1 Then _PropertyGet = Split(Mid(sFonts, 2, Len(sFonts) - 2), ",") Else _PropertyGet = Array()
More information about the Libreoffice-commits
mailing list