diff options
author | Jean-Pierre Ledure <jp@ledure.be> | 2021-10-02 12:54:28 +0200 |
---|---|---|
committer | Jean-Pierre Ledure <jp@ledure.be> | 2021-10-02 13:49:40 +0200 |
commit | b42a94c6fdc3c1cf2b4266c3642ca20c696a9d9d (patch) | |
tree | 19896d1396b1ddb5ced7c8dfa8d203c471548c34 /wizards | |
parent | 17653c52c3c21e2b9f064156525ed008ac8304c0 (diff) |
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@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/source/scriptforge/SF_Platform.xba | 2 |
1 files changed, 1 insertions, 1 deletions
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() |