summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorJean-Pierre Ledure <jp@ledure.be>2021-10-02 12:54:28 +0200
committerJean-Pierre Ledure <jp@ledure.be>2021-10-02 13:49:40 +0200
commitb42a94c6fdc3c1cf2b4266c3642ca20c696a9d9d (patch)
tree19896d1396b1ddb5ced7c8dfa8d203c471548c34 /wizards
parent17653c52c3c21e2b9f064156525ed008ac8304c0 (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.xba2
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 = &quot;&quot;
&apos; Select only not yet registered fonts
For i = 0 To UBound(oFontDescriptors)
sFont = oFontDescriptors(i).Name
- If InStr(sFonts, &quot;,&quot; &amp; sFont &amp; &quot;,&quot;) = 0 Then sFonts = sFonts &amp; sFont &amp; &quot;,&quot;
+ If InStr(1, sFonts, &quot;,&quot; &amp; sFont &amp; &quot;,&quot;, 0) = 0 Then sFonts = sFonts &amp; sFont &amp; &quot;,&quot; &apos; Case-sensitive comparison
Next i
&apos; Remove leading and trailing commas
If Len(sFonts) &gt; 1 Then _PropertyGet = Split(Mid(sFonts, 2, Len(sFonts) - 2), &quot;,&quot;) Else _PropertyGet = Array()