LHelp: Remove UTF8CompareLatinTextFast calls.

This commit is contained in:
Juha 2024-02-07 14:46:22 +02:00
parent 26547663f2
commit aecb1d9473
2 changed files with 9 additions and 5 deletions

View File

@ -23,7 +23,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
@ -275,7 +275,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

@ -204,10 +204,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);