From d66de2be79d2c50511962090221ec4454351b9e8 Mon Sep 17 00:00:00 2001 From: jesus Date: Fri, 24 Oct 2008 18:48:33 +0000 Subject: [PATCH] LCL, fix dbgrid multiselect issue #12462 git-svn-id: trunk@17130 - --- lcl/dbgrids.pas | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/lcl/dbgrids.pas b/lcl/dbgrids.pas index 4276914dee..9f9ab986b8 100644 --- a/lcl/dbgrids.pas +++ b/lcl/dbgrids.pas @@ -111,11 +111,18 @@ type type + { TBMStringList } + + TBMStringList = class (TStringList) + protected + function DoCompareText(const s1,s2 : string) : PtrInt; override; + end; + { TBookmarkList } TBookmarkList=class private - FList: TStringlist; + FList: TBMStringList; FGrid: TCustomDbGrid; function GetCount: integer; function GetCurrentRowSelected: boolean; @@ -3463,7 +3470,7 @@ constructor TBookmarkList.Create(AGrid: TCustomDBGrid); begin inherited Create; FGrid := AGrid; - FList := TStringList.Create; + FList := TBMStringList.Create; FList.CaseSensitive:=True; FList.Sorted:=True; end; @@ -3528,6 +3535,19 @@ begin FGrid.Invalidate; end; +{ TBMStringList } + +function TBMStringList.DoCompareText(const s1, s2: string): PtrInt; +begin + if Length(s1)Length(s2) then + result := 1 + else + result := CompareMemRange(@s1[1],@s2[1], Length(s1)); +end; + initialization {$I lcl_dbgrid_images.lrs}