refactor: rename TSynEditHelper.TextIsEmpty to HasText

This commit is contained in:
Ansgar Becker
2026-01-19 11:19:21 +01:00
parent 7423aa3561
commit ac095e46cd
2 changed files with 5 additions and 5 deletions

View File

@@ -172,7 +172,7 @@ begin
Node := TreeElements.GetNextSibling(Node);
end;
// Store recent filters
if MemoFilter.Enabled and (not MemoFilter.TextIsEmpty) then begin
if MemoFilter.Enabled and MemoFilter.HasText then begin
NewValues := TStringList.Create;
NewValues.Add(MemoFilter.Text);
for i:=1 to 20 do begin
@@ -479,7 +479,7 @@ begin
DataCols := Trim(DataCols);
Delete(DataCols, Length(DataCols), 1);
InsertCode := 'INSERT INTO '+TargetTable+' ('+DataCols+') SELECT ' + DataCols + ' FROM ' + FDBObj.QuotedName;
if not MemoFilter.TextIsEmpty then
if MemoFilter.HasText then
InsertCode := InsertCode + ' WHERE ' + MemoFilter.Text;
end;

View File

@@ -18,7 +18,7 @@ type
TSynEditHelper = class helper for TSynEdit
public
function GetTextLen: Integer;
function TextIsEmpty: Boolean;
function HasText: Boolean;
function ConvertCodeStringToCommand(AString: string): TSynEditorCommand;
function IndexToEditorCommand(const AIndex: Integer): Integer;
end;
@@ -166,10 +166,10 @@ begin
Result := Length(Text);
end;
function TSynEditHelper.TextIsEmpty: Boolean;
function TSynEditHelper.HasText: Boolean;
begin
// Introduced because GetTextLen seems to be unreliable, probably due to the lack of Trim()
Result := Trim(Text).IsEmpty;
Result := not Trim(Text).IsEmpty;
end;
function TSynEditHelper.ConvertCodeStringToCommand(AString: string): TSynEditorCommand;