Skip to content

Commit ac095e4

Browse files
committed
refactor: rename TSynEditHelper.TextIsEmpty to HasText
1 parent 7423aa3 commit ac095e4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

source/copytable.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ procedure TCopyTableForm.FormClose(Sender: TObject; var Action: TCloseAction);
172172
Node := TreeElements.GetNextSibling(Node);
173173
end;
174174
// Store recent filters
175-
if MemoFilter.Enabled and (not MemoFilter.TextIsEmpty) then begin
175+
if MemoFilter.Enabled and MemoFilter.HasText then begin
176176
NewValues := TStringList.Create;
177177
NewValues.Add(MemoFilter.Text);
178178
for i:=1 to 20 do begin
@@ -479,7 +479,7 @@ procedure TCopyTableForm.btnOKClick(Sender: TObject);
479479
DataCols := Trim(DataCols);
480480
Delete(DataCols, Length(DataCols), 1);
481481
InsertCode := 'INSERT INTO '+TargetTable+' ('+DataCols+') SELECT ' + DataCols + ' FROM ' + FDBObj.QuotedName;
482-
if not MemoFilter.TextIsEmpty then
482+
if MemoFilter.HasText then
483483
InsertCode := InsertCode + ' WHERE ' + MemoFilter.Text;
484484
end;
485485

source/lazaruscompat.pas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface
1818
TSynEditHelper = class helper for TSynEdit
1919
public
2020
function GetTextLen: Integer;
21-
function TextIsEmpty: Boolean;
21+
function HasText: Boolean;
2222
function ConvertCodeStringToCommand(AString: string): TSynEditorCommand;
2323
function IndexToEditorCommand(const AIndex: Integer): Integer;
2424
end;
@@ -166,10 +166,10 @@ function TSynEditHelper.GetTextLen: Integer;
166166
Result := Length(Text);
167167
end;
168168

169-
function TSynEditHelper.TextIsEmpty: Boolean;
169+
function TSynEditHelper.HasText: Boolean;
170170
begin
171171
// Introduced because GetTextLen seems to be unreliable, probably due to the lack of Trim()
172-
Result := Trim(Text).IsEmpty;
172+
Result := not Trim(Text).IsEmpty;
173173
end;
174174

175175
function TSynEditHelper.ConvertCodeStringToCommand(AString: string): TSynEditorCommand;

0 commit comments

Comments
 (0)