diff --git a/source/apphelpers.pas b/source/apphelpers.pas index 07b07b17..b94d287f 100644 --- a/source/apphelpers.pas +++ b/source/apphelpers.pas @@ -2811,7 +2811,7 @@ begin Place := (Sender as TControl).Name else Place := 'unhandled-'+Sender.ClassName; - if IsNotEmpty(Anchor) then + if not Anchor.IsEmpty then Anchor := '#'+Anchor; ShellExec(APPDOMAIN+'help.php?place='+EncodeURLParam(Place)+Anchor); end; @@ -3878,7 +3878,7 @@ var KeyPath: String; begin PrepareRegistry; - if IsEmpty(FSessionPath) then + if FSessionPath.IsEmpty then raise Exception.CreateFmt(_('No path set, won''t delete root key %s'), [FRegistry.CurrentPath]) else begin KeyPath := REGKEY_SESSIONS + '\' + FSessionPath; @@ -3893,7 +3893,7 @@ var KeyPath: String; begin PrepareRegistry; - if IsEmpty(FSessionPath) then + if FSessionPath.IsEmpty then raise Exception.CreateFmt(_('No path set, won''t move root key %s'), [FRegistry.CurrentPath]) else begin KeyPath := REGKEY_SESSIONS + '\' + FSessionPath; @@ -3966,9 +3966,9 @@ begin ValueName := FSettings[Index].Name; if FormatName <> '' then ValueName := Format(ValueName, [FormatName]); - if FSettings[Index].Session and IsEmpty(FSessionPath) then + if FSettings[Index].Session and FSessionPath.IsEmpty then raise Exception.Create(_('Attempt to read session setting without session path')); - if (not FSettings[Index].Session) and IsNotEmpty(FSessionPath) then + if (not FSettings[Index].Session) and (not FSessionPath.IsEmpty) then SessionPath := '' else PrepareRegistry; @@ -4041,9 +4041,9 @@ begin ValueName := FSettings[Index].Name; if FormatName <> '' then ValueName := Format(ValueName, [FormatName]); - if FSettings[Index].Session and IsEmpty(FSessionPath) then + if FSettings[Index].Session and FSessionPath.IsEmpty then raise Exception.Create(_('Attempt to write session setting without session path')); - if (not FSettings[Index].Session) and IsNotEmpty(FSessionPath) then + if (not FSettings[Index].Session) and (not FSessionPath.IsEmpty) then SessionPath := '' else PrepareRegistry; diff --git a/source/column_selection.pas b/source/column_selection.pas index eb6c92ad..faecf21e 100644 --- a/source/column_selection.pas +++ b/source/column_selection.pas @@ -137,7 +137,7 @@ begin if IsNotEmpty(editFilter.Text) then begin FLastFilter := editFilter.Text; editFilter.Text := ''; - end else if IsNotEmpty(FLastFilter) then begin + end else if not FLastFilter.IsEmpty then begin editFilter.Text := FLastFilter; FLastFilter := ''; end; diff --git a/source/copytable.pas b/source/copytable.pas index 02f74fd4..aec2e1d8 100644 --- a/source/copytable.pas +++ b/source/copytable.pas @@ -142,7 +142,7 @@ begin popupRecentFilters.Items.Clear; for i:=1 to 20 do begin Filter := AppSettings.ReadString(asCopyTableRecentFilter, IntToStr(i)); - if IsEmpty(Filter) then + if Filter.IsEmpty then Continue; Item := TMenuItem.Create(popupRecentFilters); Item.Caption := IntToStr(i) + ' ' + StrEllipsis(Filter, 100); @@ -183,7 +183,7 @@ begin NewValues.Add(MemoFilter.Text); for i:=1 to 20 do begin Filter := AppSettings.ReadString(asCopyTableRecentFilter, IntToStr(i)); - if IsEmpty(Filter) then + if Filter.IsEmpty then Continue; if NewValues.IndexOf(Filter) = -1 then NewValues.Add(Filter); diff --git a/source/grideditlinks.pas b/source/grideditlinks.pas index 16026ceb..5310a217 100644 --- a/source/grideditlinks.pas +++ b/source/grideditlinks.pas @@ -1551,7 +1551,7 @@ begin if Item.Checked then NewValue := NewValue + StripHotkey(Item.Caption) + ','; end; - if not IsEmpty(NewValue) then + if not NewValue.IsEmpty then Delete(NewValue, Length(NewValue), 1); FTextEdit.Text := NewValue; FModified := True; diff --git a/source/main.pas b/source/main.pas index 17e561a1..82c96a40 100644 --- a/source/main.pas +++ b/source/main.pas @@ -3165,7 +3165,7 @@ begin Tab := GetQueryTabByNumber(Thread.TabNumber); // Error handling - if IsNotEmpty(Thread.ErrorMessage) then begin + if not Thread.ErrorMessage.IsEmpty then begin SetProgressState(pbsError); GoToErrorPos(Thread.ErrorMessage); ErrorDialog(Thread.ErrorMessage); @@ -3242,7 +3242,7 @@ begin // Assume that a bunch of up to 5 queries is not a batch. AppSettings.ResetPath; if AppSettings.ReadBool(asQueryHistoryEnabled) - and IsEmpty(Thread.ErrorMessage) + and Thread.ErrorMessage.IsEmpty and (Thread.Batch.Count <= 5) and (Thread.Batch.Size <= SIZE_MB) then begin @@ -4832,7 +4832,7 @@ begin // Add all other filenames for i:=0 to 20 do begin savedfilename := AppSettings.ReadString(asSQLfile, IntToStr(i)); - if IsEmpty(savedfilename) then + if savedfilename.IsEmpty then Break; AppSettings.DeleteValue(asSQLfile, IntToStr(i)); if CheckIfFileExists and (not FileExists( savedfilename )) then @@ -4923,7 +4923,7 @@ begin // Add old filters for i:=1 to 20 do begin val := AppSettings.ReadString(asRecentFilter, IntToStr(i)); - if IsEmpty(val) then + if val.IsEmpty then Continue; if Filters.IndexOf(val) = -1 then Filters.Add(val); @@ -10897,7 +10897,7 @@ begin // Previously introduced bugs stored some other settings here, see issue #2127 item := TMenuItem.Create(popupFilter); capt := AppSettings.ReadString(asRecentFilter, IntToStr(i)); - if IsEmpty(capt) then + if capt.IsEmpty then Break; capt := rx.Replace(capt, ' ', True); item.Hint := capt;