mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 08:09:26 +02:00
fix for TWin32ListStringList to preserve special chars and status on assign operation
git-svn-id: trunk@10233 -
This commit is contained in:
parent
3f883b4f36
commit
a4664b8977
@ -125,36 +125,24 @@ Begin
|
||||
RecreateWnd(FSender);
|
||||
End;
|
||||
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TWin32ListStringList.Assign
|
||||
Method: TWin32ListStringList.AddStrings
|
||||
Params:
|
||||
Returns:
|
||||
|
||||
------------------------------------------------------------------------------}
|
||||
Procedure TWin32ListStringList.Assign(Source: TPersistent);
|
||||
Var
|
||||
S: TStrings;
|
||||
procedure TWin32ListStringList.AddStrings(TheStrings: TStrings);
|
||||
var
|
||||
Counter: Integer;
|
||||
AnIndex: Integer;
|
||||
Begin
|
||||
{ Do not call inherited Assign as it does things we do not want to happen }
|
||||
If Source Is TStrings Then
|
||||
AnIndex: LongInt;
|
||||
begin
|
||||
For Counter := 0 To TheStrings.Count - 1 Do
|
||||
Begin
|
||||
S:= TStrings(Source);
|
||||
QuoteChar:=S.QuoteChar;
|
||||
Delimiter:=S.Delimiter;
|
||||
NameValueSeparator:=S.NameValueSeparator;
|
||||
Windows.SendMessage(FWin32List, FFlagResetContent, 0, 0);
|
||||
For Counter := 0 To (TStrings(Source).Count - 1) Do
|
||||
Begin
|
||||
AnIndex := Windows.SendMessage(FWin32List, FFlagAddString, 0, LPARAM(PChar(S[Counter]))); //Insert
|
||||
PutObject(AnIndex, S.Objects[Counter]);
|
||||
end;
|
||||
End
|
||||
Else
|
||||
inherited Assign(Source);
|
||||
End;
|
||||
|
||||
AnIndex := Windows.SendMessage(FWin32List, FFlagAddString, 0, LPARAM(PChar(TheStrings[Counter]))); //Insert
|
||||
PutObject(AnIndex, TheStrings.Objects[Counter]);
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TWin32ListStringList.Add
|
||||
|
@ -61,7 +61,7 @@ Type
|
||||
Procedure SetSorted(Val: Boolean); Virtual;
|
||||
Public
|
||||
Constructor Create(List : HWND; TheOwner: TWinControl);
|
||||
Procedure Assign(Source: TPersistent); Override;
|
||||
procedure AddStrings(TheStrings: TStrings); override;
|
||||
Procedure Clear; Override;
|
||||
Procedure Delete(Index: Integer); Override;
|
||||
Procedure Insert(Index: Integer; Const S: String); Override;
|
||||
|
Loading…
Reference in New Issue
Block a user