PoFileMaintenance: Rename button etc.

This commit is contained in:
Juha 2025-11-09 13:36:47 +02:00
parent 1049d599ce
commit 773de86e80
3 changed files with 11 additions and 20 deletions

View File

@ -311,10 +311,8 @@ begin
Result := -1;
i := Count - 1;
while i >= 0 do begin
if strlcomp(PChar(AName), PChar(Strings[i]), Length(AName)) = 0 then begin
Result := i;
exit;
end;
if strlcomp(PChar(AName), PChar(Strings[i]), Length(AName)) = 0 then
exit(i);
dec(i);
end;
end;
@ -649,8 +647,7 @@ end;
{ TPotFileList }
procedure TPotFileList.FindDuplicateMsgId(ARes: TPotFile; AFlags: TFindDupFlags
);
procedure TPotFileList.FindDuplicateMsgId(ARes: TPotFile; AFlags: TFindDupFlags);
function GetComparableMsgId(msgid: string): String;
var
@ -717,9 +714,7 @@ var
msgid: String;
begin
ARes.Clear;
TmpHash := TFPObjectHashTable.Create(False);
for i := 0 to Count - 1 do begin
pot := Items[i];
for j := 1 to pot.Count - 1 do begin
@ -747,9 +742,6 @@ begin
end;
end;
end;
TmpHash.Free;
end;

View File

@ -7,9 +7,9 @@ object Form1: TForm1
Caption = 'Po-File maintenance'
ClientHeight = 571
ClientWidth = 896
LCLVersion = '4.99.0.0'
OnCreate = FormCreate
OnDropFiles = FormDropFiles
LCLVersion = '2.3.0.0'
object lbPoFiles: TListBox
Left = 0
Height = 493
@ -28,11 +28,11 @@ object Form1: TForm1
Caption = 'ToolBar1'
ShowCaptions = True
TabOrder = 1
object ToolButton1: TToolButton
object tbOpenPot: TToolButton
Left = 1
Top = 2
Caption = 'Open POT'
OnClick = ToolButton1Click
OnClick = tbOpenPotClick
end
object tbMovePoItems: TToolButton
Left = 202

View File

@ -32,7 +32,7 @@ type
Splitter2: TSplitter;
Timer1: TTimer;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
tbOpenPot: TToolButton;
tbMovePoItems: TToolButton;
tbSave: TToolButton;
tbDupId: TToolButton;
@ -52,7 +52,7 @@ type
procedure tbSaveClick(Sender: TObject);
procedure tbShowMsgIdEntriesClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
procedure tbOpenPotClick(Sender: TObject);
private
FPotList: TPotFileList;
FCurPotFile: TPotFile;
@ -80,7 +80,7 @@ implementation
{ TForm1 }
procedure TForm1.ToolButton1Click(Sender: TObject);
procedure TForm1.tbOpenPotClick(Sender: TObject);
var
f: TPotFile;
begin
@ -205,7 +205,7 @@ procedure TForm1.UpdatePoItems;
;
end;
var
i, j, CntAll, CntNoneEmpty: Integer;
i, j: Integer;
itm: TPotSection;
MatchWords, MatchTxtId, fnd, MatchIgnUName: Boolean;
t: String;
@ -308,8 +308,7 @@ begin
FPotList.Free;
end;
procedure TForm1.FormDropFiles(Sender: TObject; const FileNames: array of string
);
procedure TForm1.FormDropFiles(Sender: TObject; const FileNames: array of string);
var
s: String;
f: TPotFile;