From b46504f61e99666b454abd96eecbcec2181ea6b9 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 3 May 2022 19:25:26 +0200 Subject: [PATCH] SynUniHighlighter: Fix CaseSensitive property (undo negating the bool value 3fc6bd15d3b953c16326b53a300ab00831b2efbe svn:trunk@13025). Prevent crash on unsorted list. Issue #39720 --- .../synunihighlighter/synunihighlighter.pas | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/components/synunihighlighter/synunihighlighter.pas b/components/synunihighlighter/synunihighlighter.pas index 8ae4ab8ba8..ea71fdbf0b 100644 --- a/components/synunihighlighter/synunihighlighter.pas +++ b/components/synunihighlighter/synunihighlighter.pas @@ -621,8 +621,8 @@ begin FillChar(SymbolList,sizeof(SymbolList),0); ////TL Added @ prefix - CaseFunct:=@CaseNone; - StringCaseFunct:=@StringCaseNone; + CaseFunct:=@UpCase; + StringCaseFunct:=@UpperCase; fPrepared:=false; fCloseOnTerm:=false; @@ -835,16 +835,16 @@ end; procedure TSynRange.SetCaseSensitive(const Value: boolean); begin FCaseSensitive:=Value; - if Value then // DiBo33 Removed not so correct function is set + if Value then + begin + CaseFunct:=@CaseNone; + StringCaseFunct:=@StringCaseNone; + end + else begin ////TL Added @ prefix CaseFunct:=@UpCase; StringCaseFunct:=@UpperCase; - end - else - begin - CaseFunct:=@CaseNone; - StringCaseFunct:=@StringCaseNone; end; end; @@ -2632,6 +2632,7 @@ begin xmlInfoTags := nil; try xmlInfoTags := TStringList.Create; + xmlInfoTags.Sorted := true; BuildXMLIndexes( xmlInfoTags ); ////TL Added 3rd parameter if (not GetNextTag(CurTagIndex,Param,false)) or (CurTagIndex<>xitUniHighlighter) then