mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Load history items with leading or trailing space
This commit is contained in:
parent
092b9c716b
commit
84fbc76bb3
1 changed files with 7 additions and 2 deletions
|
|
@ -947,6 +947,7 @@ var
|
|||
procedure LoadHistory(const NodeName: String; HistoryList: TStrings; LoadObj: Boolean = False);
|
||||
var
|
||||
Idx: Integer;
|
||||
AValue: String;
|
||||
Node: TXmlNode;
|
||||
begin
|
||||
Node := History.FindNode(Root, NodeName);
|
||||
|
|
@ -958,7 +959,11 @@ var
|
|||
begin
|
||||
if Node.CompareName('Item') = 0 then
|
||||
begin
|
||||
Idx:= HistoryList.Add(History.GetContent(Node));
|
||||
if not History.TryGetAttr(Node, 'Value', AValue) then
|
||||
begin
|
||||
AValue:= History.GetContent(Node);
|
||||
end;
|
||||
Idx:= HistoryList.Add(AValue);
|
||||
if LoadObj then begin
|
||||
HistoryList.Objects[Idx]:= TObject(UIntPtr(History.GetAttr(Node, 'Tag', 0)));
|
||||
end;
|
||||
|
|
@ -1040,7 +1045,7 @@ var
|
|||
for I:= 0 to HistoryList.Count - 1 do
|
||||
begin
|
||||
SubNode := History.AddNode(Node, 'Item');
|
||||
History.SetContent(SubNode, HistoryList[I]);
|
||||
History.SetAttr(SubNode, 'Value', HistoryList[I]);
|
||||
if SaveObj then begin
|
||||
History.SetAttr(SubNode, 'Tag', UInt32(UIntPtr(HistoryList.Objects[I])));
|
||||
end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue