@@ -548,7 +548,7 @@ package body Histories is
548
548
procedure Add_To_History
549
549
(Hist : in out History_Record;
550
550
Key : History_Key;
551
- New_Entry : String )
551
+ New_Entry : VSS.Strings.Virtual_String )
552
552
is
553
553
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
554
554
(String_List, String_List_Access);
@@ -563,7 +563,9 @@ package body Histories is
563
563
if Value.List /= null then
564
564
if not Value.Allow_Duplicates then
565
565
for V in Value.List'Range loop
566
- if Value.List (V).all = New_Entry then
566
+ if Value.List (V).all
567
+ = VSS.Strings.Conversions.To_UTF_8_String (New_Entry)
568
+ then
567
569
Tmp := Value.List (V);
568
570
Value.List (Value.List'First + 1 .. V) :=
569
571
Value.List (Value.List'First .. V - 1 );
@@ -573,7 +575,8 @@ package body Histories is
573
575
end loop ;
574
576
575
577
elsif Value.Merge_First
576
- and then Value.List (Value.List'First).all = New_Entry
578
+ and then Value.List (Value.List'First).all
579
+ = VSS.Strings.Conversions.To_UTF_8_String (New_Entry)
577
580
then
578
581
return ;
579
582
end if ;
@@ -589,13 +592,15 @@ package body Histories is
589
592
Free (Value.List (Value.List'Last));
590
593
Value.List (Value.List'First + 1 .. Value.List'Last) :=
591
594
Value.List (Value.List'First .. Value.List'Last - 1 );
592
- Value.List (Value.List'First) := new String'(New_Entry);
595
+ Value.List (Value.List'First) :=
596
+ new String'(VSS.Strings.Conversions.To_UTF_8_String (New_Entry));
593
597
else
594
598
-- Insert the element in the table
595
599
Tmp2 := new String_List (1 .. Value.List'Length + 1 );
596
600
Tmp2 (2 .. Tmp2'Last) := Value.List.all ;
597
601
Unchecked_Free (Value.List);
598
- Tmp2 (Tmp2'First) := new String'(New_Entry);
602
+ Tmp2 (Tmp2'First) :=
603
+ new String'(VSS.Strings.Conversions.To_UTF_8_String (New_Entry));
599
604
Value.List := Tmp2;
600
605
end if ;
601
606
@@ -604,7 +609,10 @@ package body Histories is
604
609
end if ;
605
610
606
611
else
607
- Value.List := new String_List'(1 => new String'(New_Entry));
612
+ Value.List :=
613
+ new String_List'
614
+ (1 => new String'
615
+ (VSS.Strings.Conversions.To_UTF_8_String (New_Entry)));
608
616
end if ;
609
617
end Add_To_History ;
610
618
@@ -810,10 +818,12 @@ package body Histories is
810
818
procedure Save_Text
811
819
(Self : access Gtk.GEntry.Gtk_Entry_Record'Class;
812
820
Hist : access History_Record;
813
- Key : History_Key)
814
- is
821
+ Key : History_Key) is
815
822
begin
816
- Add_To_History (Hist.all , Key, Self.Get_Text);
823
+ Add_To_History
824
+ (Hist.all ,
825
+ Key,
826
+ VSS.Strings.Conversions.To_Virtual_String (Self.Get_Text));
817
827
end Save_Text ;
818
828
819
829
end Histories ;
0 commit comments