View Issue Details

IDProjectCategoryView StatusLast Update
0026020LazarusLCLpublic2014-04-14 22:06
ReporterVojtech Cihak Assigned ToZeljan Rikalo  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformamd64OSLinux 
Product Version1.3 (SVN) 
Summary0026020: Method TCustomComboBox.AddHistoryItem and case sensitivity
DescriptionMethod TCustomComboBox.AddHistoryItem manages case sensitivity wrongly.
Also, it uses AnsiCompareText instead of UTF8CompareText (thanks Bart for pointing this).

Patch against r.44722 attached.
Steps To ReproduceSimple demo attached.
Additional InformationLazarus 1.3 r44722M FPC 2.7.1 x86_64-linux-qt
TagsNo tags attached.
Fixed in Revision44726
LazTarget-
Widgetset
Attached Files

Activities

Vojtech Cihak

2014-04-14 12:56

reporter  

CaseSensitive.zip (6,444 bytes)

Vojtech Cihak

2014-04-14 12:57

reporter  

customcombobox.diff (883 bytes)   
Index: customcombobox.inc
===================================================================
--- customcombobox.inc	(revision 44722)
+++ customcombobox.inc	(working copy)
@@ -850,15 +850,15 @@
 begin
   // insert as first
   if (Items.Count=0)
-  or (CaseSensitive and (AnsiCompareText(Items[0],Item)<>0))
-  or (not CaseSensitive and (Items[0]<>Item)) then
+  or (not CaseSensitive and (UTF8CompareText(Items[0],Item)<>0))
+  or (CaseSensitive and (Items[0]<>Item)) then
   begin
     Items.InsertObject(0,Item,AnObject);
   end;
   // delete old
   for i:=Items.Count-1 downto 1 do begin
-    if (CaseSensitive and (AnsiCompareText(Items[i],Item)=0))
-    or (not CaseSensitive and (Items[i]=Item)) then
+    if (not CaseSensitive and (UTF8CompareText(Items[i],Item)=0))
+    or (CaseSensitive and (Items[i]=Item)) then
       Items.Delete(i);
   end;
   // delete overflow items
customcombobox.diff (883 bytes)   

Zeljan Rikalo

2014-04-14 18:40

developer   ~0074393

Thanks for the patch. Please test and close if ok, also it will be merged to 1.2.2 if I reveive positive feedback until 1.2.2 is packaged.

Vojtech Cihak

2014-04-14 22:06

reporter   ~0074398

I tested with r. 44732. I tested also strings like 'ĚŠČŘŽÁÍ' and 'ěščřžáí'.
Works well. Thanks.

Issue History

Date Modified Username Field Change
2014-04-14 12:56 Vojtech Cihak New Issue
2014-04-14 12:56 Vojtech Cihak File Added: CaseSensitive.zip
2014-04-14 12:57 Vojtech Cihak File Added: customcombobox.diff
2014-04-14 15:03 Zeljan Rikalo Assigned To => Zeljan Rikalo
2014-04-14 15:03 Zeljan Rikalo Status new => assigned
2014-04-14 18:40 Zeljan Rikalo Fixed in Revision => 44726
2014-04-14 18:40 Zeljan Rikalo LazTarget => -
2014-04-14 18:40 Zeljan Rikalo Note Added: 0074393
2014-04-14 18:40 Zeljan Rikalo Status assigned => resolved
2014-04-14 18:40 Zeljan Rikalo Resolution open => fixed
2014-04-14 22:06 Vojtech Cihak Note Added: 0074398
2014-04-14 22:06 Vojtech Cihak Status resolved => closed