LHelp: Remove UTF8CompareLatinTextFast calls.

(cherry picked from commit aecb1d9473)
This commit is contained in:
Juha 2024-02-07 14:46:22 +02:00 committed by Maxim Ganetsky
parent 51cf8421b5
commit 6a97f94583
2 changed files with 9 additions and 5 deletions

View File

@ -25,7 +25,7 @@ uses
// LCL
LCLIntf, Forms, StdCtrls, ExtCtrls, ComCtrls, Controls, Menus,
// LazUtils
LazFileUtils, LazStringUtils, LazUTF8, Laz2_XMLCfg, LazLoggerBase,
LazFileUtils, LazStringUtils, Laz2_XMLCfg, LazLoggerBase,
// Turbopower IPro
IpHtml,
// ChmHelp
@ -277,7 +277,9 @@ end;
procedure TChmContentProvider.CompareIndexNodes(Sender: TObject; Node1,
Node2: TTreeNode; var Compare: Integer);
begin
Compare:= UTF8CompareLatinTextFast(Node1.Text, Node2.Text);
// ToDo: Use AnsiCompareText() but only when the data actually has Unicode.
// FPC and Lazarus help files have none.
Compare:= CompareText(Node1.Text, Node2.Text);
end;
procedure TChmContentProvider.ProcTreeKeyDown(Sender: TObject; var Key: Word;

View File

@ -208,10 +208,12 @@ begin
IdxSm:=0;
while (IdxSrc <> fTreeView.Items.TopLvlCount-1 ) and (IdxSm <> fSitemap.Items.Count-1) do
begin
if (UTF8CompareLatinTextFast(fSitemap.Items.Item[IdxSm].Text,
fTreeView.Items.TopLvlItems[IdxSrc].Text) <= 0)
// ToDo: Use AnsiCompareText() but only when the data actually has Unicode.
// FPC and Lazarus help files have none.
if (CompareText(fSitemap.Items.Item[IdxSm].Text,
fTreeView.Items.TopLvlItems[IdxSrc].Text) <= 0)
then begin
// insert sitemap before fTreeView Node
// insert sitemap before fTreeView Node
AddSiteMapItem(fSitemap.Items.Item[IdxSm], ParentNode, fTreeView.Items.TopLvlItems[IdxSrc]);
if IdxSm < fSitemap.Items.Count-1 then
Inc(IdxSm);