rename isNil/NotNil Assigned/NotAssigned and add them for interfaces

FPC 3.2.0 required from now
This commit is contained in:
Basile Burg 2020-07-11 23:29:08 +02:00
parent 9b0a2b5d79
commit 891690410f
55 changed files with 683 additions and 647 deletions

View File

@ -1,5 +1,9 @@
# v3.9.7-dev # v3.9.7-dev
## Other
- compilation: FPC 3.2.0 now required to compile dexed.
## Enhancements ## Enhancements
- Project menu, git: add the first line of last commit message as additional information, between square brackets, to the items of the list of branches. (#53) - Project menu, git: add the first line of last commit message as additional information, between square brackets, to the items of the list of branches. (#53)

View File

@ -859,6 +859,7 @@
<Filename Value="..\src\u_newdubproj.pas"/> <Filename Value="..\src\u_newdubproj.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ComponentName Value="CeNewDubProject"/> <ComponentName Value="CeNewDubProject"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
</Unit58> </Unit58>
<Unit59> <Unit59>

View File

@ -153,7 +153,7 @@ var
constructor TNativeProject.create(aOwner: TComponent); constructor TNativeProject.create(aOwner: TComponent);
begin begin
inherited create(aOwner); inherited create(aOwner);
if not assigned (fCompilerSelector) then if fCompilerSelector.isNotAssigned then
fCompilerSelector := getCompilerSelector; fCompilerSelector := getCompilerSelector;
fAsProjectItf := self as ICommonProject; fAsProjectItf := self as ICommonProject;
fSymStringExpander := getSymStringExpander; fSymStringExpander := getSymStringExpander;
@ -698,7 +698,7 @@ begin
fOutputFilename := currentConfiguration.pathsOptions.outputFilename; fOutputFilename := currentConfiguration.pathsOptions.outputFilename;
fe := currentConfiguration.pathsOptions.forceExtension; fe := currentConfiguration.pathsOptions.forceExtension;
if currentConfiguration.isOverriddenConfiguration and fOutputFilename.isEmpty and if currentConfiguration.isOverriddenConfiguration and fOutputFilename.isEmpty and
fBaseConfig.isNotNil then fBaseConfig.isAssigned then
begin begin
fOutputFilename := fBaseConfig.pathsOptions.outputFilename; fOutputFilename := fBaseConfig.pathsOptions.outputFilename;
fe := fBaseConfig.pathsOptions.forceExtension; fe := fBaseConfig.pathsOptions.forceExtension;
@ -830,7 +830,7 @@ end;
procedure TNativeProject.stopCompilation; procedure TNativeProject.stopCompilation;
begin begin
if fCompilProc.isNotNil and fCompilProc.Running then if fCompilProc.isAssigned and fCompilProc.Running then
fCompilProc.Terminate(1); fCompilProc.Terminate(1);
end; end;
@ -840,7 +840,7 @@ var
prjpath: string; prjpath: string;
prjname: string; prjname: string;
begin begin
if fCompilProc.isNotNil and fCompilProc.Active then if fCompilProc.isAssigned and fCompilProc.Active then
begin begin
fMsgs.message('the project is already being compiled', fMsgs.message('the project is already being compiled',
fAsProjectItf, amcProj, amkWarn); fAsProjectItf, amcProj, amkWarn);
@ -849,7 +849,7 @@ begin
killProcess(fCompilProc); killProcess(fCompilProc);
fCompiled := false; fCompiled := false;
config := currentConfiguration; config := currentConfiguration;
if config.isNil then if config.isNotAssigned then
begin begin
fMsgs.message('unexpected project error: no active configuration', fMsgs.message('unexpected project error: no active configuration',
fAsProjectItf, amcProj, amkErr); fAsProjectItf, amcProj, amkErr);
@ -961,7 +961,7 @@ begin
begin begin
fMsgs.message(format('error: the process (%s) has returned the status %s', fMsgs.message(format('error: the process (%s) has returned the status %s',
[proc.Executable, prettyReturnStatus(proc)]), fAsProjectItf, amcProj, amkErr); [proc.Executable, prettyReturnStatus(proc)]), fAsProjectItf, amcProj, amkErr);
if dproc.isNotNil and dproc.autoKilled then if dproc.isAssigned and dproc.autoKilled then
fMsgs.message(format('the process was autokilled because the size of its output exceeded %d', fMsgs.message(format('the process was autokilled because the size of its output exceeded %d',
[dproc.autoKillProcThreshold]), nil, amcProj, amkWarn); [dproc.autoKillProcThreshold]), nil, amcProj, amkWarn);
end; end;
@ -1150,7 +1150,6 @@ var
sel: ICompilerSelector; sel: ICompilerSelector;
begin begin
sel := getCompilerSelector; sel := getCompilerSelector;
assert(assigned(sel));
if value = gdc then if value = gdc then
value := gdmd value := gdmd
else if value = ldc then else if value = ldc then

View File

@ -111,7 +111,7 @@ end;
procedure TProjectConfigurationWidget.projClosing(project: ICommonProject); procedure TProjectConfigurationWidget.projClosing(project: ICommonProject);
begin begin
if fProj.isNil or (fProj <> project.getProject) then if fProj.isNotAssigned or (fProj <> project.getProject) then
exit; exit;
inspector.TIObject := nil; inspector.TIObject := nil;
inspector.ItemIndex := -1; inspector.ItemIndex := -1;
@ -123,7 +123,7 @@ end;
procedure TProjectConfigurationWidget.projChanged(project: ICommonProject); procedure TProjectConfigurationWidget.projChanged(project: ICommonProject);
begin begin
if fProj.isNil or (fProj <> project.getProject) then if fProj.isNotAssigned or (fProj <> project.getProject) then
exit; exit;
if Visible then if Visible then
updateImperative; updateImperative;
@ -153,7 +153,7 @@ end;
{$REGION config. things --------------------------------------------------------} {$REGION config. things --------------------------------------------------------}
procedure TProjectConfigurationWidget.selConfChange(Sender: TObject); procedure TProjectConfigurationWidget.selConfChange(Sender: TObject);
begin begin
if fProj.isNil or Updating or selConf.ItemIndex.equals(-1) then if fProj.isNotAssigned or Updating or selConf.ItemIndex.equals(-1) then
exit; exit;
beginImperativeUpdate; beginImperativeUpdate;
@ -165,7 +165,7 @@ procedure TProjectConfigurationWidget.TreeChange(Sender: TObject;
Node: TTreeNode); Node: TTreeNode);
begin begin
inspector.TIObject := getGridTarget; inspector.TIObject := getGridTarget;
selconf.Enabled := (inspector.TIObject <> fProj) and fProj.isNotNil; selconf.Enabled := (inspector.TIObject <> fProj) and fProj.isAssigned;
end; end;
procedure TProjectConfigurationWidget.setSyncroMode(value: boolean); procedure TProjectConfigurationWidget.setSyncroMode(value: boolean);
@ -204,11 +204,11 @@ var
trg_obj: TPersistent; trg_obj: TPersistent;
i: Integer; i: Integer;
begin begin
if fProj.isNil then if fProj.isNotAssigned then
exit; exit;
if not fSyncroMode then if not fSyncroMode then
exit; exit;
if inspector.TIObject.isNil then if inspector.TIObject.isNotAssigned then
exit; exit;
if inspector.ItemIndex.equals(-1) then if inspector.ItemIndex.equals(-1) then
exit; exit;
@ -280,7 +280,7 @@ var
nme: string; nme: string;
cfg: TCompilerConfiguration; cfg: TCompilerConfiguration;
begin begin
if fProj.isNil then if fProj.isNotAssigned then
exit; exit;
nme := ''; nme := '';
beginImperativeUpdate; beginImperativeUpdate;
@ -294,7 +294,7 @@ end;
procedure TProjectConfigurationWidget.btnDelConfClick(Sender: TObject); procedure TProjectConfigurationWidget.btnDelConfClick(Sender: TObject);
begin begin
if fProj.isNil or (fProj.OptionsCollection.Count = 1) then if fProj.isNotAssigned or (fProj.OptionsCollection.Count = 1) then
exit; exit;
beginImperativeUpdate; beginImperativeUpdate;
@ -311,7 +311,7 @@ var
nme: string; nme: string;
trg, src: TCompilerConfiguration; trg, src: TCompilerConfiguration;
begin begin
if fProj.isNil then if fProj.isNotAssigned then
exit; exit;
nme := ''; nme := '';
beginImperativeUpdate; beginImperativeUpdate;
@ -330,7 +330,7 @@ procedure TProjectConfigurationWidget.btnSyncEditClick(Sender: TObject);
begin begin
fSynchroValue.Clear; fSynchroValue.Clear;
fSynchroItem.Clear; fSynchroItem.Clear;
if fProj.isNil then if fProj.isNotAssigned then
exit; exit;
syncroMode := not syncroMode; syncroMode := not syncroMode;
end; end;
@ -338,7 +338,7 @@ end;
procedure TProjectConfigurationWidget.GridFilter(Sender: TObject; aEditor: TPropertyEditor; procedure TProjectConfigurationWidget.GridFilter(Sender: TObject; aEditor: TPropertyEditor;
var aShow: boolean); var aShow: boolean);
begin begin
if fProj.isNil then if fProj.isNotAssigned then
exit; exit;
// filter TComponent things. // filter TComponent things.
if getGridTarget = fProj then if getGridTarget = fProj then
@ -381,7 +381,7 @@ end;
function TProjectConfigurationWidget.getGridTarget: TPersistent; function TProjectConfigurationWidget.getGridTarget: TPersistent;
begin begin
if fProj.isNil or fProj.ConfigurationIndex.equals(-1) or Tree.Selected.isNil then if fProj.isNotAssigned or fProj.ConfigurationIndex.equals(-1) or Tree.Selected.isNotAssigned then
exit(nil); exit(nil);
// Warning: TTreeNode.StateIndex is usually made for the images...it's not a tag // Warning: TTreeNode.StateIndex is usually made for the images...it's not a tag
case Tree.Selected.StateIndex of case Tree.Selected.StateIndex of
@ -406,8 +406,8 @@ var
begin begin
selConf.ItemIndex:= -1; selConf.ItemIndex:= -1;
selConf.Clear; selConf.Clear;
selconf.Enabled := (inspector.TIObject <> fProj) and fProj.isNotNil; selconf.Enabled := (inspector.TIObject <> fProj) and fProj.isAssigned;
if fProj.isNil then if fProj.isNotAssigned then
exit; exit;
for i:= 0 to fProj.OptionsCollection.Count-1 do for i:= 0 to fProj.OptionsCollection.Count-1 do

View File

@ -64,14 +64,29 @@ type
// sugar for classes // sugar for classes
TObjectHelper = class helper for TObject TObjectHelper = class helper for TObject
function isNil: boolean; function isNotAssigned: boolean;
function isNotNil: boolean; function isAssigned: boolean;
end; end;
IDexedBaseInterface = interface
end;
// sugar for interfaces
TDexedInterfaceHelper = type helper for IDexedBaseInterface
function isNotAssigned: boolean;
function isAssigned: boolean;
end;
// maybe one day, sugar for events
{TNotifyEventHelper = type helper for TNotifyEvent
function isNotAssigned: boolean;
function isAssigned: boolean;
end;}
// sugar for pointers // sugar for pointers
TPointerHelper = type helper for Pointer TPointerHelper = type helper for Pointer
function isNil: boolean; function isNotAssigned: boolean;
function isNotNil: boolean; function isAssigned: boolean;
end; end;
// sugar for strings // sugar for strings
@ -434,24 +449,44 @@ begin
else inherited; else inherited;
end; end;
function TObjectHelper.isNil: boolean; function TDexedInterfaceHelper.isNotAssigned: boolean;
begin begin
exit(self = nil); result := not assigned(self);
end; end;
function TObjectHelper.isNotNil: boolean; function TDexedInterfaceHelper.isAssigned: boolean;
begin begin
exit(self <> nil); result := assigned(self);
end; end;
function TPointerHelper.isNil: boolean; {function TNotifyEventHelper.isNotAssigned: boolean;
begin begin
exit(self = nil); result := not assigned(self);
end; end;
function TPointerHelper.isNotNil: boolean; function TNotifyEventHelper.isAssigned: boolean;
begin begin
exit(self <> nil); result := assigned(self);
end;}
function TObjectHelper.isNotAssigned: boolean;
begin
result := not assigned(self);
end;
function TObjectHelper.isAssigned: boolean;
begin
result := assigned(self);
end;
function TPointerHelper.isNotAssigned: boolean;
begin
result := not assigned(self);
end;
function TPointerHelper.isAssigned: boolean;
begin
result := assigned(self);
end; end;
function TDexedStringHelper.isEmpty: boolean; function TDexedStringHelper.isEmpty: boolean;
@ -550,7 +585,7 @@ var
v: TJSONData; v: TJSONData;
begin begin
v := self.Find(key); v := self.Find(key);
if v.isNotNil then if v.isAssigned then
begin begin
result := v.JSONType = jtObject; result := v.JSONType = jtObject;
if result then if result then
@ -565,7 +600,7 @@ var
v: TJSONData; v: TJSONData;
begin begin
v := self.Find(key); v := self.Find(key);
if v.isNotNil then if v.isAssigned then
begin begin
result := v.JSONType = jtArray; result := v.JSONType = jtArray;
if result then if result then
@ -578,7 +613,7 @@ end;
function TJSONObjectHelper.findAny(const key: TJSONStringType; out value: TJSONData): boolean; function TJSONObjectHelper.findAny(const key: TJSONStringType; out value: TJSONData): boolean;
begin begin
value := self.Find(key); value := self.Find(key);
result := value.isNotNil; result := value.isAssigned;
end; end;
function TListItemsHelper.findCaption(const value: string; out res: TListItem): boolean; function TListItemsHelper.findCaption(const value: string; out res: TListItem): boolean;
@ -1023,7 +1058,7 @@ begin
if additionalPath.isNotEmpty then if additionalPath.isNotEmpty then
env += PathSeparator + additionalPath; env += PathSeparator + additionalPath;
{$IFNDEF CEBUILD} {$IFNDEF CEBUILD}
if Application.isNotNil then if Application.isAssigned then
env += PathSeparator + ExtractFileDir(application.ExeName.ExtractFilePath); env += PathSeparator + ExtractFileDir(application.ExeName.ExtractFilePath);
{$ENDIF} {$ENDIF}
exit(ExeSearch(fname, env)); exit(ExeSearch(fname, env));
@ -1089,7 +1124,7 @@ end;
procedure killProcess(var process: TAsyncProcess); procedure killProcess(var process: TAsyncProcess);
begin begin
if process.isNil then if process.isNotAssigned then
exit; exit;
if process.Running then if process.Running then
process.Terminate(0); process.Terminate(0);

View File

@ -6,6 +6,7 @@ object CompilersPathsEditor: TCompilersPathsEditor
Caption = 'CompilersPathsEditor' Caption = 'CompilersPathsEditor'
ClientHeight = 900 ClientHeight = 900
ClientWidth = 460 ClientWidth = 460
LCLVersion = '2.0.10.0'
object ScrollBox1: TScrollBox object ScrollBox1: TScrollBox
Left = 0 Left = 0
Height = 900 Height = 900
@ -26,8 +27,8 @@ object CompilersPathsEditor: TCompilersPathsEditor
Align = alTop Align = alTop
AutoSize = True AutoSize = True
Caption = 'DMD' Caption = 'DMD'
ClientHeight = 168 ClientHeight = 167
ClientWidth = 443 ClientWidth = 441
TabOrder = 0 TabOrder = 0
object selDMDexe: TFileNameEdit object selDMDexe: TFileNameEdit
Left = 2 Left = 2
@ -120,8 +121,8 @@ object CompilersPathsEditor: TCompilersPathsEditor
Align = alTop Align = alTop
AutoSize = True AutoSize = True
Caption = 'GDC' Caption = 'GDC'
ClientHeight = 168 ClientHeight = 167
ClientWidth = 443 ClientWidth = 441
TabOrder = 1 TabOrder = 1
object selGDCexe: TFileNameEdit object selGDCexe: TFileNameEdit
Left = 2 Left = 2
@ -216,8 +217,8 @@ object CompilersPathsEditor: TCompilersPathsEditor
Align = alTop Align = alTop
AutoSize = True AutoSize = True
Caption = 'LDC' Caption = 'LDC'
ClientHeight = 168 ClientHeight = 167
ClientWidth = 443 ClientWidth = 441
TabOrder = 2 TabOrder = 2
object selLDCexe: TFileNameEdit object selLDCexe: TFileNameEdit
Left = 2 Left = 2
@ -312,8 +313,8 @@ object CompilersPathsEditor: TCompilersPathsEditor
Align = alTop Align = alTop
AutoSize = True AutoSize = True
Caption = 'User 1' Caption = 'User 1'
ClientHeight = 168 ClientHeight = 167
ClientWidth = 443 ClientWidth = 441
TabOrder = 3 TabOrder = 3
object selUSER1exe: TFileNameEdit object selUSER1exe: TFileNameEdit
Left = 2 Left = 2
@ -406,8 +407,8 @@ object CompilersPathsEditor: TCompilersPathsEditor
Align = alTop Align = alTop
AutoSize = True AutoSize = True
Caption = 'User 2' Caption = 'User 2'
ClientHeight = 168 ClientHeight = 167
ClientWidth = 443 ClientWidth = 441
TabOrder = 4 TabOrder = 4
object selUSER2exe: TFileNameEdit object selUSER2exe: TFileNameEdit
Left = 2 Left = 2
@ -500,8 +501,8 @@ object CompilersPathsEditor: TCompilersPathsEditor
Align = alTop Align = alTop
AutoSize = True AutoSize = True
Caption = 'Compiler paths used for intellisense' Caption = 'Compiler paths used for intellisense'
ClientHeight = 40 ClientHeight = 39
ClientWidth = 443 ClientWidth = 441
TabOrder = 5 TabOrder = 5
object selDefault: TComboBox object selDefault: TComboBox
Left = 4 Left = 4
@ -524,8 +525,8 @@ object CompilersPathsEditor: TCompilersPathsEditor
Align = alTop Align = alTop
AutoSize = True AutoSize = True
Caption = 'Compiler selected as "global"' Caption = 'Compiler selected as "global"'
ClientHeight = 40 ClientHeight = 39
ClientWidth = 443 ClientWidth = 441
TabOrder = 6 TabOrder = 6
object selGlobal: TComboBox object selGlobal: TComboBox
Left = 4 Left = 4

View File

@ -568,7 +568,7 @@ begin
DCDWrapper.relaunch; DCDWrapper.relaunch;
updateDCD; updateDCD;
LibMan.updateDCD; LibMan.updateDCD;
if assigned(fProj) then if fProj.isAssigned then
fProj.activate; fProj.activate;
end; end;
end; end;

View File

@ -709,7 +709,7 @@ var
i: integer; i: integer;
begin begin
result := ''; result := '';
if not assigned(item) then if item.isNotAssigned then
exit; exit;
result := item.Caption; result := item.Caption;
@ -727,7 +727,7 @@ var
i: integer; i: integer;
begin begin
result := ''; result := '';
if not assigned(item) then if item.isNotAssigned then
exit; exit;
result := item.Caption; result := item.Caption;
@ -740,7 +740,7 @@ var
s: string = ''; s: string = '';
c: integer; c: integer;
begin begin
if not assigned(fList) or not assigned(fList.Selected) then if fList.isNotAssigned or fList.Selected.isNotAssigned then
exit; exit;
c := getColumnIndex; c := getColumnIndex;
@ -754,7 +754,7 @@ end;
procedure TListViewCopyMenu.copyLine(sender: TObject); procedure TListViewCopyMenu.copyLine(sender: TObject);
begin begin
if not assigned(fList) or not assigned(fList.Selected) then if fList.isNotAssigned or fList.Selected.isNotAssigned then
exit; exit;
Clipboard.AsText := getLine(fList.Selected); Clipboard.AsText := getLine(fList.Selected);
@ -762,7 +762,7 @@ end;
procedure TListViewCopyMenu.copyLineAsList(sender: TObject); procedure TListViewCopyMenu.copyLineAsList(sender: TObject);
begin begin
if not assigned(fList) or not assigned(fList.Selected) then if fList.isNotAssigned or fList.Selected.isNotAssigned then
exit; exit;
Clipboard.AsText := getLineAsList(fList.Selected); Clipboard.AsText := getLineAsList(fList.Selected);
@ -774,7 +774,7 @@ var
c: integer; c: integer;
i: integer; i: integer;
begin begin
if not assigned(fList) or not assigned(fList.Selected) then if fList.isNotAssigned or fList.Selected.isNotAssigned then
exit; exit;
c := getColumnIndex; c := getColumnIndex;

View File

@ -182,7 +182,7 @@ end;
procedure TSynD2SynRange.copyFrom(source: TSynD2SynRange); procedure TSynD2SynRange.copyFrom(source: TSynD2SynRange);
begin begin
if assigned(source) then if source.isAssigned then
begin begin
nestedCommentsCount := source.nestedCommentsCount; nestedCommentsCount := source.nestedCommentsCount;
namedRegionCount := source.namedRegionCount; namedRegionCount := source.namedRegionCount;
@ -476,7 +476,7 @@ begin
end; end;
end; end;
if not assigned(fCurrRange) then if fCurrRange.isNotAssigned then
fCurrRange := TSynD2SynRange.Create(nil); fCurrRange := TSynD2SynRange.Create(nil);
// line comments / region beg-end // line comments / region beg-end
@ -1184,9 +1184,8 @@ var
begin begin
inherited SetRange(value); inherited SetRange(value);
stored := TSynD2SynRange(CodeFoldRange.RangeType); stored := TSynD2SynRange(CodeFoldRange.RangeType);
if not assigned(fCurrRange) or not Assigned(stored) then if fCurrRange.isAssigned and stored.isAssigned then
exit; fCurrRange.copyFrom(stored);
fCurrRange.copyFrom(stored);
end; end;
function TSynD2Syn.GetRange: Pointer; function TSynD2Syn.GetRange: Pointer;
@ -1194,10 +1193,10 @@ var
stored: TSynD2SynRange; stored: TSynD2SynRange;
begin begin
stored := TSynD2SynRange(inherited GetRange); stored := TSynD2SynRange(inherited GetRange);
if (stored = nil) then if stored.isNotAssigned then
stored := TSynD2SynRange.Create(nil); stored := TSynD2SynRange.Create(nil);
stored.copyFrom(fCurrRange); stored.copyFrom(fCurrRange);
//
CodeFoldRange.RangeType := Pointer(stored); CodeFoldRange.RangeType := Pointer(stored);
Result := inherited GetRange; Result := inherited GetRange;
end; end;

View File

@ -147,7 +147,7 @@ begin
r.patch := 10; r.patch := 10;
fCanRemove := fVersion > r; fCanRemove := fVersion > r;
if fServer.isNotNil then if fServer.isAssigned then
begin begin
fServer.Execute; fServer.Execute;
while true do while true do
@ -183,7 +183,7 @@ end;
function TDcdWrapper.getIfLaunched: boolean; function TDcdWrapper.getIfLaunched: boolean;
begin begin
result := fServer.isNotNil; result := fServer.isAssigned;
end; end;
procedure TDcdWrapper.updateServerlistening; procedure TDcdWrapper.updateServerlistening;
@ -198,9 +198,9 @@ begin
saveToFile(getDocPath + optsname); saveToFile(getDocPath + optsname);
EntitiesConnector.removeObserver(self); EntitiesConnector.removeObserver(self);
fImportCache.Free; fImportCache.Free;
if fTempLines.isNotNil then if fTempLines.isAssigned then
fTempLines.Free; fTempLines.Free;
if fServer.isNotNil then if fServer.isAssigned then
begin begin
if not fServerWasRunning then if not fServerWasRunning then
begin begin
@ -227,7 +227,7 @@ var
fold: string; fold: string;
folds: TStringList; folds: TStringList;
begin begin
if not assigned(fProj) then if fProj.isNotAssigned then
exit; exit;
folds := TStringList.Create; folds := TStringList.Create;
@ -254,7 +254,7 @@ end;
procedure TDcdWrapper.projChanged(project: ICommonProject); procedure TDcdWrapper.projChanged(project: ICommonProject);
begin begin
if (fProj = nil) or (fProj <> project) then if fProj.isNotAssigned or (fProj <> project) then
exit; exit;
updateImportPathsFromProject(); updateImportPathsFromProject();
end; end;
@ -485,7 +485,7 @@ end;
procedure TDcdWrapper.getCallTip(out tips: string); procedure TDcdWrapper.getCallTip(out tips: string);
begin begin
if not fAvailable or not fServerListening or fDoc.isNil then if not fAvailable or not fServerListening or fDoc.isNotAssigned then
exit; exit;
terminateClient; terminateClient;
@ -536,7 +536,7 @@ var
item: string; item: string;
kindObj: TObject = nil; kindObj: TObject = nil;
begin begin
if not fAvailable or not fServerListening or fDoc.isNil then if not fAvailable or not fServerListening or fDoc.isNotAssigned then
exit; exit;
terminateClient; terminateClient;
@ -597,7 +597,7 @@ var
len: Integer; len: Integer;
str: string; str: string;
begin begin
if not fAvailable or not fServerListening or fDoc.isNil then if not fAvailable or not fServerListening or fDoc.isNotAssigned then
exit; exit;
i := fDoc.MouseBytePosition; i := fDoc.MouseBytePosition;
@ -645,7 +645,7 @@ var
i: Integer; i: Integer;
str, loc: string; str, loc: string;
begin begin
if not fAvailable or not fServerListening or fDoc.isNil then if not fAvailable or not fServerListening or fDoc.isNotAssigned then
exit; exit;
terminateClient; terminateClient;
@ -680,7 +680,7 @@ var
i: Integer; i: Integer;
str: string; str: string;
begin begin
if not fAvailable or not fServerListening or fDoc.isNil then if not fAvailable or not fServerListening or fDoc.isNotAssigned then
exit; exit;
terminateClient; terminateClient;
@ -709,7 +709,7 @@ end;
function DCDWrapper: TDcdWrapper; function DCDWrapper: TDcdWrapper;
begin begin
if fDcdWrapper.isNil then if fDcdWrapper.isNotAssigned then
fDcdWrapper := TDcdWrapper.create(nil); fDcdWrapper := TDcdWrapper.create(nil);
exit(fDcdWrapper); exit(fDcdWrapper);
end; end;

View File

@ -305,7 +305,7 @@ var
majv: byte = 0; majv: byte = 0;
minv: byte = 4; minv: byte = 4;
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
if not exeInSysPath('dfmt') then if not exeInSysPath('dfmt') then
exit; exit;
@ -351,7 +351,7 @@ end;
procedure TDfmtWidget.doCancel(sender: TObject); procedure TDfmtWidget.doCancel(sender: TObject);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
fDoc.Lines.Assign(fBackup); fDoc.Lines.Assign(fBackup);
end; end;

View File

@ -40,7 +40,7 @@ begin
editor.Gutter.LineNumberPart.Visible:=false; editor.Gutter.LineNumberPart.Visible:=false;
if ed.isNotNil then if ed.isAssigned then
editor.Font.Assign(ed.Font); editor.Font.Assign(ed.Font);
p := TProcess.Create(self); p := TProcess.Create(self);

View File

@ -409,7 +409,7 @@ procedure TDocOpts.getOpts(list: TStrings; base: TOptsGroup = nil);
var var
baseopt: TDocOpts; baseopt: TDocOpts;
begin begin
if base.isNil then if base.isNotAssigned then
begin begin
if fGenDoc then if fGenDoc then
list.Add('-D'); list.Add('-D');
@ -518,7 +518,7 @@ var
const const
DepStr : array[TDepHandling] of string = ('-d', '', '-de'); DepStr : array[TDepHandling] of string = ('-d', '', '-de');
begin begin
if base.isNil then if base.isNotAssigned then
begin begin
dep := DepStr[fDepHandling]; dep := DepStr[fDepHandling];
if dep.isNotEmpty then if dep.isNotEmpty then
@ -671,7 +671,7 @@ const
binKindStr: array[TProjectBinaryKind] of string = ('', '-lib', '-shared', '-c'); binKindStr: array[TProjectBinaryKind] of string = ('', '-lib', '-shared', '-c');
bchKindStr: array[TBoundCheckKind] of string = ('on', 'safeonly', 'off'); bchKindStr: array[TBoundCheckKind] of string = ('on', 'safeonly', 'off');
begin begin
if base.isNil then if base.isNotAssigned then
begin begin
str := binKindStr[fBinKind]; str := binKindStr[fBinKind];
if str.isNotEmpty then if str.isNotEmpty then
@ -910,7 +910,7 @@ var
idt: string; idt: string;
baseopt: TDebugOpts; baseopt: TDebugOpts;
begin begin
if base.isNil then if base.isNotAssigned then
begin begin
if fDebugConditions then if fDebugConditions then
list.Add('-debug'); list.Add('-debug');
@ -1100,7 +1100,7 @@ var
c: string; c: string;
begin begin
c := fSymStringExpander.expand('<CPR>') + DirectorySeparator; c := fSymStringExpander.expand('<CPR>') + DirectorySeparator;
if base.isNil then if base.isNotAssigned then
begin begin
exts := TStringList.Create; exts := TStringList.Create;
try try
@ -1371,7 +1371,7 @@ var
baseopt: TOtherOpts; baseopt: TOtherOpts;
rightList: TStringList; rightList: TStringList;
begin begin
if base.isNil then if base.isNotAssigned then
begin begin
for i := 0 to fCustom.Count-1 do for i := 0 to fCustom.Count-1 do
begin begin
@ -1417,14 +1417,14 @@ var
baseopt: TOtherOpts; baseopt: TOtherOpts;
lst: TStringList = nil; lst: TStringList = nil;
begin begin
if base.isNil then if base.isNotAssigned then
begin begin
case compiler of case compiler of
dmd: lst := fDmdOthers; dmd: lst := fDmdOthers;
ldc, ldmd: lst := fLdcOthers; ldc, ldmd: lst := fLdcOthers;
gdc, gdmd: lst := fGdcOthers; gdc, gdmd: lst := fGdcOthers;
end; end;
if lst.isNotNil then if lst.isAssigned then
for i := 0 to lst.Count-1 do for i := 0 to lst.Count-1 do
begin begin
str := lst[i]; str := lst[i];
@ -1454,7 +1454,7 @@ begin
else else
lst := fGdcOthers; lst := fGdcOthers;
end; end;
if lst.isNotNil then if lst.isAssigned then
for i := 0 to lst.Count-1 do for i := 0 to lst.Count-1 do
begin begin
str := lst[i]; str := lst[i];

View File

@ -291,7 +291,7 @@ begin
end; end;
finally finally
m.Free; m.Free;
if r.isNotNil then if r.isAssigned then
r.Free; r.Free;
end; end;
end; end;
@ -405,9 +405,9 @@ var
begin begin
if not assigned(Lfm) then if Lfm.isNotAssigned then
Lfm := getLifeTimeManager; Lfm := getLifeTimeManager;
if not assigned(Lfm) or not (Lfm.getLifetimeStatus = lfsLoaded) then if Lfm.isNotAssigned or not (Lfm.getLifetimeStatus = lfsLoaded) then
begin begin
if fDoneFirstUpdate and (not fNeedUpdate) then if fDoneFirstUpdate and (not fNeedUpdate) then
exit; exit;
@ -674,9 +674,8 @@ end;
constructor TDubProject.create(aOwner: TComponent); constructor TDubProject.create(aOwner: TComponent);
begin begin
inherited; inherited;
if not assigned(fCompilerSelector) then if fCompilerSelector.isNotAssigned then
fCompilerSelector := getCompilerSelector; fCompilerSelector := getCompilerSelector;
assert(assigned(fCompilerSelector));
fAsProjectItf := self as ICommonProject; fAsProjectItf := self as ICommonProject;
fSaveAsUtf8 := true; fSaveAsUtf8 := true;
fJSON := TJSONObject.Create(); fJSON := TJSONObject.Create();
@ -824,7 +823,7 @@ begin
try try
fJSON := parser.Parse as TJSONObject; fJSON := parser.Parse as TJSONObject;
except except
if assigned(fJSON) then if fJSON.isAssigned then
FreeAndNil(fJSON); FreeAndNil(fJSON);
fFilename := ''; fFilename := '';
end; end;
@ -839,13 +838,13 @@ begin
begin begin
FreeAndNil(fJSON); FreeAndNil(fJSON);
fJSON := sdl2json(fFilename); fJSON := sdl2json(fFilename);
if fJSON.isNil then if fJSON.isNotAssigned then
fFilename := '' fFilename := ''
else else
fIsSdl := true; fIsSdl := true;
end; end;
if not assigned(fJSON) then if fJSON.isNotAssigned then
begin begin
fHasLoaded := false; fHasLoaded := false;
fJson := TJSONObject.Create(['name','invalid json']) fJson := TJSONObject.Create(['name','invalid json'])
@ -1057,7 +1056,7 @@ end;
{$REGION ICommonProject: actions ---------------------------------------------} {$REGION ICommonProject: actions ---------------------------------------------}
procedure TDubProject.stopCompilation; procedure TDubProject.stopCompilation;
begin begin
if fDubProc.isNotNil and fDubProc.Running then if fDubProc.isAssigned and fDubProc.Running then
fDubProc.Terminate(1); fDubProc.Terminate(1);
end; end;
@ -1114,7 +1113,7 @@ var
e: string; e: string;
d: string; d: string;
begin begin
if fDubProc.isNotNil and fDubProc.Active then if fDubProc.isAssigned and fDubProc.Active then
begin begin
fMsgs.message('the project is already being processed by DUB', fAsProjectItf, amcProj, amkWarn); fMsgs.message('the project is already being processed by DUB', fAsProjectItf, amcProj, amkWarn);
exit; exit;
@ -1233,7 +1232,7 @@ var
d: TJSONData; d: TJSONData;
begin begin
result := nil; result := nil;
if value.isBlank or fJSON.isNil or not fJSON.findArray('subPackages', a) then if value.isBlank or fJSON.isNotAssigned or not fJSON.findArray('subPackages', a) then
exit; exit;
for i := 0 to a.Count-1 do for i := 0 to a.Count-1 do
begin begin
@ -1263,7 +1262,7 @@ procedure TDubProject.updatePackageNameFromJson;
var var
value: TJSONData; value: TJSONData;
begin begin
if fJSON.isNil then if fJSON.isNotAssigned then
exit; exit;
if not fJSON.findAny('name', value) then if not fJSON.findAny('name', value) then
fPackageName := '' fPackageName := ''
@ -1282,7 +1281,7 @@ var
begin begin
fBuildTypes.Clear; fBuildTypes.Clear;
fConfigs.Clear; fConfigs.Clear;
if fJSON.isNil then if fJSON.isNotAssigned then
exit; exit;
// the CE interface for dub doesn't make the difference between build type // the CE interface for dub doesn't make the difference between build type
//and config, instead each possible combination type + build is generated. //and config, instead each possible combination type + build is generated.
@ -1366,7 +1365,7 @@ var
//glb: TRegExpr; //glb: TRegExpr;
begin begin
fSrcs.Clear; fSrcs.Clear;
if not assigned(fJSON) then if fJSON.isNotAssigned then
exit; exit;
lst := TStringList.Create; lst := TStringList.Create;
try try
@ -1396,7 +1395,7 @@ begin
for i := 0 to arr.Count-1 do for i := 0 to arr.Count-1 do
tryAddRelOrAbsFile(arr.Strings[i]); tryAddRelOrAbsFile(arr.Strings[i]);
conf := getCurrentCustomConfig; conf := getCurrentCustomConfig;
if conf.isNotNil then if conf.isAssigned then
begin begin
if conf.findAny('mainSourceFile', item) then if conf.findAny('mainSourceFile', item) then
begin begin
@ -1426,7 +1425,7 @@ begin
{lst.Clear; {lst.Clear;
getExclusion(fJSON); getExclusion(fJSON);
conf := getCurrentCustomConfig; conf := getCurrentCustomConfig;
if conf.isNotNil then if conf.isAssigned then
getExclusion(conf); getExclusion(conf);
if lst.Count > 0 then if lst.Count > 0 then
begin begin
@ -1459,7 +1458,7 @@ var
tt: TJSONData; tt: TJSONData;
begin begin
result := true; result := true;
if value.Find('mainSourceFile').isNotNil then if value.Find('mainSourceFile').isAssigned then
fBinKind := executable fBinKind := executable
else if value.findAny('targetType', tt) then else if value.findAny('targetType', tt) then
begin begin
@ -1482,11 +1481,11 @@ var
s: string; s: string;
begin begin
fBinKind := executable; fBinKind := executable;
if fJSON.isNil then if fJSON.isNotAssigned then
exit; exit;
a := findTargetKindInd(fJSON); a := findTargetKindInd(fJSON);
c := getCurrentCustomConfig; c := getCurrentCustomConfig;
if c.isNotNil then if c.isAssigned then
b := findTargetKindInd(c); b := findTargetKindInd(c);
if a or b then if a or b then
exit; exit;
@ -1693,7 +1692,7 @@ procedure TDubProject.updateImportPathsFromJson;
var var
conf: TJSONObject; conf: TJSONObject;
begin begin
if fJSON.isNil then if fJSON.isNotAssigned then
exit; exit;
addFrom(fJSON); addFrom(fJSON);
@ -1712,7 +1711,7 @@ begin
{$ENDIF} {$ENDIF}
conf := getCurrentCustomConfig; conf := getCurrentCustomConfig;
if conf.isNotNil then if conf.isAssigned then
begin begin
addFrom(conf); addFrom(conf);
addDepsFrom(conf); addDepsFrom(conf);
@ -1747,14 +1746,14 @@ var
end; end;
begin begin
fOutputFileName := ''; fOutputFileName := '';
if fJSON.isNil or not fJSON.findAny('name', item) then if fJSON.isNotAssigned or not fJSON.findAny('name', item) then
exit; exit;
namePart := item.AsString; namePart := item.AsString;
pathPart := fBasePath; pathPart := fBasePath;
setFrom(fJSON); setFrom(fJSON);
conf := getCurrentCustomConfig; conf := getCurrentCustomConfig;
if conf.isNotNil then if conf.isAssigned then
setFrom(conf); setFrom(conf);
pathPart := TrimRightSet(pathPart, ['/','\']); pathPart := TrimRightSet(pathPart, ['/','\']);
{$IFNDEF WINDOWS} {$IFNDEF WINDOWS}
@ -1841,7 +1840,7 @@ begin
try try
jsn := prs.Parse; jsn := prs.Parse;
try try
if jsn.isNotNil then if jsn.isAssigned then
result := TJSONObject(jsn.Clone) result := TJSONObject(jsn.Clone)
else else
result := nil; result := nil;
@ -1879,9 +1878,9 @@ begin
try try
try try
maybe.loadFromFile(filename); maybe.loadFromFile(filename);
if maybe.json.isNil or maybe.filename.isEmpty then if maybe.json.isNotAssigned or maybe.filename.isEmpty then
result := false result := false
else if maybe.json.Find('name').isNil then else if maybe.json.Find('name').isNotAssigned then
result := false; result := false;
except except
result := false; result := false;

View File

@ -138,8 +138,8 @@ inherited DubProjectEditorWidget: TDubProjectEditorWidget
end end
end end
inherited contextMenu: TPopupMenu inherited contextMenu: TPopupMenu
left = 248 Left = 248
top = 8 Top = 8
object MenuItem1: TMenuItem[0] object MenuItem1: TMenuItem[0]
Caption = 'Refresh' Caption = 'Refresh'
OnClick = MenuItem1Click OnClick = MenuItem1Click

View File

@ -195,7 +195,7 @@ end;
procedure TDubProjectPropAddPanel.selTypeChanged(sender: TObject); procedure TDubProjectPropAddPanel.selTypeChanged(sender: TObject);
begin begin
if fJson.isNotNil then if fJson.isAssigned then
fEdName.Enabled := fJson.JSONType <> TJSONtype.jtArray; fEdName.Enabled := fJson.JSONType <> TJSONtype.jtArray;
end; end;
@ -308,7 +308,7 @@ end;
procedure TDubProjectEditorWidget.projChanged(project: ICommonProject); procedure TDubProjectEditorWidget.projChanged(project: ICommonProject);
begin begin
if fProj.isNil then if fProj.isNotAssigned then
exit; exit;
if project.getProject <> fProj then if project.getProject <> fProj then
exit; exit;
@ -320,7 +320,7 @@ end;
procedure TDubProjectEditorWidget.projClosing(project: ICommonProject); procedure TDubProjectEditorWidget.projClosing(project: ICommonProject);
begin begin
if fProj.isNil then if fProj.isNotAssigned then
exit; exit;
if project.getProject <> fProj then if project.getProject <> fProj then
exit; exit;
@ -374,13 +374,13 @@ begin
btnDelProp.Enabled := false; btnDelProp.Enabled := false;
btnAddProp.Enabled := false; btnAddProp.Enabled := false;
btnCloneObject.Enabled := false; btnCloneObject.Enabled := false;
if propTree.Selected.isNil then if propTree.Selected.isNotAssigned then
exit; exit;
fSelectedNode := propTree.Selected; fSelectedNode := propTree.Selected;
tpe := TJSONData(fSelectedNode.Data).JSONType; tpe := TJSONData(fSelectedNode.Data).JSONType;
btnDelProp.Enabled := (fSelectedNode.Level > 0) and (fSelectedNode.Text <> 'name') btnDelProp.Enabled := (fSelectedNode.Level > 0) and (fSelectedNode.Text <> 'name')
and fSelectedNode.data.isNotNil; and fSelectedNode.data.isAssigned;
btnAddProp.Enabled := tpe in [jtObject, jtArray]; btnAddProp.Enabled := tpe in [jtObject, jtArray];
btnCloneObject.Enabled := (tpe = jtObject) and (fSelectedNode.Level > 0); btnCloneObject.Enabled := (tpe = jtObject) and (fSelectedNode.Level > 0);
updateValueEditor; updateValueEditor;
@ -393,7 +393,7 @@ end;
procedure TDubProjectEditorWidget.btnAcceptPropClick(Sender: TObject); procedure TDubProjectEditorWidget.btnAcceptPropClick(Sender: TObject);
begin begin
if fSelectedNode.isNil then if fSelectedNode.isNotAssigned then
exit; exit;
setJsonValueFromEditor; setJsonValueFromEditor;
propTree.FullExpand; propTree.FullExpand;
@ -403,7 +403,7 @@ procedure TDubProjectEditorWidget.btnAddPropClick(Sender: TObject);
var var
pnl: TDubProjectPropAddPanel; pnl: TDubProjectPropAddPanel;
begin begin
if fSelectedNode.isNil then if fSelectedNode.isNotAssigned then
exit; exit;
pnl := TDubProjectPropAddPanel.construct(@addProp, TJSONData(fSelectedNode.Data)); pnl := TDubProjectPropAddPanel.construct(@addProp, TJSONData(fSelectedNode.Data));
pnl.ShowModal; pnl.ShowModal;
@ -420,7 +420,7 @@ var
obj: TJSONObject; obj: TJSONObject;
nod: TTreeNode; nod: TTreeNode;
begin begin
if fSelectedNode.isNil then if fSelectedNode.isNotAssigned then
exit; exit;
dat := TJSONData(fSelectedNode.Data); dat := TJSONData(fSelectedNode.Data);
if dat.JSONType = jtObject then if dat.JSONType = jtObject then
@ -454,9 +454,9 @@ begin
fProj.endModification; fProj.endModification;
propTree.FullExpand; propTree.FullExpand;
nod := propTree.Items.FindNodeWithText('<value>'); nod := propTree.Items.FindNodeWithText('<value>');
if nod.isNil then if nod.isNotAssigned then
nod := propTree.Items.FindNodeWithText(propName); nod := propTree.Items.FindNodeWithText(propName);
if nod.isNotNil then if nod.isAssigned then
begin begin
propTree.Selected := nod; propTree.Selected := nod;
propTree.MakeSelectionVisible; propTree.MakeSelectionVisible;
@ -468,15 +468,15 @@ var
prt: TJSONData; prt: TJSONData;
sel: TTreeNode; sel: TTreeNode;
begin begin
if fSelectedNode.isNil then if fSelectedNode.isNotAssigned then
exit; exit;
if fSelectedNode.Level.equals(0) then if fSelectedNode.Level.equals(0) then
exit; exit;
if (fSelectedNode.Text = 'name') and fSelectedNode.Level.equals(0) then if (fSelectedNode.Text = 'name') and fSelectedNode.Level.equals(0) then
exit; exit;
if fSelectedNode.Data.isNil then if fSelectedNode.Data.isNotAssigned then
exit; exit;
if fSelectedNode.Parent.Data.isNil then if fSelectedNode.Parent.Data.isNotAssigned then
exit; exit;
fProj.beginModification; fProj.beginModification;
@ -486,11 +486,11 @@ begin
else if prt.JSONType = jtArray then else if prt.JSONType = jtArray then
TJSONArray(prt).Delete(fSelectedNode.Index); TJSONArray(prt).Delete(fSelectedNode.Index);
sel := fSelectedNode.GetPrevSibling; sel := fSelectedNode.GetPrevSibling;
if sel.isNil then if sel.isNotAssigned then
sel := fSelectedNode.GetNextSibling; sel := fSelectedNode.GetNextSibling;
if sel.isNil then if sel.isNotAssigned then
sel := fSelectedNode.Parent; sel := fSelectedNode.Parent;
if sel.isNotNil then if sel.isAssigned then
sel.Selected:=true; sel.Selected:=true;
fProj.endModification; fProj.endModification;
@ -501,16 +501,16 @@ procedure TDubProjectEditorWidget.btnRefreshClick(Sender: TObject);
var var
f: string; f: string;
begin begin
if assigned(fProj) then if fProj.isNotAssigned then
begin exit;
f := fProj.filename;
if not f.fileExists then f := fProj.filename;
exit; if not f.fileExists then
if fProj.modified and exit;
(dlgYesNo('The project seems to be modified, save before reloading') = mrYes) then if fProj.modified and
fProj.saveToFile(f); (dlgYesNo('The project seems to be modified, save before reloading') = mrYes) then
fProj.loadFromFile(f); fProj.saveToFile(f);
end; fProj.loadFromFile(f);
end; end;
procedure TDubProjectEditorWidget.btnCloneObjectClick(Sender: TObject); procedure TDubProjectEditorWidget.btnCloneObjectClick(Sender: TObject);
@ -523,8 +523,8 @@ var
inm: string; inm: string;
idx: integer = 0; idx: integer = 0;
begin begin
if fSelectedNode.isNil or fSelectedNode.Data.isNil or fProj.isNil or if fSelectedNode.isNotAssigned or fSelectedNode.Data.isNotAssigned or fProj.isNotAssigned or
fSelectedNode.Parent.Data.isNil then fSelectedNode.Parent.Data.isNotAssigned then
exit; exit;
dat := TJSONData(fSelectedNode.Data); dat := TJSONData(fSelectedNode.Data);
@ -561,7 +561,7 @@ end;
procedure TDubProjectEditorWidget.MenuItem1Click(Sender: TObject); procedure TDubProjectEditorWidget.MenuItem1Click(Sender: TObject);
begin begin
if fProj.isNil or not fProj.filename.fileExists then if fProj.isNotAssigned or not fProj.filename.fileExists then
exit; exit;
fProj.loadFromFile(fProj.filename); fProj.loadFromFile(fProj.filename);
end; end;
@ -574,7 +574,7 @@ var
vInt64: int64; vInt64: int64;
vBool: boolean; vBool: boolean;
begin begin
if fSelectedNode.isNil or fSelectedNode.Data.isNil or fProj.isNil then if fSelectedNode.isNotAssigned or fSelectedNode.Data.isNotAssigned or fProj.isNotAssigned then
exit; exit;
fProj.beginModification; fProj.beginModification;
@ -606,7 +606,7 @@ var
dat: TJSONData; dat: TJSONData;
begin begin
edProp.Clear; edProp.Clear;
if fSelectedNode.isNil or fSelectedNode.Data.isNil then if fSelectedNode.isNotAssigned or fSelectedNode.Data.isNotAssigned then
exit; exit;
dat := TJSONData(fSelectedNode.Data); dat := TJSONData(fSelectedNode.Data);
@ -676,12 +676,12 @@ var
rcl: TTreeNode; rcl: TTreeNode;
begin begin
if propTree.Selected.isNotNil then if propTree.Selected.isAssigned then
str := propTree.Selected.GetTextPath; str := propTree.Selected.GetTextPath;
propTree.Items.Clear; propTree.Items.Clear;
edProp.Clear; edProp.Clear;
if fProj.isNil or fProj.json.isNil then if fProj.isNotAssigned or fProj.json.isNotAssigned then
exit; exit;
propTree.BeginUpdate; propTree.BeginUpdate;
@ -689,7 +689,7 @@ begin
if str.isNotEmpty then if str.isNotEmpty then
begin begin
rcl := propTree.Items.FindNodeWithTextPath(str); rcl := propTree.Items.FindNodeWithTextPath(str);
if rcl.isNotNil then if rcl.isAssigned then
begin begin
rcl.Selected := true; rcl.Selected := true;
rcl.MakeVisible; rcl.MakeVisible;

View File

@ -54,19 +54,19 @@ inherited EditorWidget: TEditorWidget
end end
end end
inherited contextMenu: TPopupMenu inherited contextMenu: TPopupMenu
left = 24 Left = 24
top = 16 Top = 16
end end
object macRecorder: TSynMacroRecorder[2] object macRecorder: TSynMacroRecorder[2]
RecordShortCut = 0 RecordShortCut = 0
PlaybackShortCut = 0 PlaybackShortCut = 0
left = 80 Left = 80
top = 16 Top = 16
end end
object mnuEditor: TPopupMenu[3] object mnuEditor: TPopupMenu[3]
OnPopup = mnuEditorPopup OnPopup = mnuEditorPopup
left = 152 Left = 152
top = 16 Top = 16
object mnuedCopy: TMenuItem object mnuedCopy: TMenuItem
Caption = 'Copy' Caption = 'Copy'
OnClick = mnuedCopyClick OnClick = mnuedCopyClick

View File

@ -453,11 +453,11 @@ end;
function TEditorWidget.closeQuery: boolean; function TEditorWidget.closeQuery: boolean;
begin begin
result := inherited and (Parent.isNil or result := inherited and (Parent.isNotAssigned or
// already set as dockable but not docked // already set as dockable but not docked
// necessary because it has te closed programmatically during loading sequence // necessary because it has te closed programmatically during loading sequence
// otherwise the layout reloading has no effect. // otherwise the layout reloading has no effect.
Parent is TAnchorDockHostSite and Parent.Parent.isNil); Parent is TAnchorDockHostSite and Parent.Parent.isNotAssigned);
end; end;
procedure TEditorWidget.setToolBarFlat(value: boolean); procedure TEditorWidget.setToolBarFlat(value: boolean);
@ -503,7 +503,7 @@ end;
procedure TEditorWidget.docClosing(document: TDexedMemo); procedure TEditorWidget.docClosing(document: TDexedMemo);
begin begin
if document.isNil then if document.isNotAssigned then
exit; exit;
document.Parent := nil; document.Parent := nil;
if document = fDoc then if document = fDoc then
@ -514,7 +514,7 @@ end;
procedure TEditorWidget.docFocused(document: TDexedMemo); procedure TEditorWidget.docFocused(document: TDexedMemo);
begin begin
if fDoc.isNotNil and pageControl.currentPage.isNotNil and if fDoc.isAssigned and pageControl.currentPage.isAssigned and
(pageControl.currentPage.Caption = newdocPageCaption) then (pageControl.currentPage.Caption = newdocPageCaption) then
updatePageCaption(pageControl.currentPage); updatePageCaption(pageControl.currentPage);
if document = fDoc then if document = fDoc then
@ -598,14 +598,14 @@ var
begin begin
showWidget; showWidget;
doc := findDocument(fname); doc := findDocument(fname);
if doc.isNotNil then if doc.isAssigned then
begin begin
PageControl.currentPage := TDexedPage(doc.Parent); PageControl.currentPage := TDexedPage(doc.Parent);
exit; exit;
end; end;
doc := TDexedMemo.Create(nil); doc := TDexedMemo.Create(nil);
fDoc.loadFromFile(TrimFilename(fname)); fDoc.loadFromFile(TrimFilename(fname));
if assigned(fProj) and (fProj.filename = fDoc.fileName) then if fProj.isAssigned and (fProj.filename = fDoc.fileName) then
begin begin
if fProj.getFormat = pfDEXED then if fProj.getFormat = pfDEXED then
fDoc.Highlighter := LfmSyn fDoc.Highlighter := LfmSyn
@ -619,7 +619,7 @@ var
doc: TDexedMemo; doc: TDexedMemo;
begin begin
doc := getDocument(index); doc := getDocument(index);
if doc.isNil then if doc.isNotAssigned then
exit(false); exit(false);
if promptOnChanged and (doc.modified or (doc.fileName = doc.tempFilename)) and if promptOnChanged and (doc.modified or (doc.fileName = doc.tempFilename)) and
(dlgFileChangeClose(doc.fileName, UnsavedFile) = mrCancel) then (dlgFileChangeClose(doc.fileName, UnsavedFile) = mrCancel) then
@ -636,7 +636,7 @@ var
page: TDexedPage = nil; page: TDexedPage = nil;
begin begin
page := TDexedPage(doc.Parent); page := TDexedPage(doc.Parent);
if page.isNil then if page.isNotAssigned then
exit(false); exit(false);
exit(closeDocument(page.index, promptOnChanged)); exit(closeDocument(page.index, promptOnChanged));
end; end;
@ -668,7 +668,7 @@ end;
procedure TEditorWidget.focusedEditorChanged; procedure TEditorWidget.focusedEditorChanged;
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
macRecorder.Editor:= fDoc; macRecorder.Editor:= fDoc;
fDoc.PopupMenu := mnuEditor; fDoc.PopupMenu := mnuEditor;
@ -684,7 +684,7 @@ end;
procedure TEditorWidget.PageControlChanged(Sender: TObject); procedure TEditorWidget.PageControlChanged(Sender: TObject);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
fDoc.hideCallTips; fDoc.hideCallTips;
fDoc.hideDDocs; fDoc.hideDDocs;
@ -692,7 +692,7 @@ end;
procedure TEditorWidget.PageControlChanging(Sender: TObject; var AllowChange: Boolean); procedure TEditorWidget.PageControlChanging(Sender: TObject; var AllowChange: Boolean);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
fDoc.hideCallTips; fDoc.hideCallTips;
fDoc.hideDDocs; fDoc.hideDDocs;
@ -780,7 +780,7 @@ begin
if (fname <> fDoc.fileName) and fname.fileExists then if (fname <> fDoc.fileName) and fname.fileExists then
begin begin
page := pageControl.splitPage; page := pageControl.splitPage;
if assigned(page) then if page.isAssigned then
begin begin
fDoc := TDexedMemo(page.Controls[0]); fDoc := TDexedMemo(page.Controls[0]);
if fDoc.fileName <> fname then if fDoc.fileName <> fname then
@ -846,15 +846,15 @@ var
dc1: TDexedMemo = nil; dc1: TDexedMemo = nil;
dc2: TDexedMemo = nil; dc2: TDexedMemo = nil;
begin begin
if page.isNil or page.ControlCount.equals(0) then if page.isNotAssigned or page.ControlCount.equals(0) then
exit; exit;
if pageControl.splitPage.isNotNil and if pageControl.splitPage.isAssigned and
(page <> pageControl.splitPage) then (page <> pageControl.splitPage) then
begin begin
txt := ''; txt := '';
dc1 := TDexedMemo(page.Controls[0]); dc1 := TDexedMemo(page.Controls[0]);
dc2 := TDexedMemo(pageControl.splitPage.Controls[0]); dc2 := TDexedMemo(pageControl.splitPage.Controls[0]);
if dc1.isNotNil and dc2.isNotNil then if dc1.isAssigned and dc2.isAssigned then
txt := dc1.pageCaption(fDetectModuleName) + ' - ' + txt := dc1.pageCaption(fDetectModuleName) + ' - ' +
dc2.pageCaption(fDetectModuleName); dc2.pageCaption(fDetectModuleName);
end end
@ -878,7 +878,7 @@ end;
procedure TEditorWidget.updateImperative; procedure TEditorWidget.updateImperative;
begin begin
updateStatusBar; updateStatusBar;
if fDoc.isNotNil then if fDoc.isAssigned then
updatePageCaption(pageControl.currentPage); updatePageCaption(pageControl.currentPage);
end; end;
@ -889,7 +889,7 @@ begin
updateStatusBar; updateStatusBar;
if not fKeyChanged then if not fKeyChanged then
exit; exit;
if pageControl.currentPage.isNotNil then if pageControl.currentPage.isAssigned then
updatePageCaption(pageControl.currentPage); updatePageCaption(pageControl.currentPage);
end; end;
{$ENDREGION} {$ENDREGION}
@ -897,13 +897,13 @@ end;
{$REGION Editor context menu ---------------------------------------------------} {$REGION Editor context menu ---------------------------------------------------}
procedure TEditorWidget.mnuedCopyClick(Sender: TObject); procedure TEditorWidget.mnuedCopyClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.ExecuteCommand(ecCopy, '', nil); fDoc.ExecuteCommand(ecCopy, '', nil);
end; end;
procedure TEditorWidget.mnuedCallTipClick(Sender: TObject); procedure TEditorWidget.mnuedCallTipClick(Sender: TObject);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
mnuEditor.Close; mnuEditor.Close;
fDoc.hideDDocs; fDoc.hideDDocs;
@ -914,25 +914,25 @@ end;
procedure TEditorWidget.mnuedCommClick(Sender: TObject); procedure TEditorWidget.mnuedCommClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.CommandProcessor(ecCommentSelection, '', nil); fDoc.CommandProcessor(ecCommentSelection, '', nil);
end; end;
procedure TEditorWidget.mnuedPrevClick(Sender: TObject); procedure TEditorWidget.mnuedPrevClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.CommandProcessor(ecPreviousLocation, '', nil); fDoc.CommandProcessor(ecPreviousLocation, '', nil);
end; end;
procedure TEditorWidget.mnuedNextClick(Sender: TObject); procedure TEditorWidget.mnuedNextClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.CommandProcessor(ecNextLocation, '', nil); fDoc.CommandProcessor(ecNextLocation, '', nil);
end; end;
procedure TEditorWidget.mnuedInvAllNoneClick(Sender: TObject); procedure TEditorWidget.mnuedInvAllNoneClick(Sender: TObject);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
if not fDoc.IsDSource and not fDoc.alwaysAdvancedFeatures then if not fDoc.IsDSource and not fDoc.alwaysAdvancedFeatures then
exit; exit;
@ -941,7 +941,7 @@ end;
procedure TEditorWidget.MenuItem5Click(Sender: TObject); procedure TEditorWidget.MenuItem5Click(Sender: TObject);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
if not fDoc.IsDSource and not fDoc.alwaysAdvancedFeatures then if not fDoc.IsDSource and not fDoc.alwaysAdvancedFeatures then
exit; exit;
@ -961,37 +961,37 @@ end;
procedure TEditorWidget.mnuedUpcaseClick(Sender: TObject); procedure TEditorWidget.mnuedUpcaseClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.CommandProcessor(ecUpperCaseWordOrSel, #0, nil); fDoc.CommandProcessor(ecUpperCaseWordOrSel, #0, nil);
end; end;
procedure TEditorWidget.mnuedLowcaseClick(Sender: TObject); procedure TEditorWidget.mnuedLowcaseClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.CommandProcessor(ecLowerCaseWordOrSel, #0, nil); fDoc.CommandProcessor(ecLowerCaseWordOrSel, #0, nil);
end; end;
procedure TEditorWidget.mnuedPrevWarnClick(Sender: TObject); procedure TEditorWidget.mnuedPrevWarnClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.previousWarning; fDoc.previousWarning;
end; end;
procedure TEditorWidget.mnuEdSetSpacesClick(Sender: TObject); procedure TEditorWidget.mnuEdSetSpacesClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.Options := fDoc.Options + [eoTabsToSpaces]; fDoc.Options := fDoc.Options + [eoTabsToSpaces];
end; end;
procedure TEditorWidget.mnuEdSetTabsClick(Sender: TObject); procedure TEditorWidget.mnuEdSetTabsClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.Options := fDoc.Options - [eoTabsToSpaces]; fDoc.Options := fDoc.Options - [eoTabsToSpaces];
end; end;
procedure TEditorWidget.mnuEdShowSpecClick(Sender: TObject); procedure TEditorWidget.mnuEdShowSpecClick(Sender: TObject);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
if mnuEdShowSpec.Checked then if mnuEdShowSpec.Checked then
fDoc.Options := fDoc.Options + [eoShowSpecialChars] fDoc.Options := fDoc.Options + [eoShowSpecialChars]
@ -1001,13 +1001,13 @@ end;
procedure TEditorWidget.mnuedSortLinesClick(Sender: TObject); procedure TEditorWidget.mnuedSortLinesClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.CommandProcessor(ecSortLines, #0, nil); fDoc.CommandProcessor(ecSortLines, #0, nil);
end; end;
procedure TEditorWidget.mnuEdTabWidth2Click(Sender: TObject); procedure TEditorWidget.mnuEdTabWidth2Click(Sender: TObject);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
fDoc.TabWidth:= TMenuItem(sender).Tag; fDoc.TabWidth:= TMenuItem(sender).Tag;
@ -1025,19 +1025,19 @@ end;
procedure TEditorWidget.mnuedNextCareaClick(Sender: TObject); procedure TEditorWidget.mnuedNextCareaClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.nextChangedArea; fDoc.nextChangedArea;
end; end;
procedure TEditorWidget.mnuedPrevProtGrpClick(Sender: TObject); procedure TEditorWidget.mnuedPrevProtGrpClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.previousProtectionGroup; fDoc.previousProtectionGroup;
end; end;
procedure TEditorWidget.mnuedDdocTmpClick(Sender: TObject); procedure TEditorWidget.mnuedDdocTmpClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.insertDdocTemplate; fDoc.insertDdocTemplate;
end; end;
@ -1074,31 +1074,31 @@ end;
procedure TEditorWidget.FormShow(Sender: TObject); procedure TEditorWidget.FormShow(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.Visible:=true; fDoc.Visible:=true;
end; end;
procedure TEditorWidget.mnuedGotolineClick(Sender: TObject); procedure TEditorWidget.mnuedGotolineClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.gotoLinePrompt; fDoc.gotoLinePrompt;
end; end;
procedure TEditorWidget.mnuedNextWarnClick(Sender: TObject); procedure TEditorWidget.mnuedNextWarnClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.nextWarning; fDoc.nextWarning;
end; end;
procedure TEditorWidget.mnuedNextProtGrpClick(Sender: TObject); procedure TEditorWidget.mnuedNextProtGrpClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.nextProtectionGroup; fDoc.nextProtectionGroup;
end; end;
procedure TEditorWidget.mnuedPrevCareaClick(Sender: TObject); procedure TEditorWidget.mnuedPrevCareaClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.previousChangedArea; fDoc.previousChangedArea;
end; end;
@ -1106,7 +1106,7 @@ procedure TEditorWidget.MenuItem8Click(Sender: TObject);
var var
str: TStringList; str: TStringList;
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
if not fDoc.IsDSource and not fDoc.alwaysAdvancedFeatures then if not fDoc.IsDSource and not fDoc.alwaysAdvancedFeatures then
exit; exit;
@ -1129,25 +1129,25 @@ end;
procedure TEditorWidget.MenuItem6Click(Sender: TObject); procedure TEditorWidget.MenuItem6Click(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.CommandProcessor(ecCommentIdentifier, '', nil); fDoc.CommandProcessor(ecCommentIdentifier, '', nil);
end; end;
procedure TEditorWidget.mnuedRenameClick(Sender: TObject); procedure TEditorWidget.mnuedRenameClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.CommandProcessor(ecRenameIdentifier, '', nil); fDoc.CommandProcessor(ecRenameIdentifier, '', nil);
end; end;
procedure TEditorWidget.mnuedCutClick(Sender: TObject); procedure TEditorWidget.mnuedCutClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.ExecuteCommand(ecCut, '', nil); fDoc.ExecuteCommand(ecCut, '', nil);
end; end;
procedure TEditorWidget.mnuedDdocClick(Sender: TObject); procedure TEditorWidget.mnuedDdocClick(Sender: TObject);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
mnuEditor.Close; mnuEditor.Close;
fDoc.hideCallTips; fDoc.hideCallTips;
@ -1158,31 +1158,31 @@ end;
procedure TEditorWidget.mnuedPasteClick(Sender: TObject); procedure TEditorWidget.mnuedPasteClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.ExecuteCommand(ecPaste, '', nil); fDoc.ExecuteCommand(ecPaste, '', nil);
end; end;
procedure TEditorWidget.mnuedUndoClick(Sender: TObject); procedure TEditorWidget.mnuedUndoClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.ExecuteCommand(ecUndo, '', nil); fDoc.ExecuteCommand(ecUndo, '', nil);
end; end;
procedure TEditorWidget.mnuedRedoClick(Sender: TObject); procedure TEditorWidget.mnuedRedoClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.ExecuteCommand(ecRedo, '', nil); fDoc.ExecuteCommand(ecRedo, '', nil);
end; end;
procedure TEditorWidget.mnuedJum2DeclClick(Sender: TObject); procedure TEditorWidget.mnuedJum2DeclClick(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
getSymbolLoc; getSymbolLoc;
end; end;
procedure TEditorWidget.mnuEditorPopup(Sender: TObject); procedure TEditorWidget.mnuEditorPopup(Sender: TObject);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
mnuedCut.Enabled:=fDoc.SelAvail; mnuedCut.Enabled:=fDoc.SelAvail;

View File

@ -472,12 +472,12 @@ inherited GdbWidget: TGdbWidget
ResizeAnchor = akTop ResizeAnchor = akTop
end end
inherited contextMenu: TPopupMenu[2] inherited contextMenu: TPopupMenu[2]
left = 56 Left = 56
top = 64 Top = 64
end end
object mnuProjRunnable: TPopupMenu[3] object mnuProjRunnable: TPopupMenu[3]
left = 56 Left = 56
top = 112 Top = 112
object mnuSelProj: TMenuItem object mnuSelProj: TMenuItem
AutoCheck = True AutoCheck = True
Caption = 'Debug project' Caption = 'Debug project'
@ -496,8 +496,8 @@ inherited GdbWidget: TGdbWidget
end end
end end
object mnuWatch: TPopupMenu[4] object mnuWatch: TPopupMenu[4]
left = 56 Left = 56
top = 160 Top = 160
object mnuReadW: TMenuItem object mnuReadW: TMenuItem
AutoCheck = True AutoCheck = True
Caption = 'On read' Caption = 'On read'
@ -516,24 +516,24 @@ inherited GdbWidget: TGdbWidget
end end
end end
object mnuNext: TPopupMenu[5] object mnuNext: TPopupMenu[5]
left = 152 Left = 152
top = 112 Top = 112
object mnuNextMachine: TMenuItem object mnuNextMachine: TMenuItem
AutoCheck = True AutoCheck = True
Caption = 'machine instruction' Caption = 'machine instruction'
end end
end end
object mnuStep: TPopupMenu[6] object mnuStep: TPopupMenu[6]
left = 152 Left = 152
top = 160 Top = 160
object mnuStepMachine: TMenuItem object mnuStepMachine: TMenuItem
AutoCheck = True AutoCheck = True
Caption = 'machine instruction' Caption = 'machine instruction'
end end
end end
object mnuEval: TPopupMenu[7] object mnuEval: TPopupMenu[7]
left = 216 Left = 216
top = 168 Top = 168
object mnuEvalSelected: TMenuItem object mnuEvalSelected: TMenuItem
AutoCheck = True AutoCheck = True
Caption = 'Evaluate selected variable' Caption = 'Evaluate selected variable'

View File

@ -354,7 +354,7 @@ type
TDebugOptions = class(TDebugOptionsBase, IEditableOptions) TDebugOptions = class(TDebugOptionsBase, IEditableOptions)
private private
FonChangesApplied: TNotifyEvent; fOnChangesApplied: TNotifyEvent;
fBackup: TDebugOptionsBase; fBackup: TDebugOptionsBase;
function optionedWantCategory(): string; function optionedWantCategory(): string;
function optionedWantEditorKind: TOptionEditorKind; function optionedWantEditorKind: TOptionEditorKind;
@ -364,7 +364,7 @@ type
public public
constructor create(aOwner: TComponent); override; constructor create(aOwner: TComponent); override;
destructor destroy; override; destructor destroy; override;
property onChangesApplied: TNotifyEvent read FonChangesApplied write FonChangesApplied; property onChangesApplied: TNotifyEvent read fOnChangesApplied write fOnChangesApplied;
end; end;
TGdbState = (gsNone, gsRunning, gsPaused); TGdbState = (gsNone, gsRunning, gsPaused);
@ -835,8 +835,8 @@ begin
oeeAccept: oeeAccept:
begin begin
fBackup.assign(self); fBackup.assign(self);
if assigned(FonChangesApplied) then if assigned(fOnChangesApplied) then
FonChangesApplied(self); fOnChangesApplied(self);
end; end;
end; end;
end; end;
@ -1333,10 +1333,10 @@ var
bmp: TBitmap; bmp: TBitmap;
begin begin
mnu := getMainMenu; mnu := getMainMenu;
if not assigned(mnu) then if mnu.isNotAssigned then
exit; exit;
if fMenu.isNil then if fMenu.isNotAssigned then
begin begin
fMenu := mnu.mnuAdd; fMenu := mnu.mnuAdd;
fMenu.Caption:='Debugger'; fMenu.Caption:='Debugger';
@ -1580,7 +1580,7 @@ end;
{$REGION Unsorted Debugging things ---------------------------------------------} {$REGION Unsorted Debugging things ---------------------------------------------}
function TGdbWidget.running: boolean; function TGdbWidget.running: boolean;
begin begin
if assigned(fGdb) then if fGdb.isAssigned then
exit(fGdb.Running) exit(fGdb.Running)
else else
exit(false); exit(false);
@ -1593,7 +1593,7 @@ end;
procedure TGdbWidget.killGdb; procedure TGdbWidget.killGdb;
begin begin
if not assigned(fGdb) then if fGdb.isNotAssigned then
exit; exit;
if fGdb.Running then if fGdb.Running then
fGdb.Terminate(0); fGdb.Terminate(0);
@ -1615,9 +1615,9 @@ var
begin begin
if fSynchronizingBreakpoints then if fSynchronizingBreakpoints then
exit; exit;
if assigned(fBreakPoints) then if fBreakPoints.isAssigned then
a := fBreakPoints.addItem(fname, line, kind); a := fBreakPoints.addItem(fname, line, kind);
if not a or fGdb.isNil or not fGdb.Running then if not a or fGdb.isNotAssigned or not fGdb.Running then
exit; exit;
r := fGdbState = gsRunning; r := fGdbState = gsRunning;
if r then if r then
@ -1648,9 +1648,9 @@ var
v: TJSONData; v: TJSONData;
i: integer; i: integer;
begin begin
if assigned(fBreakPoints) then if fBreakPoints.isAssigned then
d := fBreakPoints.deleteItem(fname, line, kind); d := fBreakPoints.deleteItem(fname, line, kind);
if not d or fGdb.isNil or not fGdb.Running then if not d or fGdb.isNotAssigned or not fGdb.Running then
exit; exit;
r := fGdbState = gsRunning; r := fGdbState = gsRunning;
@ -1926,7 +1926,7 @@ begin
dlgOkInfo('No project to debug', 'GDB commander'); dlgOkInfo('No project to debug', 'GDB commander');
exit; exit;
end; end;
if (fDebugTargetKind = dtkRunnable) and fDoc.isNil then if (fDebugTargetKind = dtkRunnable) and fDoc.isNotAssigned then
begin begin
dlgOkInfo('No runnable to debug', 'GDB commander'); dlgOkInfo('No runnable to debug', 'GDB commander');
exit; exit;
@ -2086,7 +2086,7 @@ begin
case fDebugTargetKind of case fDebugTargetKind of
dtkProject : if fProj <> nil then dtkProject : if fProj <> nil then
nme := fProj.filename; nme := fProj.filename;
dtkRunnable : if fDoc.isNotNil then dtkRunnable : if fDoc.isAssigned then
nme := fDoc.filename; nme := fDoc.filename;
dtkCustom : if fCustomTargetFile.fileExists then dtkCustom : if fCustomTargetFile.fileExists then
nme := fCustomTargetFile; nme := fCustomTargetFile;
@ -2440,7 +2440,7 @@ begin
infoAsm(fLastFilename); infoAsm(fLastFilename);
fLastFunction := val.AsString; fLastFunction := val.AsString;
end; end;
if fDocHandler.findDocument(fLastFilename).isNil and fLastFilename.fileExists then if fDocHandler.findDocument(fLastFilename).isNotAssigned and fLastFilename.fileExists then
fDocHandler.openDocument(fLastFilename); fDocHandler.openDocument(fLastFilename);
setState(gsPaused); setState(gsPaused);
autoGetStuff; autoGetStuff;
@ -2487,7 +2487,7 @@ begin
if fCatchPause then if fCatchPause then
begin begin
fCatchPause := false; fCatchPause := false;
if fDocHandler.findDocument(fLastFilename).isNil and fLastFilename.fileExists then if fDocHandler.findDocument(fLastFilename).isNotAssigned and fLastFilename.fileExists then
fDocHandler.openDocument(fLastFilename); fDocHandler.openDocument(fLastFilename);
autoGetStuff; autoGetStuff;
setState(gsPaused); setState(gsPaused);
@ -2505,7 +2505,7 @@ begin
end end
else else
begin begin
if not fDocHandler.findDocument(fLastFilename).isNil and fLastFilename.fileExists then if not fDocHandler.findDocument(fLastFilename).isNotAssigned and fLastFilename.fileExists then
fDocHandler.openDocument(fLastFilename); fDocHandler.openDocument(fLastFilename);
autoGetStuff; autoGetStuff;
setState(gsPaused); setState(gsPaused);
@ -2539,7 +2539,7 @@ begin
for i := 0 to arr.Count-1 do for i := 0 to arr.Count-1 do
begin begin
obj := TJSONObject(arr.Objects[i]); obj := TJSONObject(arr.Objects[i]);
if obj.isNil then if obj.isNotAssigned then
break; break;
if obj.findAny('number', val) then if obj.findAny('number', val) then
number := val.AsInteger; number := val.AsInteger;
@ -2592,13 +2592,13 @@ begin
for i := 0 to arr.Count-1 do for i := 0 to arr.Count-1 do
begin begin
obj := arr.Objects[i]; obj := arr.Objects[i];
if obj.isNil then if obj.isNotAssigned then
break; break;
val := obj.Find('fullname'); val := obj.Find('fullname');
if val.isNotNil then if val.isAssigned then
fLastFilename:= val.AsString; fLastFilename:= val.AsString;
val := obj.Find('func'); val := obj.Find('func');
if val.isNotNil then if val.isAssigned then
begin begin
if fOptions.autoDemangle then if fOptions.autoDemangle then
func:= demangle(val.AsString) func:= demangle(val.AsString)
@ -2606,10 +2606,10 @@ begin
func := val.AsString; func := val.AsString;
end; end;
val := obj.Find('addr'); val := obj.Find('addr');
if val.isNotNil then if val.isAssigned then
addr := val.AsInt64; addr := val.AsInt64;
val := obj.Find('line'); val := obj.Find('line');
if val.isNotNil then if val.isAssigned then
line := val.AsInteger; line := val.AsInteger;
fStackItems.addItem(addr, fLastFilename, func, line); fStackItems.addItem(addr, fLastFilename, func, line);
end; end;
@ -2617,9 +2617,9 @@ begin
end; end;
val := fJson.Find('variables'); val := fJson.Find('variables');
if val.isNil then if val.isNotAssigned then
val := fJson.Find('locals'); val := fJson.Find('locals');
if val.isNotNil and (val.JSONType = jtArray) then if val.isAssigned and (val.JSONType = jtArray) then
begin begin
j := lstVariables.ItemIndex; j := lstVariables.ItemIndex;
lstVariables.BeginUpdate; lstVariables.BeginUpdate;
@ -2632,11 +2632,11 @@ begin
continue; continue;
obj := TJSONObject(val); obj := TJSONObject(val);
val := obj.Find('name'); val := obj.Find('name');
if val.isNil then if val.isNotAssigned then
continue; continue;
nme := val.AsString; nme := val.AsString;
val := obj.Find('value'); val := obj.Find('value');
if val.isNil then if val.isNotAssigned then
continue; continue;
lstVariables.AddItem(nme, nil); lstVariables.AddItem(nme, nil);
with lstVariables.Items[lstVariables.Items.Count-1] do with lstVariables.Items[lstVariables.Items.Count-1] do
@ -2655,12 +2655,12 @@ begin
begin begin
obj := arr.Objects[i]; obj := arr.Objects[i];
val := obj.Find('address'); val := obj.Find('address');
if val.isNotNil then if val.isAssigned then
nme := val.AsString; nme := val.AsString;
//val := obj.Find('func-name'); //val := obj.Find('func-name');
//val := obj.Find('offset'); //val := obj.Find('offset');
val := obj.Find('inst'); val := obj.Find('inst');
if val.isNotNil then if val.isAssigned then
begin begin
lstAsm.AddItem(nme, nil); lstAsm.AddItem(nme, nil);
if nme = fLastOffset then if nme = fLastOffset then
@ -2671,7 +2671,7 @@ begin
lstAsm.Items[lstAsm.Items.Count-1].SubItems.Add(val.AsString); lstAsm.Items[lstAsm.Items.Count-1].SubItems.Add(val.AsString);
end; end;
end; end;
if lstAsm.Selected.isNotNil then if lstAsm.Selected.isAssigned then
lstAsm.Selected.MakeVisible(false); lstAsm.Selected.MakeVisible(false);
lstAsm.EndUpdate; lstAsm.EndUpdate;
selectAsmInstr; selectAsmInstr;
@ -2693,7 +2693,7 @@ begin
if obj.findAny('core', val) then if obj.findAny('core', val) then
k.SubItems.Add(val.AsString); k.SubItems.Add(val.AsString);
val := obj.Find('frame'); val := obj.Find('frame');
if val.isNotNil and (val.JSONType = jtObject) then if val.isAssigned and (val.JSONType = jtObject) then
begin begin
obj := TJSONObject(val); obj := TJSONObject(val);
if obj.findAny('func', val) then if obj.findAny('func', val) then
@ -2753,14 +2753,14 @@ var
begin begin
if (fGdbState = gsNone) or not fOptions.showOutput then if (fGdbState = gsNone) or not fOptions.showOutput then
exit; exit;
if fOutput.isNil and fOutputName.fileExists then if fOutput.isNotAssigned and fOutputName.fileExists then
try try
fOutput := TFileStream.Create(fOutputName, 0); fOutput := TFileStream.Create(fOutputName, 0);
except except
if fOutput.isNotNil then if fOutput.isAssigned then
FreeAndNil(fOutput); FreeAndNil(fOutput);
end; end;
if fOutput.isNil then if fOutput.isNotAssigned then
exit; exit;
str := TMemoryStream.Create; str := TMemoryStream.Create;
lst := TStringList.Create; lst := TStringList.Create;
@ -2787,7 +2787,7 @@ end;
{$REGION GDB commands & actions ------------------------------------------------} {$REGION GDB commands & actions ------------------------------------------------}
procedure TGdbWidget.gdbCommand(aCommand: string; gdbOutProcessor: TNotifyEvent = nil); procedure TGdbWidget.gdbCommand(aCommand: string; gdbOutProcessor: TNotifyEvent = nil);
begin begin
if fGdb.isNil or not fGdb.Running then if fGdb.isNotAssigned or not fGdb.Running then
exit; exit;
fCommandProcessed := false; fCommandProcessed := false;
aCommand += #10; aCommand += #10;
@ -2840,7 +2840,7 @@ end;
procedure TGdbWidget.continueDebugging; procedure TGdbWidget.continueDebugging;
begin begin
gdbCommand('-exec-continue --all', @gdboutJsonize); gdbCommand('-exec-continue --all', @gdboutJsonize);
if assigned(fGdb) and fgdb.Running then if fGdb.isAssigned and fgdb.Running then
begin begin
setState(gsRunning); setState(gsRunning);
subjDebugContinue(fSubj); subjDebugContinue(fSubj);
@ -2861,7 +2861,7 @@ procedure TGdbWidget.btnEvalClick(Sender: TObject);
var var
e: string = ''; e: string = '';
begin begin
if fGdb.isNil or not fGdb.Running then if fGdb.isNotAssigned or not fGdb.Running then
exit; exit;
case fEvalKind of case fEvalKind of
gekCustom: gekCustom:
@ -2893,7 +2893,7 @@ const
cmd: array[boolean] of string = ('-exec-step','-exec-step-instruction'); cmd: array[boolean] of string = ('-exec-step','-exec-step-instruction');
begin begin
gdbCommand(cmd[mnuNextMachine.Checked], @gdboutJsonize); gdbCommand(cmd[mnuNextMachine.Checked], @gdboutJsonize);
if assigned(fGdb) and fgdb.Running then if fGdb.isAssigned and fgdb.Running then
setState(gsRunning); setState(gsRunning);
end; end;
@ -2902,13 +2902,13 @@ const
cmd: array[boolean] of string = ('-exec-next','-exec-next-instruction'); cmd: array[boolean] of string = ('-exec-next','-exec-next-instruction');
begin begin
gdbCommand(cmd[mnuStepMachine.Checked], @gdboutJsonize); gdbCommand(cmd[mnuStepMachine.Checked], @gdboutJsonize);
if assigned(fGdb) and fgdb.Running then if fGdb.isAssigned and fgdb.Running then
setState(gsRunning); setState(gsRunning);
end; end;
procedure TGdbWidget.btnPauseClick(Sender: TObject); procedure TGdbWidget.btnPauseClick(Sender: TObject);
begin begin
if assigned(fGdb) and fGdb.Running then if fGdb.isAssigned and fGdb.Running then
fCatchPause:=true; fCatchPause:=true;
gdbCommand('-exec-interrupt --all', @gdboutJsonize); gdbCommand('-exec-interrupt --all', @gdboutJsonize);
end; end;
@ -2969,7 +2969,7 @@ var
nme: string; nme: string;
doc: TDexedMemo; doc: TDexedMemo;
begin begin
if lstCallStack.Selected.isNil or lstCallStack.Selected.Data.isNil then if lstCallStack.Selected.isNotAssigned or lstCallStack.Selected.Data.isNotAssigned then
exit; exit;
itm := TStackItem(lstCallStack.Selected.Data); itm := TStackItem(lstCallStack.Selected.Data);
nme := itm.filename; nme := itm.filename;
@ -2977,7 +2977,7 @@ begin
exit; exit;
fDocHandler.openDocument(nme); fDocHandler.openDocument(nme);
doc := fDocHandler.findDocument(nme); doc := fDocHandler.findDocument(nme);
if doc.isNotNil then if doc.isAssigned then
doc.CaretY:= itm.line; doc.CaretY:= itm.line;
{gdbCommand('-stack-select-frame ' + intToStr(lstCallStack.ItemIndex)); {gdbCommand('-stack-select-frame ' + intToStr(lstCallStack.ItemIndex));
if fOptions.autoGetVariables then if fOptions.autoGetVariables then
@ -2992,7 +2992,7 @@ var
nme: string; nme: string;
doc: TDexedMemo = nil; doc: TDexedMemo = nil;
begin begin
if (lstThreads.Selected.isNil) or (lstThreads.Selected.SubItems.Count < 6) then if lstThreads.Selected.isNotAssigned or (lstThreads.Selected.SubItems.Count < 6) then
exit; exit;
lne := StrToIntDef(lstThreads.Selected.SubItems[5], -1); lne := StrToIntDef(lstThreads.Selected.SubItems[5], -1);
nme := lstThreads.Selected.SubItems[4]; nme := lstThreads.Selected.SubItems[4];
@ -3000,7 +3000,7 @@ begin
exit; exit;
fDocHandler.openDocument(nme); fDocHandler.openDocument(nme);
doc := fDocHandler.findDocument(nme); doc := fDocHandler.findDocument(nme);
if doc.isNotNil then if doc.isAssigned then
doc.CaretY:= lne; doc.CaretY:= lne;
end; end;
@ -3011,7 +3011,7 @@ var
begin begin
p := lstVariables.ScreenToControl(mouse.CursorPos); p := lstVariables.ScreenToControl(mouse.CursorPos);
i := lstVariables.GetItemAt(p.x, p.y); i := lstVariables.GetItemAt(p.x, p.y);
if assigned(i) and (i.SubItems.Count > 0) then if i.isAssigned and not i.SubItems.Count.equals(0) then
HintInfo^.HintStr:= i.SubItems[0]; HintInfo^.HintStr:= i.SubItems[0];
end; end;
@ -3063,7 +3063,7 @@ begin
if edit1.Items.IndexOf(cmd).equals(-1) then if edit1.Items.IndexOf(cmd).equals(-1) then
edit1.Items.Add(cmd); edit1.Items.Add(cmd);
cmd := fSyms.expand(cmd); cmd := fSyms.expand(cmd);
if (cmd.length > 1) and (cmd[1] = '>') and assigned(fInput) then if (cmd.length > 1) and (cmd[1] = '>') and fInput.isAssigned then
begin begin
cmd := cmd[2..cmd.length] + #10; cmd := cmd[2..cmd.length] + #10;
fInput.Write(cmd[1], cmd.length); fInput.Write(cmd[1], cmd.length);

View File

@ -60,7 +60,7 @@ const
function metrics: THalsteadMetrics; function metrics: THalsteadMetrics;
begin begin
if fMetrics.isNil then if fMetrics.isNotAssigned then
fMetrics := THalsteadMetrics.create(nil); fMetrics := THalsteadMetrics.create(nil);
result := fMetrics; result := fMetrics;
end; end;
@ -75,7 +75,7 @@ begin
prs := TJSONParser.Create(str, [joIgnoreTrailingComma, joUTF8]); prs := TJSONParser.Create(str, [joIgnoreTrailingComma, joUTF8]);
try try
jps := prs.Parse(); jps := prs.Parse();
if jps.isNotNil and (jps.JSONType = jtObject) then if jps.isAssigned and (jps.JSONType = jtObject) then
jsn := TJSONObject(jps.Clone); jsn := TJSONObject(jps.Clone);
jps.Free; jps.Free;
finally finally
@ -193,35 +193,35 @@ procedure THalsteadMetrics.Measure(document: TDexedMemo);
begin begin
result := true; result := true;
val := obj.Find('n1Count'); val := obj.Find('n1Count');
if val.isNil then if val.isNotAssigned then
exit; exit;
n1 := val.AsInteger; n1 := val.AsInteger;
if n1.equals(0) then if n1.equals(0) then
exit; exit;
val := obj.Find('n1Sum'); val := obj.Find('n1Sum');
if val.isNil then if val.isNotAssigned then
exit; exit;
sn1 := val.AsInteger; sn1 := val.AsInteger;
val := obj.Find('n2Count'); val := obj.Find('n2Count');
if val.isNil then if val.isNotAssigned then
exit; exit;
n2 := val.AsInteger; n2 := val.AsInteger;
if n2.equals(0) then if n2.equals(0) then
exit; exit;
val := obj.Find('n2Sum'); val := obj.Find('n2Sum');
if val.isNil then if val.isNotAssigned then
exit; exit;
sn2 := val.AsInteger; sn2 := val.AsInteger;
val := obj.Find('line'); val := obj.Find('line');
if val.isNil then if val.isNotAssigned then
exit; exit;
line := val.AsInteger; line := val.AsInteger;
val := obj.Find('name'); val := obj.Find('name');
if val.isNil then if val.isNotAssigned then
exit; exit;
voc := max(1, n1 + n2); voc := max(1, n1 + n2);
@ -272,21 +272,21 @@ begin
and (maxBugsPerFunction = 0) and (maxBugsPerModule = 0) and (maxVolumePerFunction = 0) then and (maxBugsPerFunction = 0) and (maxBugsPerModule = 0) and (maxVolumePerFunction = 0) then
exit; exit;
if not assigned(fMsgs) then if fMsgs.isNotAssigned then
fMSgs := getMessageDisplay; fMSgs := getMessageDisplay;
getHalsteadMetrics(document.Lines, jsn); getHalsteadMetrics(document.Lines, jsn);
if jsn.isNil then if jsn.isNotAssigned then
exit; exit;
val := jsn.Find('functions'); val := jsn.Find('functions');
if val.isNil or (val.JSONType <> jtArray) then if val.isNotAssigned or (val.JSONType <> jtArray) then
exit; exit;
arr := TJSONArray(val); arr := TJSONArray(val);
for i := 0 to arr.Count-1 do for i := 0 to arr.Count-1 do
begin begin
fnc := TJSONObject(arr.Objects[i]); fnc := TJSONObject(arr.Objects[i]);
if fnc.isNotNil then if fnc.isAssigned then
begin begin
fnW := checkFunction(fnc, bgS); fnW := checkFunction(fnc, bgS);
noW := noW and fnW; noW := noW and fnW;

View File

@ -120,7 +120,7 @@ var
pth: string; pth: string;
cmp: DCompiler; cmp: DCompiler;
begin begin
if fLabel.isNil or fStatus.isNil then if fLabel.isNotAssigned or fStatus.isNotAssigned then
exit; exit;
fPresent := false; fPresent := false;

View File

@ -6,7 +6,7 @@ interface
uses uses
Classes, SysUtils, actnList, menus, process, Classes, SysUtils, actnList, menus, process,
u_synmemo, u_observer; u_synmemo, u_observer, u_common;
type type
@ -19,7 +19,7 @@ type
(** (**
* Common project interface. * Common project interface.
*) *)
ICommonProject = interface ICommonProject = interface(IDexedBaseInterface)
['ICommonProject'] ['ICommonProject']
// general properties ------------------------------------------------------ // general properties ------------------------------------------------------

View File

@ -93,23 +93,23 @@ var
trv: TTreeView; trv: TTreeView;
begin begin
result := ''; result := '';
if src.isNil then if src.isNotAssigned then
exit; exit;
// from mini-explorer // from mini-explorer
if src is TShellListView then if src is TShellListView then
begin begin
lst := TShellListView(src); lst := TShellListView(src);
if lst.Selected.isNotNil then if lst.Selected.isAssigned then
result := lst.GetPathFromItem(lst.Selected); result := lst.GetPathFromItem(lst.Selected);
end end
// from CE/DUB project inspector // from CE/DUB project inspector
else if src is TTreeView then else if src is TTreeView then
begin begin
trv := TTreeView(src); trv := TTreeView(src);
if trv.Selected.isNotNil then if trv.Selected.isAssigned then
begin begin
result := trv.Selected.Text; result := trv.Selected.Text;
if not result.fileExists and assigned(fProj) then if not result.fileExists and fProj.isAssigned then
result := fProj.filename.extractFilePath + result; result := fProj.filename.extractFilePath + result;
end; end;
end; end;
@ -133,7 +133,7 @@ var
fname: string; fname: string;
fmt: TProjectFileFormat; fmt: TProjectFileFormat;
begin begin
if Source.isNil then if Source.isNotAssigned then
exit; exit;
fname := getFilename(Source); fname := getFilename(Source);
if not fname.fileExists then if not fname.fileExists then
@ -142,7 +142,7 @@ begin
fmt := projectFormat(fname); fmt := projectFormat(fname);
if fmt in [pffDexed, pffDub] then if fmt in [pffDexed, pffDub] then
begin begin
if assigned(fFreeProj) then if fFreeProj.isAssigned then
begin begin
if fFreeProj.modified and (dlgFileChangeClose(fFreeProj.filename, UnsavedProj) = mrCancel) then if fFreeProj.modified and (dlgFileChangeClose(fFreeProj.filename, UnsavedProj) = mrCancel) then
exit; exit;
@ -160,7 +160,7 @@ end;
function ddHandler: TDDHandler; function ddHandler: TDDHandler;
begin begin
if fDdHandler.isNil then if fDdHandler.isNotAssigned then
fDdHandler:= TDDHandler.create; fDdHandler:= TDDHandler.create;
result := fDdHandler; result := fDdHandler;
end; end;

View File

@ -252,7 +252,7 @@ begin
if hasValidLibProject then if hasValidLibProject then
begin begin
prj := loadProject(fLibProject, true); prj := loadProject(fLibProject, true);
if not assigned(prj) then if prj.isNotAssigned then
exit; exit;
str := TStringList.Create; str := TStringList.Create;
try try
@ -278,7 +278,7 @@ begin
fModulesByName.insert(lne, mdi); fModulesByName.insert(lne, mdi);
end else end else
begin begin
if not lne.isEmpty and mdi.isNotNil then if not lne.isEmpty and mdi.isAssigned then
mdi.imports.Add(lne); mdi.imports.Add(lne);
end; end;
end; end;
@ -314,7 +314,7 @@ begin
fModulesByName.insert(lne, mdi); fModulesByName.insert(lne, mdi);
end else end else
begin begin
if not lne.isEmpty and mdi.isNotNil then if not lne.isEmpty and mdi.isAssigned then
mdi.imports.Add(lne); mdi.imports.Add(lne);
end; end;
end; end;
@ -342,7 +342,7 @@ begin
begin begin
lb2 := libraryByIndex[i]; lb2 := libraryByIndex[i];
lb1 := libraryByAlias[lb2.libAlias]; lb1 := libraryByAlias[lb2.libAlias];
if lb1.isNotNil and (lb1.Index < lb2.Index) then if lb1.isAssigned and (lb1.Index < lb2.Index) then
begin begin
fCollection.Delete(i); fCollection.Delete(i);
continue; continue;
@ -385,7 +385,7 @@ var
cli: TLibraryItem; cli: TLibraryItem;
dep: TLibraryItem; dep: TLibraryItem;
begin begin
if data.isNil then if data.isNotAssigned then
exit; exit;
if operation <> ooDeleteItem then if operation <> ooDeleteItem then
@ -399,7 +399,7 @@ begin
for i:= 0 to lib.dependencies.Count-1 do for i:= 0 to lib.dependencies.Count-1 do
begin begin
dep := libraryByAlias[lib.dependencies[i]]; dep := libraryByAlias[lib.dependencies[i]];
if assigned(dep) then if dep.isAssigned then
begin begin
j := dep.clients.IndexOf(lib.libAlias); j := dep.clients.IndexOf(lib.libAlias);
if j <> -1 then if j <> -1 then
@ -409,7 +409,7 @@ begin
for i:= 0 to lib.clients.Count-1 do for i:= 0 to lib.clients.Count-1 do
begin begin
cli := libraryByAlias[lib.clients[i]]; cli := libraryByAlias[lib.clients[i]];
if assigned(cli) then if cli.isAssigned then
begin begin
j := cli.dependencies.IndexOf(lib.libAlias); j := cli.dependencies.IndexOf(lib.libAlias);
if j <> -1 then if j <> -1 then
@ -538,7 +538,7 @@ var
i: Integer; i: Integer;
begin begin
// no selector = all libs // no selector = all libs
if aliases.isNil then if aliases.isNotAssigned then
begin begin
for i:= 0 to librariesCount-1 do for i:= 0 to librariesCount-1 do
begin begin
@ -551,7 +551,7 @@ begin
else for i := 0 to aliases.Count-1 do else for i := 0 to aliases.Count-1 do
begin begin
lib := libraryByAlias[aliases[i]]; lib := libraryByAlias[aliases[i]];
if lib.isNotNil and lib.enabled then if lib.isAssigned and lib.enabled then
add(lib); add(lib);
end; end;
end; end;
@ -564,7 +564,7 @@ begin
if fMsgs = nil then if fMsgs = nil then
fMsgs := getMessageDisplay; fMsgs := getMessageDisplay;
// no selector = all libs // no selector = all libs
if aliases.isNil then if aliases.isNotAssigned then
begin begin
for i:= 0 to librariesCount-1 do for i:= 0 to librariesCount-1 do
begin begin
@ -585,7 +585,7 @@ begin
for i := 0 to aliases.Count-1 do for i := 0 to aliases.Count-1 do
begin begin
lib := libraryByAlias[aliases[i]]; lib := libraryByAlias[aliases[i]];
if lib.isNotNil and lib.enabled and lib.hasValidLibSourcePath then if lib.isAssigned and lib.enabled and lib.hasValidLibSourcePath then
list.Add('-I' + lib.libSourcePath); list.Add('-I' + lib.libSourcePath);
end; end;
end; end;
@ -609,7 +609,7 @@ begin
begin begin
// get library for import I // get library for import I
itm := libraryByImport[imp[i]]; itm := libraryByImport[imp[i]];
if itm.isNotNil then if itm.isAssigned then
begin begin
if sel.contains(itm) then if sel.contains(itm) then
continue; continue;
@ -618,7 +618,7 @@ begin
for j:= itm.dependencies.Count-1 downto 0 do for j:= itm.dependencies.Count-1 downto 0 do
begin begin
dep := libraryByAlias[itm.dependencies[j]]; dep := libraryByAlias[itm.dependencies[j]];
if dep.isNotNil then if dep.isAssigned then
sel.insert(dep) sel.insert(dep)
else else
//auto update: item removed, detect on usage that it has disapeared //auto update: item removed, detect on usage that it has disapeared
@ -633,7 +633,7 @@ begin
while true do while true do
begin begin
itm := Data; itm := Data;
if itm.isNil then if itm.isNotAssigned then
break; break;
if itm.hasValidLibFile then if itm.hasValidLibFile then
begin begin
@ -666,7 +666,7 @@ begin
for i := 0 to imports.Count-1 do for i := 0 to imports.Count-1 do
begin begin
b := libraryByImport[imports[i]]; b := libraryByImport[imports[i]];
if b.isNotNil and b.enabled then if b.isAssigned and b.enabled then
begin begin
s := b.libFile; s := b.libFile;
if opts.IndexOf(s).equals(-1) and not s.isEmpty then if opts.IndexOf(s).equals(-1) and not s.isEmpty then
@ -704,7 +704,7 @@ begin
continue; continue;
dep := libraryByImport[imp]; dep := libraryByImport[imp];
// std / core / etc ... // std / core / etc ...
if dep.isNil then if dep.isNotAssigned then
continue; continue;
// ... this should not happen // ... this should not happen
if dep = lib then if dep = lib then
@ -726,7 +726,7 @@ end;
function LibMan: TLibraryManager; function LibMan: TLibraryManager;
begin begin
if fLibMan.isNil then if fLibMan.isNotAssigned then
fLibMan := TLibraryManager.create(nil); fLibMan := TLibraryManager.create(nil);
result := fLibMan; result := fLibMan;
end; end;

View File

@ -200,6 +200,6 @@ inherited LibManEditorWidget: TLibManEditorWidget
end end
end end
inherited contextMenu: TPopupMenu inherited contextMenu: TPopupMenu
left = 400 Left = 400
end end
end end

View File

@ -114,10 +114,10 @@ var
i: TIconScaledSize; i: TIconScaledSize;
begin begin
btnReg.Enabled := (fProj <> nil) and fProj.Filename.fileExists; btnReg.Enabled := (fProj <> nil) and fProj.Filename.fileExists;
btnOpenProj.Enabled := List.Selected.isNotNil and btnOpenProj.Enabled := List.Selected.isAssigned and
List.Selected.SubItems[2].fileExists; List.Selected.SubItems[2].fileExists;
i := GetIconScaledSize; i := GetIconScaledSize;
if List.Selected.isNotNil and itemForRow(List.Selected).isNotNil and if List.Selected.isAssigned and itemForRow(List.Selected).isAssigned and
itemForRow(List.Selected).enabled then itemForRow(List.Selected).enabled then
begin begin
case i of case i of
@ -194,7 +194,7 @@ end;
procedure TLibManEditorWidget.ListEdited(Sender: TObject; Item: TListItem; var value: string); procedure TLibManEditorWidget.ListEdited(Sender: TObject; Item: TListItem; var value: string);
begin begin
if Item.isNotNil then if Item.isAssigned then
RowToLibrary(item); RowToLibrary(item);
end; end;
@ -332,10 +332,10 @@ end;
procedure TDubPackageQueryForm.getList(sender: TObject); procedure TDubPackageQueryForm.getList(sender: TObject);
begin begin
if assigned(fList) then if fList.isAssigned then
fList.free; fList.free;
simpleGet('https://code.dlang.org/api/packages/search', fList); simpleGet('https://code.dlang.org/api/packages/search', fList);
if assigned(fList) then if fList.isAssigned then
fillList fillList
else else
dlgOkError('could not get the package list, ' + simpleGetErrMsg); dlgOkError('could not get the package list, ' + simpleGetErrMsg);
@ -347,14 +347,14 @@ var
i: integer; i: integer;
begin begin
cbb.Clear; cbb.Clear;
if fList.isNotNil and (fList.JSONType = jtArray) then if fList.isAssigned and (fList.JSONType = jtArray) then
for i := 0 to fList.Count -1 do for i := 0 to fList.Count -1 do
begin begin
itm := fList.Items[i].FindPath('version'); itm := fList.Items[i].FindPath('version');
if itm.isNil then if itm.isNotAssigned then
continue; continue;
itm := fList.Items[i].FindPath('name'); itm := fList.Items[i].FindPath('name');
if itm.isNil then if itm.isNotAssigned then
continue; continue;
cbb.Items.AddObject(itm.AsString, fList.Items[i]); cbb.Items.AddObject(itm.AsString, fList.Items[i]);
end; end;
@ -373,8 +373,8 @@ begin
if not fGetLatestTag then if not fGetLatestTag then
exit; exit;
// list is updated // list is updated
if fList.isNotNil and (cbb.ItemIndex <> -1) and if fList.isAssigned and (cbb.ItemIndex <> -1) and
cbb.Items.Objects[cbb.ItemIndex].isNotNil then cbb.Items.Objects[cbb.ItemIndex].isAssigned then
begin begin
jsn := TJSONData(cbb.Items.Objects[cbb.ItemIndex]); jsn := TJSONData(cbb.Items.Objects[cbb.ItemIndex]);
jsn := jsn.FindPath('version'); jsn := jsn.FindPath('version');
@ -395,11 +395,11 @@ procedure TDubPackageQueryForm.updateHint(sender: TObject);
var var
jsn: TJSONData; jsn: TJSONData;
begin begin
if (cbb.ItemIndex <> -1) and cbb.Items.Objects[cbb.ItemIndex].isNotNil then if (cbb.ItemIndex <> -1) and cbb.Items.Objects[cbb.ItemIndex].isAssigned then
try try
jsn := TJSONData(cbb.Items.Objects[cbb.ItemIndex]); jsn := TJSONData(cbb.Items.Objects[cbb.ItemIndex]);
jsn := jsn.FindPath('description'); jsn := jsn.FindPath('description');
if jsn.isNotNil then if jsn.isAssigned then
cbb.Hint:= jsn.AsString; cbb.Hint:= jsn.AsString;
except except
end; end;
@ -543,13 +543,13 @@ begin
prj := TDubProject.create(nil); prj := TDubProject.create(nil);
try try
prj.loadFromFile(dfn); prj.loadFromFile(dfn);
if prj.json.isNotNil and TJSONObject(prj.json).Find('targetType').isNotNil if prj.json.isAssigned and TJSONObject(prj.json).Find('targetType').isAssigned
and (TJSONObject(prj.json).Find('targetType').AsString = 'sourceLibrary') and (TJSONObject(prj.json).Find('targetType').AsString = 'sourceLibrary')
then then
begin begin
if (ovw and not List.items.findCaption(nme, row)) or not ovw then if (ovw and not List.items.findCaption(nme, row)) or not ovw then
row := List.Items.Add; row := List.Items.Add;
if row.Data.isNil then if row.Data.isNotAssigned then
row.Data := fLibman.libraries.Add; row.Data := fLibman.libraries.Add;
row.Caption:= nme; row.Caption:= nme;
row.SubItems.Clear; row.SubItems.Clear;
@ -582,7 +582,7 @@ begin
begin begin
if (ovw and not List.items.findCaption(nme, row)) or not ovw then if (ovw and not List.items.findCaption(nme, row)) or not ovw then
row := List.Items.Add; row := List.Items.Add;
if row.Data.isNil then if row.Data.isNotAssigned then
row.Data := fLibman.libraries.Add; row.Data := fLibman.libraries.Add;
row.Caption := nme; row.Caption := nme;
row.SubItems.Clear; row.SubItems.Clear;
@ -616,7 +616,7 @@ var
al: string; al: string;
i: integer; i: integer;
begin begin
if List.Selected.isNil then if List.Selected.isNotAssigned then
exit; exit;
al := List.Selected.Caption; al := List.Selected.Caption;
@ -638,7 +638,7 @@ end;
procedure TLibManEditorWidget.btnEnabledClick(Sender: TObject); procedure TLibManEditorWidget.btnEnabledClick(Sender: TObject);
begin begin
if List.Selected.isNil then if List.Selected.isNotAssigned then
exit; exit;
if List.Selected.SubItems[3] = 'true' then if List.Selected.SubItems[3] = 'true' then
@ -654,7 +654,7 @@ var
fname: string; fname: string;
fmt: TProjectFileFormat; fmt: TProjectFileFormat;
begin begin
if List.Selected.isNil then if List.Selected.isNotAssigned then
exit; exit;
fname := List.Selected.SubItems[2]; fname := List.Selected.SubItems[2];
if not fname.fileExists then if not fname.fileExists then
@ -663,7 +663,7 @@ begin
fmt := projectFormat(fname); fmt := projectFormat(fname);
if fmt in [pffDexed, pffDub] then if fmt in [pffDexed, pffDub] then
begin begin
if assigned(fFreeProj) then if fFreeProj.isAssigned then
begin begin
if fFreeProj.modified and (dlgFileChangeClose(fFreeProj.filename, UnsavedProj) = mrCancel) then if fFreeProj.modified and (dlgFileChangeClose(fFreeProj.filename, UnsavedProj) = mrCancel) then
exit; exit;
@ -747,7 +747,7 @@ end;
procedure TLibManEditorWidget.btnRemLibClick(Sender: TObject); procedure TLibManEditorWidget.btnRemLibClick(Sender: TObject);
begin begin
if List.Selected.isNil then if List.Selected.isNotAssigned then
exit; exit;
flibman.libraries.Delete(List.Selected.Index); flibman.libraries.Delete(List.Selected.Index);
@ -759,7 +759,7 @@ procedure TLibManEditorWidget.btnSelProjClick(Sender: TObject);
var var
ini: string; ini: string;
begin begin
if List.Selected.isNil then if List.Selected.isNotAssigned then
exit; exit;
ini := List.Selected.SubItems[2]; ini := List.Selected.SubItems[2];
@ -779,7 +779,7 @@ procedure TLibManEditorWidget.btnSelFileClick(Sender: TObject);
var var
ini: string = ''; ini: string = '';
begin begin
if List.Selected.isNil then if List.Selected.isNotAssigned then
exit; exit;
ini := List.Selected.SubItems[0]; ini := List.Selected.SubItems[0];
@ -809,7 +809,7 @@ procedure TLibManEditorWidget.btnSelfoldOfFilesClick(Sender: TObject);
var var
dir, outdir: string; dir, outdir: string;
begin begin
if List.Selected.isNil then if List.Selected.isNotAssigned then
exit; exit;
dir := List.Selected.SubItems[0]; dir := List.Selected.SubItems[0];
@ -822,7 +822,7 @@ procedure TLibManEditorWidget.btnSelRootClick(Sender: TObject);
var var
dir: string; dir: string;
begin begin
if List.Selected.isNil then if List.Selected.isNotAssigned then
exit; exit;
dir := List.Selected.SubItems[1]; dir := List.Selected.SubItems[1];
@ -843,7 +843,7 @@ procedure TLibManEditorWidget.btnMoveUpClick(Sender: TObject);
var var
i: integer; i: integer;
begin begin
if list.Selected.isNil or list.Selected.Index.equals(0) then if list.Selected.isNotAssigned or list.Selected.Index.equals(0) then
exit; exit;
i := list.Selected.Index; i := list.Selected.Index;
@ -855,7 +855,7 @@ procedure TLibManEditorWidget.btnMoveDownClick(Sender: TObject);
var var
i: integer; i: integer;
begin begin
if list.Selected.isNil or (list.Selected.Index = list.Items.Count - 1) then if list.Selected.isNotAssigned or (list.Selected.Index = list.Items.Count - 1) then
exit; exit;
i := list.Selected.Index; i := list.Selected.Index;
@ -896,7 +896,7 @@ var
itm: TLibraryItem; itm: TLibraryItem;
begin begin
itm := itemForRow(row); itm := itemForRow(row);
if itm.isNil then if itm.isNotAssigned then
exit; exit;
itm.libAlias := row.Caption; itm.libAlias := row.Caption;

View File

@ -11,8 +11,9 @@ object MainForm: TMainForm
OnDropFiles = FormDropFiles OnDropFiles = FormDropFiles
OnResize = FormResize OnResize = FormResize
ShowHint = True ShowHint = True
LCLVersion = '2.0.10.0'
object mainMenu: TMainMenu object mainMenu: TMainMenu
top = 1 Top = 1
object MenuItem1: TMenuItem object MenuItem1: TMenuItem
Caption = 'File' Caption = 'File'
object MenuItem5: TMenuItem object MenuItem5: TMenuItem
@ -413,8 +414,8 @@ object MainForm: TMainForm
end end
end end
object Actions: TActionList object Actions: TActionList
left = 32 Left = 32
top = 1 Top = 1
object actEdCopy: TAction object actEdCopy: TAction
Category = 'Edit' Category = 'Edit'
Caption = 'Copy' Caption = 'Copy'
@ -857,7 +858,7 @@ object MainForm: TMainForm
object ApplicationProperties1: TApplicationProperties object ApplicationProperties1: TApplicationProperties
OnActivate = ApplicationProperties1Activate OnActivate = ApplicationProperties1Activate
OnException = ApplicationProperties1Exception OnException = ApplicationProperties1Exception
left = 64 Left = 64
top = 1 Top = 1
end end
end end

View File

@ -1060,11 +1060,11 @@ begin
grp := getProjectGroup; grp := getProjectGroup;
pix := grp.reloadedProjectIndex; pix := grp.reloadedProjectIndex;
prj := MainForm.fFreeProj; prj := MainForm.fFreeProj;
if assigned(prj) then if prj.isAssigned then
fProjName := prj.filename; fProjName := prj.filename;
fProjectGroup := getProjectGroup.groupFilename; fProjectGroup := getProjectGroup.groupFilename;
if prj = MainForm.fProj then if prj = MainForm.fProj then
fProjectIndex :=- 1 fProjectIndex := -1
else else
fProjectIndex := pix; fProjectIndex := pix;
end else end else
@ -1087,29 +1087,31 @@ begin
if fProjName.isNotEmpty and fProjName.fileExists then if fProjName.isNotEmpty and fProjName.fileExists then
begin begin
dst.openProj(fProjName); dst.openProj(fProjName);
if not assigned(dst.fProj) then if dst.fProj.isNotAssigned then
exit; exit;
hdl := getMultiDocHandler; hdl := getMultiDocHandler;
if assigned(hdl) then if hdl.isAssigned then
mem := hdl.findDocument(dst.fProj.filename); mem := hdl.findDocument(dst.fProj.filename);
if mem.isNotNil then if mem.isAssigned then
begin
if dst.fProj.getFormat = pfDEXED then if dst.fProj.getFormat = pfDEXED then
mem.Highlighter := LfmSyn mem.Highlighter := LfmSyn
else else
mem.Highlighter := JsSyn; mem.Highlighter := JsSyn;
end;
end; end;
grp := getProjectGroup; grp := getProjectGroup;
if fProjectGroup.isNotEmpty and fProjectGroup.fileExists then if fProjectGroup.isNotEmpty and fProjectGroup.fileExists then
grp.openGroup(fProjectGroup); grp.openGroup(fProjectGroup);
if fProjectIndex.equals(-1) and assigned(dst.fFreeProj) then if fProjectIndex.equals(-1) and dst.fFreeProj.isAssigned then
dst.fFreeProj.activate dst.fFreeProj.activate
else if (fProjectIndex >= 0) and (grp.projectCount > 0) else if (fProjectIndex >= 0) and (grp.projectCount > 0)
and (fProjectIndex < grp.projectCount) then and (fProjectIndex < grp.projectCount) then
begin begin
grp.setProjectIndex(fProjectIndex); grp.setProjectIndex(fProjectIndex);
grp.getProject(grp.getProjectIndex).activate; grp.getProject(grp.getProjectIndex).activate;
end; end;
end end
else inherited; else inherited;
end; end;
@ -1127,7 +1129,7 @@ var
str: string; str: string;
begin begin
docHandler := getMultiDocHandler; docHandler := getMultiDocHandler;
if not assigned(docHandler) then if docHandler.isNotAssigned then
exit; exit;
for i:= 0 to docHandler.documentCount-1 do for i:= 0 to docHandler.documentCount-1 do
@ -1151,7 +1153,7 @@ var
i: integer; i: integer;
begin begin
docHandler := getMultiDocHandler; docHandler := getMultiDocHandler;
if not assigned(docHandler) then if docHandler.isNotAssigned then
exit; exit;
for i := 0 to fDocuments.Count-1 do for i := 0 to fDocuments.Count-1 do
@ -1695,7 +1697,7 @@ begin
begin begin
if site is TAnchorDockHostSite then if site is TAnchorDockHostSite then
begin begin
if TAnchorDockHostSite(site).BoundSplitter.isNotNil then if TAnchorDockHostSite(site).BoundSplitter.isAssigned then
TAnchorDockHostSite(site).BoundSplitter.OnMouseWheel:= @DockSplitterMw; TAnchorDockHostSite(site).BoundSplitter.OnMouseWheel:= @DockSplitterMw;
end end
else if site is TAnchorDockSplitter then else if site is TAnchorDockSplitter then
@ -1756,7 +1758,7 @@ begin
if w = fEditWidg then if w = fEditWidg then
continue; continue;
h := DockMaster.GetAnchorSite(w); h := DockMaster.GetAnchorSite(w);
if h.isNotNil then if h.isAssigned then
h.ManualFloat(w.ClientRect, false); h.ManualFloat(w.ClientRect, false);
end; end;
end; end;
@ -1974,7 +1976,7 @@ procedure TMainForm.FreeRunnableProc;
var var
f: string; f: string;
begin begin
if fRunProc.isNil then if fRunProc.isNotAssigned then
exit; exit;
f := fRunProc.Executable; f := fRunProc.Executable;
@ -2039,7 +2041,7 @@ begin
dat := arr.Objects[0]; dat := arr.Objects[0];
tgg := dat.FindPath('name'); tgg := dat.FindPath('name');
end; end;
if tgg.isNotNil then if tgg.isAssigned then
begin begin
url := 'https://gitlab.com/basile.b/dexed/-/releases/' + tgg.AsString; url := 'https://gitlab.com/basile.b/dexed/-/releases/' + tgg.AsString;
res:= TResourceStream.Create(HINSTANCE, 'VERSION', RT_RCDATA); res:= TResourceStream.Create(HINSTANCE, 'VERSION', RT_RCDATA);
@ -2075,7 +2077,7 @@ begin
// see: http://forum.lazarus.freepascal.org/index.php/topic,30616.0.htm // see: http://forum.lazarus.freepascal.org/index.php/topic,30616.0.htm
if fAppliOpts.reloadLastDocuments then if fAppliOpts.reloadLastDocuments then
LoadLastDocsAndProj; LoadLastDocsAndProj;
if not assigned(fProj) then if fProj.isNotAssigned then
newDubProj; newDubProj;
DockMaster.ResetSplitters; DockMaster.ResetSplitters;
@ -2170,7 +2172,7 @@ end;
procedure TMainForm.ApplicationProperties1Exception(Sender: TObject;E: Exception); procedure TMainForm.ApplicationProperties1Exception(Sender: TObject;E: Exception);
begin begin
if fMesgWidg.isNil then if fMesgWidg.isNotAssigned then
dlgOkError(E.Message) dlgOkError(E.Message)
else else
fMsgs.message(E.Message, nil, amcApp, amkErr); fMsgs.message(E.Message, nil, amcApp, amkErr);
@ -2198,7 +2200,7 @@ begin
(dlgOkCancel('A project is still being compiled, close anyway ?') <> mrOK) then (dlgOkCancel('A project is still being compiled, close anyway ?') <> mrOK) then
exit; exit;
if assigned(fFreeProj) and fFreeProj.modified then if fFreeProj.isAssigned and fFreeProj.modified then
begin begin
p += #9 + fFreeProj.filename + LineEnding; p += #9 + fFreeProj.filename + LineEnding;
c := true; c := true;
@ -2274,7 +2276,7 @@ begin
if d.modified and not d.isTemporary then if d.modified and not d.isTemporary then
d.save; d.save;
end; end;
if assigned(fProj) and fProj.modified then if fProj.isAssigned and fProj.modified then
fProj.saveToFile(fProj.filename); fProj.saveToFile(fProj.filename);
for i := 0 to fProjectGroup.projectCount-1 do for i := 0 to fProjectGroup.projectCount-1 do
if fProjectGroup.projectModified(i) then if fProjectGroup.projectModified(i) then
@ -2291,7 +2293,7 @@ begin
SaveLastDocsAndProj; SaveLastDocsAndProj;
CanClose:= true; CanClose:= true;
fProjectGroup.closeGroup; fProjectGroup.closeGroup;
if assigned(fFreeProj) then if fFreeProj.isAssigned then
fFreeProj.getProject.Free; fFreeProj.getProject.Free;
for i:= fMultidoc.documentCount-1 downto 0 do for i:= fMultidoc.documentCount-1 downto 0 do
fMultidoc.closeDocument(i, false); fMultidoc.closeDocument(i, false);
@ -2299,17 +2301,17 @@ end;
procedure TMainForm.updateDocumentBasedAction(sender: TObject); procedure TMainForm.updateDocumentBasedAction(sender: TObject);
begin begin
TAction(sender).Enabled := fDoc.isNotNil; TAction(sender).Enabled := fDoc.isAssigned;
end; end;
procedure TMainForm.updateProjectBasedAction(sender: TObject); procedure TMainForm.updateProjectBasedAction(sender: TObject);
begin begin
TAction(sender).Enabled := assigned(fProj) {and not fProjActionsLock}; TAction(sender).Enabled := fProj.isAssigned {and not fProjActionsLock};
end; end;
procedure TMainForm.updateDocEditBasedAction(sender: TObject); procedure TMainForm.updateDocEditBasedAction(sender: TObject);
begin begin
if fDoc.isNotNil and fDoc.Focused then if fDoc.isAssigned and fDoc.Focused then
TAction(sender).Enabled := true TAction(sender).Enabled := true
else else
TAction(sender).Enabled := false; TAction(sender).Enabled := false;
@ -2326,10 +2328,10 @@ var
s: string; s: string;
begin begin
srcLst := TMRUFileList(Sender); srcLst := TMRUFileList(Sender);
if srcLst.isNil then if srcLst.isNotAssigned then
exit; exit;
trgMnu := TMenuItem(srcLst.objectTag); trgMnu := TMenuItem(srcLst.objectTag);
if trgMnu.isNil then if trgMnu.isNotAssigned then
exit; exit;
if fUpdateCount > 0 then if fUpdateCount > 0 then
@ -2385,7 +2387,7 @@ var
srcLst: TMRUFileList; srcLst: TMRUFileList;
begin begin
srcLst := TMRUFileList(TmenuItem(Sender).Tag); srcLst := TMRUFileList(TmenuItem(Sender).Tag);
if srcLst.isNotNil then if srcLst.isAssigned then
srcLst.Clear; srcLst.Clear;
end; end;
@ -2395,7 +2397,7 @@ var
i: integer; i: integer;
begin begin
srcLst := TMRUFileList(TmenuItem(Sender).Tag); srcLst := TMRUFileList(TmenuItem(Sender).Tag);
if srcLst.isNil then if srcLst.isNotAssigned then
exit; exit;
srcLst.BeginUpdate; srcLst.BeginUpdate;
for i := srcLst.Count-1 downto 0 do for i := srcLst.Count-1 downto 0 do
@ -2470,7 +2472,7 @@ begin
else if project = fFreeProj then else if project = fFreeProj then
fFreeProj := nil; fFreeProj := nil;
if assigned(fProj) and mnuGitBranch.Count.equals(0) then if fProj.isAssigned and mnuGitBranch.Count.equals(0) then
actProjGitBranchesUpdExecute(nil); actProjGitBranchesUpdExecute(nil);
showProjTitle; showProjTitle;
@ -2498,7 +2500,7 @@ begin
fMsgs.message('Build duration: ' + formatTicksAsDuration(GetTickCount64 - fCompStart), fMsgs.message('Build duration: ' + formatTicksAsDuration(GetTickCount64 - fCompStart),
project, amcProj, amkInf); project, amcProj, amkInf);
end; end;
if fRunProjAfterCompile and assigned(fProj) then if fRunProjAfterCompile and fProj.isAssigned then
begin begin
if not success then if not success then
runprev := dlgYesNo('last build failed, continue and run ?') = mrYes; runprev := dlgYesNo('last build failed, continue and run ?') = mrYes;
@ -2533,7 +2535,7 @@ begin
fMsgs.message('Group build duration: ' + formatTicksAsDuration(GetTickCount64 - fCompStart), fMsgs.message('Group build duration: ' + formatTicksAsDuration(GetTickCount64 - fCompStart),
nil, amcAll, amkInf); nil, amcAll, amkInf);
end; end;
if assigned(fProjBeforeGroup) then if fProjBeforeGroup.isAssigned then
fProjBeforeGroup.activate; fProjBeforeGroup.activate;
fProjBeforeGroup := nil; fProjBeforeGroup := nil;
fIsCompilingGroup := false; fIsCompilingGroup := false;
@ -2584,7 +2586,7 @@ procedure TMainForm.mnuDelete(value: TMenuItem);
var var
i: integer; i: integer;
begin begin
if value.isNil then if value.isNotAssigned then
exit; exit;
i := mainMenu.Items.IndexOf(value); i := mainMenu.Items.IndexOf(value);
if i <> -1 then if i <> -1 then
@ -2597,7 +2599,7 @@ procedure TMainForm.actFileHtmlExportExecute(Sender: TObject);
var var
exp: TSynExporterHTML; exp: TSynExporterHTML;
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
exp := TSynExporterHTML.Create(nil); exp := TSynExporterHTML.Create(nil);
try try
@ -2649,7 +2651,7 @@ var
begin begin
with TOpenDialog.Create(nil) do with TOpenDialog.Create(nil) do
try try
if fDoc.isNotNil and not fDoc.isTemporary and fDoc.fileName.fileExists then if fDoc.isAssigned and not fDoc.isTemporary and fDoc.fileName.fileExists then
initialDir := fDoc.fileName.extractFileDir; initialDir := fDoc.fileName.extractFileDir;
options := options + [ofAllowMultiSelect]; options := options + [ofAllowMultiSelect];
filter := DdiagFilter; filter := DdiagFilter;
@ -2663,7 +2665,7 @@ end;
procedure TMainForm.actProjOpenContFoldExecute(Sender: TObject); procedure TMainForm.actProjOpenContFoldExecute(Sender: TObject);
begin begin
if not assigned(fProj) or not fProj.filename.fileExists then if fProj.isNotAssigned or not fProj.filename.fileExists then
exit; exit;
getExplorer.browse(fProj.filename.extractFilePath); getExplorer.browse(fProj.filename.extractFilePath);
fExplWidg.showWidget; fExplWidg.showWidget;
@ -2700,7 +2702,7 @@ end;
procedure TMainForm.actFileSaveAsExecute(Sender: TObject); procedure TMainForm.actFileSaveAsExecute(Sender: TObject);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
with TSaveDialog.Create(nil) do with TSaveDialog.Create(nil) do
try try
@ -2718,7 +2720,7 @@ procedure TMainForm.actFileSaveExecute(Sender: TObject);
var var
str: string; str: string;
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
str := fDoc.fileName; str := fDoc.fileName;
@ -2730,7 +2732,7 @@ end;
procedure TMainForm.actFileAddToProjExecute(Sender: TObject); procedure TMainForm.actFileAddToProjExecute(Sender: TObject);
begin begin
if fDoc.isNil or not assigned(fProj) then if fDoc.isNotAssigned or fProj.isNotAssigned then
exit; exit;
if fProj.filename = fDoc.fileName then if fProj.filename = fDoc.fileName then
exit; exit;
@ -2747,7 +2749,7 @@ end;
procedure TMainForm.actFileCloseExecute(Sender: TObject); procedure TMainForm.actFileCloseExecute(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
getMultiDocHandler.closeDocument(fDoc); getMultiDocHandler.closeDocument(fDoc);
end; end;
@ -2780,7 +2782,7 @@ procedure TMainForm.actFileSaveCopyAsExecute(Sender: TObject);
var var
str: TStringList; str: TStringList;
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
with TSaveDialog.create(nil) do with TSaveDialog.create(nil) do
try try
@ -2823,43 +2825,43 @@ end;
{$REGION edit ------------------------------------------------------------------} {$REGION edit ------------------------------------------------------------------}
procedure TMainForm.actEdCopyExecute(Sender: TObject); procedure TMainForm.actEdCopyExecute(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.CopyToClipboard; fDoc.CopyToClipboard;
end; end;
procedure TMainForm.actEdCutExecute(Sender: TObject); procedure TMainForm.actEdCutExecute(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.CutToClipboard; fDoc.CutToClipboard;
end; end;
procedure TMainForm.actEdPasteExecute(Sender: TObject); procedure TMainForm.actEdPasteExecute(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.PasteFromClipboard; fDoc.PasteFromClipboard;
end; end;
procedure TMainForm.actEdUndoExecute(Sender: TObject); procedure TMainForm.actEdUndoExecute(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.Undo; fDoc.Undo;
end; end;
procedure TMainForm.actEdRedoExecute(Sender: TObject); procedure TMainForm.actEdRedoExecute(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.Redo; fDoc.Redo;
end; end;
procedure TMainForm.actEdMacPlayExecute(Sender: TObject); procedure TMainForm.actEdMacPlayExecute(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fEditWidg.macRecorder.PlaybackMacro(fDoc); fEditWidg.macRecorder.PlaybackMacro(fDoc);
end; end;
procedure TMainForm.actEdMacStartStopExecute(Sender: TObject); procedure TMainForm.actEdMacStartStopExecute(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
begin begin
if fEditWidg.macRecorder.State = msRecording then if fEditWidg.macRecorder.State = msRecording then
fEditWidg.macRecorder.Stop fEditWidg.macRecorder.Stop
@ -2869,13 +2871,13 @@ end;
procedure TMainForm.actEdIndentExecute(Sender: TObject); procedure TMainForm.actEdIndentExecute(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.ExecuteCommand(ecBlockIndent, '', nil); fDoc.ExecuteCommand(ecBlockIndent, '', nil);
end; end;
procedure TMainForm.actEdUnIndentExecute(Sender: TObject); procedure TMainForm.actEdUnIndentExecute(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.ExecuteCommand(ecBlockUnIndent, '', nil); fDoc.ExecuteCommand(ecBlockUnIndent, '', nil);
end; end;
@ -2883,7 +2885,7 @@ procedure TMainForm.actEdFindExecute(Sender: TObject);
var var
str: string; str: string;
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
fFindWidg.showWidget; fFindWidg.showWidget;
@ -2909,7 +2911,7 @@ var
of_no: string; of_no: string;
begin begin
result := ''; result := '';
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
of_no := fDoc.fileName.stripFileExt + exeExt; of_no := fDoc.fileName.stripFileExt + exeExt;
@ -2930,7 +2932,7 @@ begin
if fDoc.isTemporary then if fDoc.isTemporary then
result := of_yes; result := of_yes;
end end
else if assigned(fProj) then else if fProj.isAssigned then
begin begin
if ifInProject in fRunnablesOptions.outputFolderConditions then if ifInProject in fRunnablesOptions.outputFolderConditions then
begin begin
@ -2978,7 +2980,7 @@ begin
proc := TDexedProcess(sender); proc := TDexedProcess(sender);
asyncprocOutput(sender); asyncprocOutput(sender);
inph := EntitiesConnector.getSingleService('IProcInputHandler'); inph := EntitiesConnector.getSingleService('IProcInputHandler');
if inph.isNotNil then if inph.isAssigned then
(inph as IProcInputHandler).removeProcess(proc); (inph as IProcInputHandler).removeProcess(proc);
if not proc.ExitStatus.equals(0) then if not proc.ExitStatus.equals(0) then
begin begin
@ -3014,7 +3016,7 @@ end;
procedure TMainForm.ApplicationProperties1Activate(Sender: TObject); procedure TMainForm.ApplicationProperties1Activate(Sender: TObject);
begin begin
if fDoc.isNotNil then if fDoc.isAssigned then
fDoc.checkFileDate; fDoc.checkFileDate;
end; end;
@ -3038,7 +3040,7 @@ begin
result := false; result := false;
fMsgs.clearByData(fDoc); fMsgs.clearByData(fDoc);
FreeRunnableProc; FreeRunnableProc;
if fDoc.isNil or fDoc.Lines.Count.equals(0) then if fDoc.isNotAssigned or fDoc.Lines.Count.equals(0) then
exit; exit;
firstlineFlags := fDoc.Lines[0]; firstlineFlags := fDoc.Lines[0];
@ -3112,11 +3114,11 @@ begin
dmdproc.Parameters.Add('-of' + fname + objExt); dmdproc.Parameters.Add('-of' + fname + objExt);
dmdproc.Parameters.Add('-J' + fDoc.fileName.extractFilePath); dmdproc.Parameters.Add('-J' + fDoc.fileName.extractFilePath);
dmdproc.Parameters.AddStrings(fRunnablesOptions.staticSwitches); dmdproc.Parameters.AddStrings(fRunnablesOptions.staticSwitches);
if lst.isNotNil and not lst.Count.equals(0) then if lst.isAssigned and not lst.Count.equals(0) then
dmdproc.Parameters.AddStrings(lst); dmdproc.Parameters.AddStrings(lst);
{$ifdef WINDOWS} {$ifdef WINDOWS}
{$ifdef CPUX86_64} {$ifdef CPUX86_64}
if lst.isNotNil and (lst.IndexOf('-m32') <> -1) then if lst.isAssigned and (lst.IndexOf('-m32') <> -1) then
begin begin
i := dmdproc.Parameters.IndexOf('-m64'); i := dmdproc.Parameters.IndexOf('-m64');
if i <> -1 then if i <> -1 then
@ -3201,7 +3203,7 @@ begin
finally finally
dmdproc.Free; dmdproc.Free;
if lst.isNotNil then if lst.isAssigned then
lst.Free; lst.Free;
end; end;
end; end;
@ -3212,7 +3214,7 @@ var
lst: TStringList; lst: TStringList;
fname: string; fname: string;
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
fname := runnableExename; fname := runnableExename;
if not fname.fileExists then if not fname.fileExists then
@ -3263,7 +3265,7 @@ const
ic : array[boolean] of TAppMessageKind = (amkWarn, amkInf); ic : array[boolean] of TAppMessageKind = (amkWarn, amkInf);
begin begin
asyncprocTerminate(sender); asyncprocTerminate(sender);
if fCovModUt and assigned(fRunProc) and fRunProc.ExitStatus.equals(0) then if fCovModUt and fRunProc.isAssigned and fRunProc.ExitStatus.equals(0) then
begin begin
fname := fDoc.fileName.stripFileExt; fname := fDoc.fileName.stripFileExt;
fullcov := true; fullcov := true;
@ -3301,7 +3303,7 @@ end;
procedure TMainForm.actFileUnittestExecute(Sender: TObject); procedure TMainForm.actFileUnittestExecute(Sender: TObject);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
if compileRunnable(true) then if compileRunnable(true) then
executeRunnable(true, true); executeRunnable(true, true);
@ -3309,7 +3311,7 @@ end;
procedure TMainForm.actFileCompAndRunExecute(Sender: TObject); procedure TMainForm.actFileCompAndRunExecute(Sender: TObject);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
if compileRunnable(false) then if compileRunnable(false) then
executeRunnable(false, true); executeRunnable(false, true);
@ -3317,7 +3319,7 @@ end;
procedure TMainForm.actFileCompileAndRunOutExecute(Sender: TObject); procedure TMainForm.actFileCompileAndRunOutExecute(Sender: TObject);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
if compileRunnable(false) then if compileRunnable(false) then
executeRunnable(false, false); executeRunnable(false, false);
@ -3327,7 +3329,7 @@ procedure TMainForm.actFileCompAndRunWithArgsExecute(Sender: TObject);
var var
runargs: string = ''; runargs: string = '';
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
if compileRunnable(false) and InputQuery('Execution arguments', '', runargs) then if compileRunnable(false) and InputQuery('Execution arguments', '', runargs) then
executeRunnable(false, true, runargs); executeRunnable(false, true, runargs);
@ -3344,7 +3346,7 @@ var
d: TDexedMemo; d: TDexedMemo;
c: TDexedMemo; c: TDexedMemo;
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
c := fDoc; c := fDoc;
for i := fMultidoc.documentCount-1 downto 0 do for i := fMultidoc.documentCount-1 downto 0 do
@ -3359,7 +3361,7 @@ procedure TMainForm.actFileCloseAllExecute(Sender: TObject);
var var
i: integer; i: integer;
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
for i := fMultidoc.documentCount-1 downto 0 do for i := fMultidoc.documentCount-1 downto 0 do
fMultidoc.closeDocument(i); fMultidoc.closeDocument(i);
@ -3367,7 +3369,7 @@ end;
procedure TMainForm.actEdFormatExecute(Sender: TObject); procedure TMainForm.actEdFormatExecute(Sender: TObject);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
getCodeFormatting.formatCurrent(); getCodeFormatting.formatCurrent();
end; end;
@ -3379,7 +3381,7 @@ var
pth: string; pth: string;
msg: string; msg: string;
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
if fDoc.isTemporary and fDoc.modified then if fDoc.isTemporary and fDoc.modified then
fDoc.saveTempFile; fDoc.saveTempFile;
@ -3408,7 +3410,7 @@ end;
procedure TMainForm.actFileMetricsHalsteadExecute(Sender: TObject); procedure TMainForm.actFileMetricsHalsteadExecute(Sender: TObject);
begin begin
if fDoc.isNil or not fDoc.isDSource then if fDoc.isNotAssigned or not fDoc.isDSource then
exit; exit;
metrics.measure(fDoc); metrics.measure(fDoc);
end; end;
@ -3449,7 +3451,7 @@ procedure TMainForm.dubFile(outside: boolean);
var var
d: string; d: string;
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
FreeRunnableProc; FreeRunnableProc;
fMsgs.clearByData(fDoc); fMsgs.clearByData(fDoc);
@ -3498,7 +3500,7 @@ const
messg2: string = 'The binary produced for a runnable that is not explicitly saved ' + messg2: string = 'The binary produced for a runnable that is not explicitly saved ' +
'must be recompiled after each execution.' + LineEnding + 'Do you wish to recompile it now ?'; 'must be recompiled after each execution.' + LineEnding + 'Do you wish to recompile it now ?';
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
FreeRunnableProc; FreeRunnableProc;
fname := runnableExename; fname := runnableExename;
@ -3532,7 +3534,7 @@ end;
procedure TMainForm.actFileOpenContFoldExecute(Sender: TObject); procedure TMainForm.actFileOpenContFoldExecute(Sender: TObject);
begin begin
if fDoc.isNil or not fDoc.fileName.fileExists then if fDoc.isNotAssigned or not fDoc.fileName.fileExists then
exit; exit;
getExplorer.browse(fDoc.fileName.extractFilePath); getExplorer.browse(fDoc.fileName.extractFilePath);
fExplWidg.showWidget; fExplWidg.showWidget;
@ -3595,7 +3597,7 @@ var
widg: TDexedWidget; widg: TDexedWidget;
act: TAction; act: TAction;
begin begin
if sender.isNil then if sender.isNotAssigned then
exit; exit;
act := TAction(sender); act := TAction(sender);
if act.Tag.equals(0) then if act.Tag.equals(0) then
@ -3617,7 +3619,7 @@ var
widg: TDexedWidget; widg: TDexedWidget;
begin begin
widg := TDexedWidget( TComponent(sender).tag ); widg := TDexedWidget( TComponent(sender).tag );
if widg.isNotNil then if widg.isAssigned then
widg.showWidget; widg.showWidget;
end; end;
@ -3650,7 +3652,7 @@ begin
if not w.isDockable then if not w.isDockable then
continue; continue;
h := DockMaster.GetAnchorSite(w); h := DockMaster.GetAnchorSite(w);
if h.isNotNil and ((h.WindowState = wsMinimized) or (not h.HasParent)) then if h.isAssigned and ((h.WindowState = wsMinimized) or (not h.HasParent)) then
h.Close; h.Close;
end; end;
@ -3723,8 +3725,8 @@ var
const const
fstyle: array[boolean] of TFormStyle = (fsNormal, fsStayOnTop); fstyle: array[boolean] of TFormStyle = (fsNormal, fsStayOnTop);
begin begin
for widg in fWidgList do if widg.Parent.isNotNil and for widg in fWidgList do if widg.Parent.isAssigned and
widg.Parent.Parent.isNil and widg.isDockable then widg.Parent.Parent.isNotAssigned and widg.isDockable then
TForm(widg.Parent).FormStyle := fstyle[onTop]; TForm(widg.Parent).FormStyle := fstyle[onTop];
end; end;
@ -3738,13 +3740,13 @@ begin
if not fDockingIsInitialized then if not fDockingIsInitialized then
exit; exit;
edtSite := DockMaster.GetSite(fEditWidg); edtSite := DockMaster.GetSite(fEditWidg);
if edtSite.isNil then if edtSite.isNotAssigned then
exit; exit;
if GetDockSplitterOrParent(edtSite, akTop, topSite) then if GetDockSplitterOrParent(edtSite, akTop, topSite) then
begin begin
if topSite is TAnchorDockHostSite then if topSite is TAnchorDockHostSite then
topHost := TAnchorDockHostSite(topSite); topHost := TAnchorDockHostSite(topSite);
if topHost.isNotNil and topHost.BoundSplitter.isNotNil and if topHost.isAssigned and topHost.BoundSplitter.isAssigned and
(topHost.BoundSplitter.Top > 0) then (topHost.BoundSplitter.Top > 0) then
begin begin
topHost.BoundSplitter.OnCanOffset:=nil; topHost.BoundSplitter.OnCanOffset:=nil;
@ -3775,7 +3777,7 @@ end;
procedure TMainForm.showProjTitle; procedure TMainForm.showProjTitle;
begin begin
if assigned(fProj) and fProj.filename.fileExists then if fProj.isAssigned and fProj.filename.fileExists then
caption := format('dexed - %s', [shortenPath(fProj.filename, 30)]) caption := format('dexed - %s', [shortenPath(fProj.filename, 30)])
else else
caption := 'dexed'; caption := 'dexed';
@ -3785,8 +3787,7 @@ procedure TMainForm.saveProjSource(const document: TDexedMemo);
var var
fname: string; fname: string;
begin begin
if not assigned(fProj) or checkProjectLock or if fProj.isNotAssigned or checkProjectLock or (fProj.filename <> document.fileName) then
(fProj.filename <> document.fileName) then
exit; exit;
fname := fProj.filename; fname := fProj.filename;
@ -3796,7 +3797,7 @@ end;
function TMainForm.closeProj: boolean; function TMainForm.closeProj: boolean;
begin begin
if not assigned(fProj) then if fProj.isNotAssigned then
exit(true); exit(true);
result := false; result := false;
@ -3818,7 +3819,7 @@ procedure TMainForm.actProjNewDialogExecute(Sender: TObject);
var var
r: TModalResult; r: TModalResult;
begin begin
if assigned(fProj) and not fProj.inGroup and fProj.modified and if fProj.isAssigned and not fProj.inGroup and fProj.modified and
(dlgFileChangeClose(fProj.filename, UnsavedProj) = mrCancel) then (dlgFileChangeClose(fProj.filename, UnsavedProj) = mrCancel) then
exit; exit;
if not closeProj then if not closeProj then
@ -3835,7 +3836,7 @@ end;
procedure TMainForm.actProjNewDubJsonExecute(Sender: TObject); procedure TMainForm.actProjNewDubJsonExecute(Sender: TObject);
begin begin
if assigned(fProj) and not fProj.inGroup and fProj.modified and if fProj.isAssigned and not fProj.inGroup and fProj.modified and
(dlgFileChangeClose(fProj.filename, UnsavedProj) = mrCancel) then (dlgFileChangeClose(fProj.filename, UnsavedProj) = mrCancel) then
exit; exit;
if not closeProj then if not closeProj then
@ -3845,7 +3846,7 @@ end;
procedure TMainForm.actProjNewNativeExecute(Sender: TObject); procedure TMainForm.actProjNewNativeExecute(Sender: TObject);
begin begin
if assigned(fProj) and not fProj.inGroup and fProj.modified and if fProj.isAssigned and not fProj.inGroup and fProj.modified and
(dlgFileChangeClose(fProj.filename, UnsavedProj) = mrCancel) then (dlgFileChangeClose(fProj.filename, UnsavedProj) = mrCancel) then
exit; exit;
if not closeProj then if not closeProj then
@ -3905,7 +3906,7 @@ procedure TMainForm.mruProjItemClick(Sender: TObject);
begin begin
if checkProjectLock then if checkProjectLock then
exit; exit;
if assigned(fProj) and not fProj.inGroup and fProj.modified and if fProj.isAssigned and not fProj.inGroup and fProj.modified and
(dlgFileChangeClose(fProj.filename, UnsavedProj) = mrCancel) then (dlgFileChangeClose(fProj.filename, UnsavedProj) = mrCancel) then
exit; exit;
openProj(TMenuItem(Sender).Hint); openProj(TMenuItem(Sender).Hint);
@ -3926,7 +3927,7 @@ end;
procedure TMainForm.actProjCloseExecute(Sender: TObject); procedure TMainForm.actProjCloseExecute(Sender: TObject);
begin begin
if assigned(fProj) and not fProj.inGroup and fProj.modified and if fProj.isAssigned and not fProj.inGroup and fProj.modified and
(dlgFileChangeClose(fProj.filename, UnsavedProj) = mrCancel) then (dlgFileChangeClose(fProj.filename, UnsavedProj) = mrCancel) then
exit; exit;
closeProj; closeProj;
@ -3955,7 +3956,7 @@ end;
procedure TMainForm.actProjSaveExecute(Sender: TObject); procedure TMainForm.actProjSaveExecute(Sender: TObject);
begin begin
if not assigned(fProj) then if fProj.isNotAssigned then
exit; exit;
if (fProj.getFormat = pfDUB) and TDubProject(fProj.getProject).isSDL then if (fProj.getFormat = pfDUB) and TDubProject(fProj.getProject).isSDL then
begin begin
@ -3974,7 +3975,7 @@ procedure TMainForm.actProjOpenExecute(Sender: TObject);
begin begin
if checkProjectLock then if checkProjectLock then
exit; exit;
if assigned(fProj) and fProj.modified and if fProj.isAssigned and fProj.modified and
(dlgFileChangeClose(fProj.filename, UnsavedProj) = mrCancel) then (dlgFileChangeClose(fProj.filename, UnsavedProj) = mrCancel) then
exit; exit;
with TOpenDialog.Create(nil) do with TOpenDialog.Create(nil) do
@ -3991,13 +3992,13 @@ procedure TMainForm.actProjEditorExecute(Sender: TObject);
var var
win: TControl = nil; win: TControl = nil;
begin begin
if assigned(fProj) then if fProj.isAssigned then
case fProj.getFormat of case fProj.getFormat of
pfDUB: win := DockMaster.GetAnchorSite(fDubProjWidg); pfDUB: win := DockMaster.GetAnchorSite(fDubProjWidg);
pfDEXED: win := DockMaster.GetAnchorSite(fPrjCfWidg); pfDEXED: win := DockMaster.GetAnchorSite(fPrjCfWidg);
end end
else win := DockMaster.GetAnchorSite(fPrjCfWidg); else win := DockMaster.GetAnchorSite(fPrjCfWidg);
if win.isNotNil then if win.isAssigned then
begin begin
win.Show; win.Show;
win.BringToFront; win.BringToFront;
@ -4006,7 +4007,7 @@ end;
procedure TMainForm.actProjSourceExecute(Sender: TObject); procedure TMainForm.actProjSourceExecute(Sender: TObject);
begin begin
if not assigned(fProj) or not fProj.filename.fileExists then if fProj.isNotAssigned or not fProj.filename.fileExists then
exit; exit;
if (fProj.getFormat = pfDUB) and TDubProject(fProj.getProject).isSDL then if (fProj.getFormat = pfDUB) and TDubProject(fProj.getProject).isSDL then
@ -4025,25 +4026,21 @@ end;
procedure TMainForm.actProjOptViewExecute(Sender: TObject); procedure TMainForm.actProjOptViewExecute(Sender: TObject);
begin begin
if not assigned(fProj) then if fProj.isAssigned then
exit; dlgOkInfo(fProj.getCommandLine, 'Compilation command line');
dlgOkInfo(fProj.getCommandLine, 'Compilation command line');
end; end;
procedure TMainForm.actProjTestExecute(Sender: TObject); procedure TMainForm.actProjTestExecute(Sender: TObject);
begin begin
if not assigned(fProj) then if fProj.isNotAssigned or checkProjectLock then
exit;
if checkProjectLock then
exit; exit;
fProj.test; fProj.test;
end; end;
procedure TMainForm.actProjStopCompExecute(Sender: TObject); procedure TMainForm.actProjStopCompExecute(Sender: TObject);
begin begin
if fProj = nil then if fProj.isAssigned then
exit; fProj.stopCompilation();
fProj.stopCompilation();
end; end;
procedure TMainForm.actProjDscanExecute(Sender: TObject); procedure TMainForm.actProjDscanExecute(Sender: TObject);
@ -4132,7 +4129,7 @@ var
i: integer; i: integer;
b: string; b: string;
begin begin
if not assigned(fProj) then if fProj.isNotAssigned then
exit; exit;
p := TProcess.Create(nil); p := TProcess.Create(nil);
r := TStringList.Create; r := TStringList.Create;
@ -4167,7 +4164,7 @@ var
m: TMenuItem; m: TMenuItem;
a: boolean; a: boolean;
begin begin
if not assigned(fProj) then if fProj.isNotAssigned then
exit; exit;
a := mnuGitBranch.Count >= 2; a := mnuGitBranch.Count >= 2;
if a then if a then
@ -4280,7 +4277,7 @@ end;
procedure TMainForm.actProjSelUngroupedExecute(Sender: TObject); procedure TMainForm.actProjSelUngroupedExecute(Sender: TObject);
begin begin
if assigned(fFreeProj) then if fFreeProj.isAssigned then
fFreeProj.activate; fFreeProj.activate;
end; end;
@ -4290,7 +4287,7 @@ var
e: TStrings; e: TStrings;
s: string; s: string;
begin begin
if not assigned(fProj) or (fProj.getFormat <> pfDUB) then if fProj.isNotAssigned or (fProj.getFormat <> pfDUB) then
exit; exit;
p := TDubProject(fProj.getProject); p := TDubProject(fProj.getProject);
e := p.getPersistentEnvironment; e := p.getPersistentEnvironment;
@ -4314,7 +4311,7 @@ end;
procedure TMainForm.actProjAddToGroupExecute(Sender: TObject); procedure TMainForm.actProjAddToGroupExecute(Sender: TObject);
begin begin
if not assigned(fFreeProj) or fFreeProj.inGroup or if fFreeProj.isNotAssigned or fFreeProj.inGroup or
not fFreeProj.filename.fileExists then not fFreeProj.filename.fileExists then
exit; exit;
fProjectGroup.addProject(fFreeProj); fProjectGroup.addProject(fFreeProj);
@ -4390,7 +4387,7 @@ begin
(dlgFileChangeClose(fProjectGroup.groupFilename, UnsavedPGrp) = mrCancel) then (dlgFileChangeClose(fProjectGroup.groupFilename, UnsavedPGrp) = mrCancel) then
exit; exit;
fProjectGroup.closeGroup; fProjectGroup.closeGroup;
if assigned(fFreeProj) then if fFreeProj.isAssigned then
fFreeProj.activate; fFreeProj.activate;
end; end;
{$ENDREGION} {$ENDREGION}

View File

@ -485,7 +485,7 @@ end;
procedure TMessagesWidget.listDeletion(Sender: TObject; Node: TTreeNode); procedure TMessagesWidget.listDeletion(Sender: TObject; Node: TTreeNode);
begin begin
if node.data.isNotNil then if node.data.isAssigned then
Dispose(PMessageData(Node.Data)); Dispose(PMessageData(Node.Data));
end; end;
@ -540,7 +540,7 @@ var
i: Integer; i: Integer;
o: TAppMessageCtxt; o: TAppMessageCtxt;
begin begin
if sender.isNil then if sender.isNotAssigned then
exit; exit;
// //
o := fCtxt; o := fCtxt;
@ -774,7 +774,7 @@ begin
case fCtxt of case fCtxt of
amcAll, amcApp, amcMisc : amcAll, amcApp, amcMisc :
clearbyContext(fCtxt); clearbyContext(fCtxt);
amcEdit: if fDoc.isNotNil then amcEdit: if fDoc.isAssigned then
clearbyData(fDoc); clearbyData(fDoc);
amcProj: if fProj <> nil then amcProj: if fProj <> nil then
clearbyData(fProj); clearbyData(fProj);
@ -878,9 +878,9 @@ end;
procedure TMessagesWidget.docNew(document: TDexedMemo); procedure TMessagesWidget.docNew(document: TDexedMemo);
begin begin
if fDoc.isNotNil and fOptions.fAutoSelect and (fCtxt = amcEdit) then if fDoc.isAssigned and fOptions.fAutoSelect and (fCtxt = amcEdit) then
begin begin
if list.Selected.isNotNil then if list.Selected.isAssigned then
fEditorMessagePos[fDoc.fileName] := list.Selected.Index fEditorMessagePos[fDoc.fileName] := list.Selected.Index
else else
fEditorMessagePos[fDoc.fileName] := -1; fEditorMessagePos[fDoc.fileName] := -1;
@ -906,9 +906,9 @@ var
begin begin
if fDoc = document then if fDoc = document then
exit; exit;
if fDoc.isNotNil and fOptions.fAutoSelect and (fCtxt = amcEdit) then if fDoc.isAssigned and fOptions.fAutoSelect and (fCtxt = amcEdit) then
begin begin
if list.Selected.isNotNil then if list.Selected.isAssigned then
fEditorMessagePos[fDoc.fileName] := list.Selected.Index fEditorMessagePos[fDoc.fileName] := list.Selected.Index
else else
fEditorMessagePos[fDoc.fileName] := -1; fEditorMessagePos[fDoc.fileName] := -1;
@ -1040,9 +1040,9 @@ var
d: PMessageData; d: PMessageData;
n: TTreeNode; n: TTreeNode;
begin begin
if data.isNil then if data.isNotAssigned then
exit; exit;
if (TObject(data) = fDoc) and (fDoc.isNotNil) then if (TObject(data) = fDoc) and (fDoc.isAssigned) then
fEditorMessagePos[fDoc.fileName] := -1; fEditorMessagePos[fDoc.fileName] := -1;
list.BeginUpdate; list.BeginUpdate;
TreeFilterEdit1.Filter := ''; TreeFilterEdit1.Filter := '';
@ -1102,7 +1102,7 @@ begin
else else
begin begin
i := List.BottomItem; i := List.BottomItem;
fMustScrollToBack := i.isNotNil and i.IsVisible; fMustScrollToBack := i.isAssigned and i.IsVisible;
end; end;
end; end;
@ -1110,7 +1110,7 @@ procedure TMessagesWidget.scrollToBack;
begin begin
if not Visible or not fMustScrollToBack then if not Visible or not fMustScrollToBack then
exit; exit;
if List.BottomItem.isNotNil then if List.BottomItem.isAssigned then
List.BottomItem.MakeVisible; List.BottomItem.MakeVisible;
end; end;
@ -1121,7 +1121,7 @@ var
dat: PMessageData; dat: PMessageData;
old: TDexedMemo; old: TDexedMemo;
begin begin
if List.Selected.isNil then if List.Selected.isNotAssigned then
exit; exit;
if ssCtrl in GetKeyShiftState then if ssCtrl in GetKeyShiftState then
exit; exit;
@ -1137,7 +1137,7 @@ begin
// from here, since a doc has the focus, List.Selected is nil // from here, since a doc has the focus, List.Selected is nil
pos := getLineFromMessage(msg); pos := getLineFromMessage(msg);
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
fDoc.setFocus; fDoc.setFocus;
fDoc.CaretXY := pos; fDoc.CaretXY := pos;

View File

@ -194,11 +194,11 @@ inherited MiniExplorerWidget: TMiniExplorerWidget
end end
end end
inherited contextMenu: TPopupMenu inherited contextMenu: TPopupMenu
left = 40 Left = 40
top = 48 Top = 48
end end
object mnuDrives: TPopupMenu[2] object mnuDrives: TPopupMenu[2]
left = 8 Left = 8
top = 48 Top = 48
end end
end end

View File

@ -481,7 +481,7 @@ procedure TMiniExplorerWidget.lstFavSelect(Sender: TObject; Item: TListItem; Sel
var var
d: string; d: string;
begin begin
if not Selected or Item.Data.isNil then if not Selected or Item.Data.isNotAssigned then
exit; exit;
d := PString(Item.Data)^; d := PString(Item.Data)^;
if d.dirExists then if d.dirExists then
@ -492,7 +492,7 @@ procedure TMiniExplorerWidget.btnRemFavClick(Sender: TObject);
var var
i: Integer; i: Integer;
begin begin
if lstFav.Selected.isNil then if lstFav.Selected.isNotAssigned then
exit; exit;
i := fFavorites.IndexOf(PString(lstFav.Selected.Data)^); i := fFavorites.IndexOf(PString(lstFav.Selected.Data)^);
if i <> -1 then if i <> -1 then
@ -504,7 +504,7 @@ procedure TMiniExplorerWidget.lstFavClick(Sender: TObject);
var var
d: string; d: string;
begin begin
if lstFav.Selected.isNil or lstFav.Selected.Data.isNil then if lstFav.Selected.isNotAssigned or lstFav.Selected.Data.isNotAssigned then
exit; exit;
d := PString(lstFav.Selected.Data)^; d := PString(lstFav.Selected.Data)^;
if not d.dirExists and (dlgYesNo('The favorite folder `' + d + if not d.dirExists and (dlgYesNo('The favorite folder `' + d +
@ -517,7 +517,7 @@ end;
procedure TMiniExplorerWidget.lstFavDeletion(Sender: TObject; Item: TListItem); procedure TMiniExplorerWidget.lstFavDeletion(Sender: TObject; Item: TListItem);
begin begin
if Item.isNotNil and item.Data.isNotNil then if Item.isAssigned and item.Data.isAssigned then
dispose(PString(item.Data)); dispose(PString(item.Data));
end; end;
@ -528,7 +528,7 @@ end;
procedure TMiniExplorerWidget.lstFilesColumnClick(Sender: TObject;Column: TListColumn); procedure TMiniExplorerWidget.lstFilesColumnClick(Sender: TObject;Column: TListColumn);
begin begin
if Column.isNotNil then if Column.isAssigned then
begin begin
if Column.Index = fFileListSortedColumnIndex then if Column.Index = fFileListSortedColumnIndex then
begin begin
@ -543,14 +543,14 @@ end;
procedure TMiniExplorerWidget.btnAddFavClick(Sender: TObject); procedure TMiniExplorerWidget.btnAddFavClick(Sender: TObject);
begin begin
if treeFolders.Selected.isNil then if treeFolders.Selected.isNotAssigned then
exit; exit;
fFavorites.Add(treeFolders.GetPathFromNode(treeFolders.Selected).extractFileDir); fFavorites.Add(treeFolders.GetPathFromNode(treeFolders.Selected).extractFileDir);
end; end;
procedure TMiniExplorerWidget.lstFavDblClick(Sender: TObject); procedure TMiniExplorerWidget.lstFavDblClick(Sender: TObject);
begin begin
if lstFav.Selected.isNil then if lstFav.Selected.isNotAssigned then
exit; exit;
treeFolders.Root := lstFav.Selected.Caption; treeFolders.Root := lstFav.Selected.Caption;
end; end;
@ -673,7 +673,7 @@ var
fname: string; fname: string;
fmt: TProjectFileFormat; fmt: TProjectFileFormat;
begin begin
if lstFiles.Selected.isNil then if lstFiles.Selected.isNotAssigned then
exit; exit;
fname := lstFiles.GetPathFromItem(lstFiles.Selected); fname := lstFiles.GetPathFromItem(lstFiles.Selected);
if not fname.fileExists then if not fname.fileExists then
@ -681,7 +681,7 @@ begin
fmt := projectFormat(fname); fmt := projectFormat(fname);
if fmt in [pffDexed, pffDub] then if fmt in [pffDexed, pffDub] then
begin begin
if assigned(fFreeProj) then if fFreeProj.isAssigned then
begin begin
if fFreeProj.modified and (dlgFileChangeClose(fFreeProj.filename, UnsavedProj) = mrCancel) then if fFreeProj.modified and (dlgFileChangeClose(fFreeProj.filename, UnsavedProj) = mrCancel) then
exit; exit;
@ -779,18 +779,18 @@ var
begin begin
if fLastListOrTree = lstFiles then if fLastListOrTree = lstFiles then
begin begin
if lstFiles.Selected.isNil then if lstFiles.Selected.isNotAssigned then
exit; exit;
fname := lstFiles.GetPathFromItem(lstFiles.Selected); fname := lstFiles.GetPathFromItem(lstFiles.Selected);
end else if fLastListOrTree = treeFolders then end else if fLastListOrTree = treeFolders then
begin begin
if treeFolders.Selected.isNil then if treeFolders.Selected.isNotAssigned then
exit; exit;
fname := treeFolders.GetPathFromNode(treeFolders.Selected).extractFileDir; fname := treeFolders.GetPathFromNode(treeFolders.Selected).extractFileDir;
end end
else if fLastListOrTree = lstFav then else if fLastListOrTree = lstFav then
begin begin
if lstFav.Selected.isNil or lstFav.Selected.Data.isNil then if lstFav.Selected.isNotAssigned or lstFav.Selected.Data.isNotAssigned then
exit; exit;
fname := PString(lstFav.Selected.Data)^; fname := PString(lstFav.Selected.Data)^;
end; end;
@ -809,7 +809,7 @@ end;
procedure TMiniExplorerWidget.treeFoldersChange(Sender: TObject; procedure TMiniExplorerWidget.treeFoldersChange(Sender: TObject;
Node: TTreeNode); Node: TTreeNode);
begin begin
if treeFolders.Selected.isNil then if treeFolders.Selected.isNotAssigned then
exit; exit;
fLastFold := treeFolders.Path.extractFileDir; // trailing path sep fLastFold := treeFolders.Path.extractFileDir; // trailing path sep
subjMnexDirectoryChanged(fMnxSubj, fLastFold); subjMnexDirectoryChanged(fMnxSubj, fLastFold);
@ -817,7 +817,7 @@ end;
procedure TMiniExplorerWidget.treeFoldersDblClick(Sender: TObject); procedure TMiniExplorerWidget.treeFoldersDblClick(Sender: TObject);
begin begin
if treeFolders.Selected.isNil then if treeFolders.Selected.isNotAssigned then
exit; exit;
treeFolders.Root := treeFolders.GetPathFromNode(treeFolders.Selected) treeFolders.Root := treeFolders.GetPathFromNode(treeFolders.Selected)
.extractFileDir; // trailing path sep .extractFileDir; // trailing path sep

View File

@ -15,7 +15,7 @@ type
* is mostly designed to avoid messy uses clauses or to limit * is mostly designed to avoid messy uses clauses or to limit
* the visibility of the implementer methods. * the visibility of the implementer methods.
*) *)
ISingleService = interface ISingleService = interface(IDexedBaseInterface)
function singleServiceName: string; function singleServiceName: string;
end; end;
@ -59,7 +59,7 @@ type
(** (**
* Interface for a subject. Basically designed to hold a list of observer * Interface for a subject. Basically designed to hold a list of observer
*) *)
ISubject = interface ISubject = interface(IDexedBaseInterface)
// an observer is proposed. anObserver is not necessarly compatible. // an observer is proposed. anObserver is not necessarly compatible.
procedure addObserver(observer: TObject); procedure addObserver(observer: TObject);
// anObserver must be removed. // anObserver must be removed.
@ -71,7 +71,7 @@ type
* Base type used as constraint for an interface that contains * Base type used as constraint for an interface that contains
* the methods called by a ISubject. * the methods called by a ISubject.
*) *)
IObserverType = interface IObserverType = interface(IDexedBaseInterface)
end; end;
(** (**

View File

@ -126,7 +126,7 @@ inherited OptionEditorWidget: TOptionEditorWidget
end end
end end
inherited contextMenu: TPopupMenu inherited contextMenu: TPopupMenu
left = 144 Left = 144
top = 24 Top = 24
end end
end end

View File

@ -122,12 +122,12 @@ procedure TOptionEditorWidget.showOptionEditor(observer: IEditableOptions = nil)
var var
n: TTreeNode; n: TTreeNode;
begin begin
if assigned(observer) then if observer.isAssigned then
begin begin
if selCat.Items.Count.equals(0) then if selCat.Items.Count.equals(0) then
updateCategories; updateCategories;
n := selCat.Items.FindNodeWithText(observer.optionedWantCategory()); n := selCat.Items.FindNodeWithText(observer.optionedWantCategory());
if n.isNotNil then if n.isAssigned then
selCat.Selected := n; selCat.Selected := n;
end; end;
showWidget; showWidget;
@ -145,7 +145,7 @@ var
ed: IEditableOptions; ed: IEditableOptions;
sel: string = ''; sel: string = '';
begin begin
if selCat.Selected.isNotNil then if selCat.Selected.isAssigned then
sel := selCat.Selected.Text; sel := selCat.Selected.Text;
fUpdatingCat := true; fUpdatingCat := true;
inspector.TIObject := nil; inspector.TIObject := nil;
@ -175,7 +175,7 @@ end;
procedure TOptionEditorWidget.selCatDeletion(Sender: TObject; Node: TTreeNode); procedure TOptionEditorWidget.selCatDeletion(Sender: TObject; Node: TTreeNode);
begin begin
if node.Data.isNotNil then if node.Data.isAssigned then
Dispose(PCategoryData(node.Data)); Dispose(PCategoryData(node.Data));
end; end;
@ -188,9 +188,9 @@ begin
exit; exit;
if csDestroying in ComponentState then if csDestroying in ComponentState then
exit; exit;
if selCat.Selected.isNil then if selCat.Selected.isNotAssigned then
exit; exit;
if selCat.Selected.Data.isNil then if selCat.Selected.Data.isNotAssigned then
exit; exit;
// accept/cancel is relative to a single category // accept/cancel is relative to a single category
dt := PCategoryData(selCat.Selected.Data); dt := PCategoryData(selCat.Selected.Data);
@ -208,7 +208,7 @@ begin
end else end else
begin begin
dt := PCategoryData(selCat.Selected.Data); dt := PCategoryData(selCat.Selected.Data);
if dt^.container.isNil or (dt^.observer = nil) then if dt^.container.isNotAssigned or (dt^.observer = nil) then
exit; exit;
if dt^.observer.optionedOptionsModified() then if dt^.observer.optionedOptionsModified() then
begin begin
@ -237,11 +237,11 @@ begin
pnlEd.Controls[0].Parent := nil; pnlEd.Controls[0].Parent := nil;
end; end;
if selCat.Selected.isNil or selcat.Selected.Data.isNil then if selCat.Selected.isNotAssigned or selcat.Selected.Data.isNotAssigned then
exit; exit;
dt := PCategoryData(selCat.Selected.Data); dt := PCategoryData(selCat.Selected.Data);
if dt^.container.isNil then if dt^.container.isNotAssigned then
exit; exit;
case dt^.kind of case dt^.kind of
oekControl: oekControl:
@ -276,7 +276,7 @@ end;
procedure TOptionEditorWidget.inspectorModified(Sender: TObject); procedure TOptionEditorWidget.inspectorModified(Sender: TObject);
begin begin
if selCat.Selected.isNil or selcat.Selected.Data.isNil then if selCat.Selected.isNotAssigned or selcat.Selected.Data.isNotAssigned then
exit; exit;
fCatChanged := true; fCatChanged := true;
@ -287,11 +287,11 @@ end;
procedure TOptionEditorWidget.btnCancelClick(Sender: TObject); procedure TOptionEditorWidget.btnCancelClick(Sender: TObject);
begin begin
if selCat.Selected.isNil or selcat.Selected.Data.isNil then if selCat.Selected.isNotAssigned or selcat.Selected.Data.isNotAssigned then
exit; exit;
fCatChanged := false; fCatChanged := false;
if inspector.Parent.isNotNil then if inspector.Parent.isAssigned then
inspector.ItemIndex := -1; inspector.ItemIndex := -1;
PCategoryData(selCat.Selected.Data)^ PCategoryData(selCat.Selected.Data)^
.observer .observer
@ -325,11 +325,11 @@ end;
procedure TOptionEditorWidget.btnAcceptClick(Sender: TObject); procedure TOptionEditorWidget.btnAcceptClick(Sender: TObject);
begin begin
if selCat.Selected.isNil or selcat.Selected.Data.isNil then if selCat.Selected.isNotAssigned or selcat.Selected.Data.isNotAssigned then
exit; exit;
fCatChanged := false; fCatChanged := false;
if inspector.Parent.isNotNil then if inspector.Parent.isAssigned then
inspector.ItemIndex := -1; inspector.ItemIndex := -1;
PCategoryData(selCat.Selected.Data)^ PCategoryData(selCat.Selected.Data)^
.observer .observer

View File

@ -5,7 +5,7 @@ unit u_processes;
interface interface
uses uses
Classes, SysUtils, ExtCtrls, process, asyncprocess, pipes; Classes, SysUtils, ExtCtrls, process, asyncprocess, pipes, u_common;
type type
@ -240,9 +240,9 @@ begin
if not (poUsePipes in Options) then if not (poUsePipes in Options) then
exit; exit;
if assigned(Output) then if Output.isAssigned then
fill(Output, StdoutEx); fill(Output, StdoutEx);
if assigned(Stderr) then if Stderr.isAssigned then
fill(Stderr, stderrEx); fill(Stderr, stderrEx);
end; end;
@ -342,7 +342,7 @@ procedure TDexedProcess.checkTerminated(sender: TObject);
begin begin
if Running then if Running then
begin begin
if assigned(Output) and assigned(StdErr) then if Output.isAssigned and StdErr.isAssigned then
if Output.NumBytesAvailable + Stderr.NumBytesAvailable > 0 then if Output.NumBytesAvailable + Stderr.NumBytesAvailable > 0 then
internalDoOnReadData(self); internalDoOnReadData(self);
exit; exit;

View File

@ -120,18 +120,18 @@ begin
// TODO-cfeature: process list, imply that each TDexedMemo must have its own runnable TProcess // TODO-cfeature: process list, imply that each TDexedMemo must have its own runnable TProcess
// currently they share the CEMainForm.fRunProc variable. // currently they share the CEMainForm.fRunProc variable.
if fProc.isNotNil then if fProc.isAssigned then
if fProc.Running then if fProc.Running then
fProc.Terminate(0); fProc.Terminate(0);
txtExeName.Caption := 'no process'; txtExeName.Caption := 'no process';
fProc := nil; fProc := nil;
if process.isNil then if process.isNotAssigned then
exit; exit;
if not (poUsePipes in process.Options) then if not (poUsePipes in process.Options) then
exit; exit;
fProc := process; fProc := process;
if fProc.isNotNil then if fProc.isAssigned then
Panel1.Enabled:=true; Panel1.Enabled:=true;
txtExeName.Caption := shortenPath(fProc.Executable); txtExeName.Caption := shortenPath(fProc.Executable);
end; end;
@ -153,7 +153,7 @@ procedure TProcInputWidget.sendInput;
var var
inp: string; inp: string;
begin begin
if fProc.Input.isNil or fProc.Input.Handle.equals(0) then if fProc.Input.isNotAssigned or fProc.Input.Handle.equals(0) then
exit; exit;
fMru.Insert(0,txtInp.Text); fMru.Insert(0,txtInp.Text);
@ -168,20 +168,20 @@ end;
procedure TProcInputWidget.btnSendClick(Sender: TObject); procedure TProcInputWidget.btnSendClick(Sender: TObject);
begin begin
if fProc.isNotNil then if fProc.isAssigned then
sendInput; sendInput;
end; end;
procedure TProcInputWidget.btnCloseClick(Sender: TObject); procedure TProcInputWidget.btnCloseClick(Sender: TObject);
begin begin
if fProc.isNotNil and fProc.Input.isNotNil and if fProc.isAssigned and fProc.Input.isAssigned and
(fProc.Input.Handle <> 0) then (fProc.Input.Handle <> 0) then
fProc.CloseInput; fProc.CloseInput;
end; end;
procedure TProcInputWidget.btnKillClick(Sender: TObject); procedure TProcInputWidget.btnKillClick(Sender: TObject);
begin begin
if fProc.isNotNil then if fProc.isAssigned then
fProc.Terminate(0); fProc.Terminate(0);
end; end;
@ -190,7 +190,7 @@ procedure TProcInputWidget.txtInpKeyDown(Sender: TObject; var Key: Word;
begin begin
case Key of case Key of
VK_RETURN: VK_RETURN:
if fProc.isNotNil then if fProc.isAssigned then
sendInput; sendInput;
VK_UP: begin VK_UP: begin
fMruPos += 1; fMruPos += 1;

View File

@ -205,36 +205,36 @@ inherited ProfileViewerWidget: TProfileViewerWidget
end end
end end
inherited contextMenu: TPopupMenu inherited contextMenu: TPopupMenu
left = 8 Left = 8
top = 48 Top = 48
end end
object datNumCalls: TListChartSource[2] object datNumCalls: TListChartSource[2]
Sorted = True Sorted = True
left = 192 Left = 192
top = 56 Top = 56
end end
object datTreeTime: TListChartSource[3] object datTreeTime: TListChartSource[3]
Sorted = True Sorted = True
left = 232 Left = 232
top = 56 Top = 56
end end
object datFuncTime: TListChartSource[4] object datFuncTime: TListChartSource[4]
Sorted = True Sorted = True
left = 272 Left = 272
top = 56 Top = 56
end end
object datPerCall: TListChartSource[5] object datPerCall: TListChartSource[5]
Sorted = True Sorted = True
left = 312 Left = 312
top = 56 Top = 56
end end
object ImageList1: TImageList[6] object ImageList1: TImageList[6]
left = 192 Left = 192
top = 120 Top = 120
end end
object ChartToolset1: TChartToolset[7] object ChartToolset1: TChartToolset[7]
left = 232 Left = 232
top = 120 Top = 120
object ChartToolset1DataPointHintTool1: TDataPointHintTool object ChartToolset1DataPointHintTool1: TDataPointHintTool
end end
end end

View File

@ -291,7 +291,7 @@ procedure TProfileViewerWidget.btnProjClick(Sender: TObject);
var var
fname: string; fname: string;
begin begin
if assigned(fProj) then if fProj.isAssigned then
begin begin
fname := fProj.outputFilename.extractFileDir + DirectorySeparator + 'trace.log'; fname := fProj.outputFilename.extractFileDir + DirectorySeparator + 'trace.log';
if fileExists(fname) then if fileExists(fname) then

View File

@ -169,7 +169,7 @@ inherited ProjectGroupWidget: TProjectGroupWidget
end end
end end
inherited contextMenu: TPopupMenu inherited contextMenu: TPopupMenu
left = 272 Left = 272
top = 56 Top = 56
end end
end end

View File

@ -194,7 +194,7 @@ end;
procedure TProjectGroup.projNew(project: ICommonProject); procedure TProjectGroup.projNew(project: ICommonProject);
begin begin
if (project <> nil) and not project.inGroup then if project.isAssigned and not project.inGroup then
fFreeStanding := project; fFreeStanding := project;
end; end;
@ -202,11 +202,11 @@ procedure TProjectGroup.projChanged(project: ICommonProject);
var var
itm: TProjectGroupItem; itm: TProjectGroupItem;
begin begin
if assigned(project) and project.inGroup and (project.getFormat = pfDUB) then if project.isAssigned and project.inGroup and (project.getFormat = pfDUB) then
begin begin
itm := Self.addItem(project.filename); itm := Self.addItem(project.filename);
if assigned(itm) then if itm.isAssigned then
itm.configurationIndex:=project.getActiveConfigurationIndex; itm.configurationIndex := project.getActiveConfigurationIndex;
end; end;
end; end;
@ -270,7 +270,7 @@ begin
result.fFilename := fname result.fFilename := fname
else else
result.fFilename := ExtractRelativepath(fBasePath, fname); result.fFilename := ExtractRelativepath(fBasePath, fname);
if assigned(fFreeStanding) and SameFileName(fname, fFreeStanding.filename) then if fFreeStanding.isAssigned and SameFileName(fname, fFreeStanding.filename) then
begin begin
result.fProj := fFreeStanding; result.fProj := fFreeStanding;
fFreeStanding.inGroup(true); fFreeStanding.inGroup(true);
@ -294,7 +294,7 @@ var
begin begin
result := false; result := false;
p := item[ix].project; p := item[ix].project;
if assigned(p) and (p.modified) then if p.isAssigned and p.modified then
result := true result := true
end; end;
@ -329,7 +329,7 @@ begin
p := item[i]; p := item[i];
p.fGroup := self; p.fGroup := self;
p.filename := patchPlateformPath(p.filename); p.filename := patchPlateformPath(p.filename);
if assigned(fFreeStanding) and (p.absoluteFilename = fFreeStanding.filename) then if fFreeStanding.isAssigned and (p.absoluteFilename = fFreeStanding.filename) then
begin begin
p.fProj := fFreeStanding; p.fProj := fFreeStanding;
fFreeStanding.inGroup(true); fFreeStanding.inGroup(true);
@ -344,13 +344,13 @@ begin
end; end;
end; end;
if fProjectIndex > projectCount -1 then if fProjectIndex > projectCount -1 then
fProjectIndex:= projectCount -1; fProjectIndex := projectCount -1;
fSavedIndex := fProjectIndex; fSavedIndex := fProjectIndex;
fModified := b; fModified := b;
if b then if b then
dlgOkError('the following projects are missing and are removed from the group:' + f, dlgOkError('the following projects are missing and are removed from the group:' + f,
'Project group error'); 'Project group error');
if not assigned(fFreeStanding) then if fFreeStanding.isNotAssigned then
begin begin
item[fSavedIndex].lazyLoad; item[fSavedIndex].lazyLoad;
item[fSavedIndex].project.activate; item[fSavedIndex].project.activate;

View File

@ -131,7 +131,7 @@ inherited ProjectInspectWidget: TProjectInspectWidget
end end
end end
inherited contextMenu: TPopupMenu inherited contextMenu: TPopupMenu
left = 128 Left = 128
top = 48 Top = 48
end end
end end

View File

@ -279,7 +279,7 @@ end;
procedure TProjectInspectWidget.projClosing(project: ICommonProject); procedure TProjectInspectWidget.projClosing(project: ICommonProject);
begin begin
if not assigned(fProj) then if fProj.isNotAssigned then
exit; exit;
if project <> fProj then if project <> fProj then
exit; exit;
@ -301,7 +301,7 @@ end;
procedure TProjectInspectWidget.projChanged(project: ICommonProject); procedure TProjectInspectWidget.projChanged(project: ICommonProject);
begin begin
if not assigned(fProj) then if fProj.isNotAssigned then
exit; exit;
if fProj <> project then if fProj <> project then
exit; exit;
@ -359,7 +359,7 @@ end;
procedure TProjectInspectWidget.TreeClick(Sender: TObject); procedure TProjectInspectWidget.TreeClick(Sender: TObject);
begin begin
if Tree.Selected.isNotNil then if Tree.Selected.isAssigned then
begin begin
Tree.MultiSelect := Tree.Selected.Parent = fFileNode; Tree.MultiSelect := Tree.Selected.Parent = fFileNode;
if not (Tree.Selected.Parent = fFileNode) then if not (Tree.Selected.Parent = fFileNode) then
@ -379,14 +379,14 @@ end;
procedure TProjectInspectWidget.TreeDeletion(Sender: TObject; Node: TTreeNode procedure TProjectInspectWidget.TreeDeletion(Sender: TObject; Node: TTreeNode
); );
begin begin
if Node.isNotNil and Node.Data.isNotNil then if Node.isAssigned and Node.Data.isAssigned then
dispose(PString(Node.Data)); dispose(PString(Node.Data));
end; end;
procedure TProjectInspectWidget.TreeSelectionChanged(Sender: TObject); procedure TProjectInspectWidget.TreeSelectionChanged(Sender: TObject);
begin begin
actUpdate(sender); actUpdate(sender);
if not assigned(fProj) or Tree.Selected.isNil then if fProj.isNotAssigned or Tree.Selected.isNotAssigned then
exit; exit;
if (Tree.Selected.Parent = fFileNode) then if (Tree.Selected.Parent = fFileNode) then
fLastFileOrFolder := expandFilenameEx(fProj.basePath,tree.Selected.Text) fLastFileOrFolder := expandFilenameEx(fProj.basePath,tree.Selected.Text)
@ -399,12 +399,12 @@ var
fname: string; fname: string;
i: integer; i: integer;
begin begin
if not assigned(fProj) or Tree.Selected.isNil then if fProj.isNotAssigned or Tree.Selected.isNotAssigned then
exit; exit;
if Tree.Selected.Parent <> fConfNode then if Tree.Selected.Parent <> fConfNode then
begin begin
if Tree.Selected.Data.isNotNil then if Tree.Selected.Data.isAssigned then
begin begin
fname := PString(Tree.Selected.Data)^; fname := PString(Tree.Selected.Data)^;
if isEditable(fname.extractFileExt) and fname.fileExists then if isEditable(fname.extractFileExt) and fname.fileExists then
@ -424,7 +424,7 @@ begin
fActSelConf.Enabled := false; fActSelConf.Enabled := false;
fActOpenFile.Enabled := false; fActOpenFile.Enabled := false;
fActBuildConf.Enabled:= false; fActBuildConf.Enabled:= false;
if Tree.Selected.isNil then if Tree.Selected.isNotAssigned then
exit; exit;
fActSelConf.Enabled := Tree.Selected.Parent = fConfNode; fActSelConf.Enabled := Tree.Selected.Parent = fConfNode;
fActBuildConf.Enabled := Tree.Selected.Parent = fConfNode; fActBuildConf.Enabled := Tree.Selected.Parent = fConfNode;
@ -434,9 +434,9 @@ end;
procedure TProjectInspectWidget.DetectNewDubSources(const document: TDexedMemo procedure TProjectInspectWidget.DetectNewDubSources(const document: TDexedMemo
); );
begin begin
if not assigned(fProj) or (fProj.getFormat <> pfDUB) then if fProj.isNotAssigned or (fProj.getFormat <> pfDUB) then
exit; exit;
if document.isNotNil then if document.isAssigned then
begin begin
if document.fileName.contains(fProj.basePath) then if document.fileName.contains(fProj.basePath) then
TDubProject(fProj.getProject).updateSourcesList; TDubProject(fProj.getProject).updateSourcesList;
@ -450,7 +450,7 @@ var
fname: string; fname: string;
proj: TNativeProject; proj: TNativeProject;
begin begin
if not assigned(fProj) or (fProj.getFormat = pfDUB) then if fProj.isNotAssigned or (fProj.getFormat = pfDUB) then
exit; exit;
proj := TNativeProject(fProj.getProject); proj := TNativeProject(fProj.getProject);
@ -481,7 +481,7 @@ var
proj: TNativeProject; proj: TNativeProject;
i: integer; i: integer;
begin begin
if not assigned(fProj) or (fProj.getFormat = pfDUB) then if fProj.isNotAssigned or (fProj.getFormat = pfDUB) then
exit; exit;
dir := ''; dir := '';
@ -517,8 +517,8 @@ var
proj: TNativeProject; proj: TNativeProject;
i: Integer; i: Integer;
begin begin
if not assigned(fProj) or (fProj.getFormat = pfDUB) if fProj.isNotAssigned or (fProj.getFormat = pfDUB)
or Tree.Selected.isNil or (Tree.Selected.Parent <> fFileNode) then or Tree.Selected.isNotAssigned or (Tree.Selected.Parent <> fFileNode) then
exit; exit;
proj := TNativeProject(fProj.getProject); proj := TNativeProject(fProj.getProject);
@ -547,16 +547,16 @@ procedure TProjectInspectWidget.btnReloadClick(Sender: TObject);
var var
f: string; f: string;
begin begin
if assigned(fProj) then if fProj.isNotAssigned then
begin exit;
f := fProj.filename;
if not f.fileExists then f := fProj.filename;
exit; if not f.fileExists then
if fProj.modified and exit;
(dlgYesNo('The project seems to be modified, save before reloading') = mrYes) then if fProj.modified and
fProj.saveToFile(f); (dlgYesNo('The project seems to be modified, save before reloading') = mrYes) then
fProj.loadFromFile(f); fProj.saveToFile(f);
end; fProj.loadFromFile(f);
end; end;
procedure TProjectInspectWidget.btnRemFileClick(Sender: TObject); procedure TProjectInspectWidget.btnRemFileClick(Sender: TObject);
@ -565,8 +565,8 @@ var
proj: TNativeProject; proj: TNativeProject;
i, j: integer; i, j: integer;
begin begin
if not assigned(fProj) or (fProj.getFormat = pfDUB) if fProj.isNotAssigned or (fProj.getFormat = pfDUB)
or Tree.Selected.isNil or (Tree.Selected.Parent <> fFileNode) then or Tree.Selected.isNotAssigned or (Tree.Selected.Parent <> fFileNode) then
exit; exit;
proj := TNativeProject(fProj.getProject); proj := TNativeProject(fProj.getProject);
@ -612,7 +612,7 @@ begin
getMultiDocHandler.openDocument(value); getMultiDocHandler.openDocument(value);
end; end;
begin begin
if not assigned(fProj) or (fProj.getFormat = pfDUB) then if fProj.isNotAssigned or (fProj.getFormat = pfDUB) then
exit; exit;
proj := TNativeProject(fProj.getProject); proj := TNativeProject(fProj.getProject);
@ -654,12 +654,12 @@ var
fld: string; fld: string;
rng: TStringRange = (ptr:nil; pos:0; len:0); rng: TStringRange = (ptr:nil; pos:0; len:0);
begin begin
if Tree.Selected.isNotNil then if Tree.Selected.isAssigned then
sel := Tree.Selected.GetTextPath; sel := Tree.Selected.GetTextPath;
fConfNode.DeleteChildren; fConfNode.DeleteChildren;
fFileNode.DeleteChildren; fFileNode.DeleteChildren;
if not assigned(fProj) then if fProj.isNotAssigned then
exit; exit;
Tree.BeginUpdate; Tree.BeginUpdate;
@ -685,9 +685,9 @@ begin
chd := nil; chd := nil;
fld := rng.takeUntil(['/','\']).yield; fld := rng.takeUntil(['/','\']).yield;
chd := itm.FindNode(fld); chd := itm.FindNode(fld);
if chd.isNil and ((rng.empty and j.equals(1)) or (not rng.empty and j.equals(0))) then if chd.isNotAssigned and ((rng.empty and j.equals(1)) or (not rng.empty and j.equals(0))) then
chd := Tree.Items.AddChild(itm, fld); chd := Tree.Items.AddChild(itm, fld);
if chd.isNotNil then if chd.isAssigned then
itm := chd; itm := chd;
// reached fname // reached fname
if rng.empty and j.equals(1) then if rng.empty and j.equals(1) then
@ -728,7 +728,7 @@ begin
if sel.isNotEmpty then if sel.isNotEmpty then
begin begin
itm := Tree.Items.FindNodeWithTextPath(sel); itm := Tree.Items.FindNodeWithTextPath(sel);
if itm.isNotNil then if itm.isAssigned then
begin begin
itm.Selected := true; itm.Selected := true;
itm.MakeVisible; itm.MakeVisible;

View File

@ -129,7 +129,7 @@ begin
for i:= 0 to project.sourcesCount-1 do for i:= 0 to project.sourcesCount-1 do
begin begin
doc := mdh.findDocument(project.sourceAbsolute(i)); doc := mdh.findDocument(project.sourceAbsolute(i));
if doc.isNotNil and doc.modified then if doc.isAssigned and doc.modified then
doc.save; doc.save;
end; end;
end; end;
@ -166,7 +166,7 @@ begin
result := ''; result := '';
if clbck.isNil then if clbck.isNotAssigned then
clbck := TLexNameCallback.Create; clbck := TLexNameCallback.Create;
// 1 source, same folder // 1 source, same folder

View File

@ -389,7 +389,7 @@ var
m: IMessagesDisplay; m: IMessagesDisplay;
h: IMultiDocHandler; h: IMultiDocHandler;
begin begin
if (fDoc.isNil and (fFindScope <> scProj)) or if (fDoc.isNotAssigned and (fFindScope <> scProj)) or
((fProj = nil) and (fFindScope = scProj)) then ((fProj = nil) and (fFindScope = scProj)) then
exit; exit;
@ -561,7 +561,7 @@ const
var var
s: string; s: string;
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
fSearchMru.Insert(0, fToFind); fSearchMru.Insert(0, fToFind);
@ -606,7 +606,7 @@ end;
procedure TSearchWidget.actReplaceNextExecute(sender: TObject); procedure TSearchWidget.actReplaceNextExecute(sender: TObject);
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
fSearchMru.Insert(0, fToFind); fSearchMru.Insert(0, fToFind);
@ -640,7 +640,7 @@ procedure TSearchWidget.actReplaceAllExecute(sender: TObject);
var var
opts: TSynSearchOptions; opts: TSynSearchOptions;
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
fDocSelStart := fDoc.BlockBegin; fDocSelStart := fDoc.BlockBegin;
@ -828,14 +828,14 @@ var
canAll: boolean; canAll: boolean;
hasTxt: boolean; hasTxt: boolean;
begin begin
canAll := ((fDoc.isNotNil and (fFindScope <> scProj)) or canAll := ((fDoc.isAssigned and (fFindScope <> scProj)) or
((fFindScope = scProj) and (fProj <> nil))); ((fFindScope = scProj) and (fProj <> nil)));
hasTxt := fToFind.isNotEmpty and not fToFind.isBlank; hasTxt := fToFind.isNotEmpty and not fToFind.isBlank;
btnFind.Enabled := fDoc.isNotNil and hasTxt; btnFind.Enabled := fDoc.isAssigned and hasTxt;
btnFindAll.Enabled := canAll and hasTxt; btnFindAll.Enabled := canAll and hasTxt;
btnReplace.Enabled := fDoc.isNotNil and chkEnableRep.Checked and fToFind.isNotEmpty; btnReplace.Enabled := fDoc.isAssigned and chkEnableRep.Checked and fToFind.isNotEmpty;
btnReplaceAll.Enabled := btnReplace.Enabled; btnReplaceAll.Enabled := btnReplace.Enabled;
cbReplaceWth.Enabled := fDoc.isNotNil and chkEnableRep.Checked; cbReplaceWth.Enabled := fDoc.isAssigned and chkEnableRep.Checked;
cbToFind.Enabled := canAll; cbToFind.Enabled := canAll;
end; end;
{$ENDREGION} {$ENDREGION}

View File

@ -239,7 +239,7 @@ end;
function TShortcutEditor.anItemIsSelected: boolean; function TShortcutEditor.anItemIsSelected: boolean;
begin begin
result := true; result := true;
if tree.Selected.isNil or tree.Selected.Level.equals(0) or tree.Selected.Data.isNil then if tree.Selected.isNotAssigned or tree.Selected.Level.equals(0) or tree.Selected.Data.isNotAssigned then
result := false; result := false;
end; end;
{$ENDREGION} {$ENDREGION}
@ -336,7 +336,7 @@ begin
for j := 0 to n.Count-1 do for j := 0 to n.Count-1 do
begin begin
o := n.Items[j]; o := n.Items[j];
if o.Data.isNil then if o.Data.isNotAssigned then
continue; continue;
if TShortcutItem(o.Data).data = s then if TShortcutItem(o.Data).data = s then
begin begin
@ -352,12 +352,12 @@ begin
if i = tree.Selected.Index then if i = tree.Selected.Index then
continue; continue;
o := tree.Selected.Parent.Items[i]; o := tree.Selected.Parent.Items[i];
if o.Data.isNil then if o.Data.isNotAssigned then
continue; continue;
if TShortcutItem(o.Data).data = s then if TShortcutItem(o.Data).data = s then
d := TShortcutItem(o.Data); d := TShortcutItem(o.Data);
end; end;
if d.isNotNil then if d.isAssigned then
dlgOkInfo(format(m2,[t, d.identifier])) dlgOkInfo(format(m2,[t, d.identifier]))
else if TShortcutItem(tree.Selected.Data).data <> s then else if TShortcutItem(tree.Selected.Data).data <> s then
begin begin
@ -395,11 +395,11 @@ begin
exit(true); exit(true);
// keep categories // keep categories
if ItemNode.Parent.isNil then if ItemNode.Parent.isNotAssigned then
exit(true); exit(true);
b := AnsiContainsText(ItemNode.Text, fltItems.Filter); b := AnsiContainsText(ItemNode.Text, fltItems.Filter);
if ItemNode.Data.isNil then if ItemNode.Data.isNotAssigned then
exit(b); exit(b);
s := TShortcutItem(ItemNode.Data); s := TShortcutItem(ItemNode.Data);
result := AnsiContainsText(s.combination, fltItems.Filter) or b; result := AnsiContainsText(s.combination, fltItems.Filter) or b;
@ -469,7 +469,7 @@ var
if item.category.isEmpty or item.identifier.isEmpty then if item.category.isEmpty or item.identifier.isEmpty then
exit; exit;
prt := findCategory(item.category, o); prt := findCategory(item.category, o);
if prt.isNil then if prt.isNotAssigned then
prt := tree.Items.AddObject(nil, item.category, o); prt := tree.Items.AddObject(nil, item.category, o);
// item as child // item as child
s := TShortcutItem(fShortcuts.items.Add); s := TShortcutItem(fShortcuts.items.Add);
@ -511,7 +511,7 @@ begin
s := fShortcuts[i]; s := fShortcuts[i];
d := s.declarator; d := s.declarator;
c := findCategory(s); c := findCategory(s);
if not assigned(d) or c.isEmpty() then if d.isNotAssigned or c.isEmpty() then
continue; continue;
n.identifier:= s.identifier; n.identifier:= s.identifier;
n.category := c; n.category := c;

View File

@ -523,7 +523,7 @@ end;
procedure TSymbolListWidget.actCopyIdentExecute(Sender: TObject); procedure TSymbolListWidget.actCopyIdentExecute(Sender: TObject);
begin begin
if Tree.Selected.isNotNil then if Tree.Selected.isAssigned then
Clipboard.AsText:= Tree.Selected.Text; Clipboard.AsText:= Tree.Selected.Text;
end; end;
{$ENDREGION} {$ENDREGION}
@ -630,7 +630,7 @@ end;
procedure TSymbolListWidget.updateVisibleCat; procedure TSymbolListWidget.updateVisibleCat;
begin begin
if fDoc.isNotNil and fDoc.isDSource then if fDoc.isAssigned and fDoc.isDSource then
begin begin
ndAlias.Visible := ndAlias.Count > 0; ndAlias.Visible := ndAlias.Count > 0;
ndClass.Visible := ndClass.Count > 0; ndClass.Visible := ndClass.Count > 0;
@ -697,7 +697,7 @@ begin
if TreeFilterEdit1.Filter.isNotEmpty then if TreeFilterEdit1.Filter.isNotEmpty then
tree.FullExpand tree.FullExpand
else if tree.Selected.isNil then else if tree.Selected.isNotAssigned then
tree.FullCollapse tree.FullCollapse
else tree.MakeSelectionVisible; else tree.MakeSelectionVisible;
result := false; result := false;
@ -721,7 +721,7 @@ procedure TSymbolListWidget.TreeDblClick(Sender: TObject);
var var
line: PtrUInt; line: PtrUInt;
begin begin
if fDoc.isNil or Tree.Selected.isNil or Tree.Selected.Data.isNil then if fDoc.isNotAssigned or Tree.Selected.isNotAssigned or Tree.Selected.Data.isNotAssigned then
exit; exit;
{$PUSH}{$WARNINGS OFF}{$HINTS OFF} {$PUSH}{$WARNINGS OFF}{$HINTS OFF}
@ -736,7 +736,7 @@ procedure TSymbolListWidget.getSymbols;
begin begin
if fLockThreadedParsing then if fLockThreadedParsing then
exit; exit;
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
if fDoc.Lines.Count.equals(0) or not fDoc.isDSource then if fDoc.Lines.Count.equals(0) or not fDoc.isDSource then
begin begin
@ -760,7 +760,7 @@ procedure TSymbolListWidget.threadedParsingFinished(sender: TObject);
function newCat(const aCat: string): TTreeNode; function newCat(const aCat: string): TTreeNode;
begin begin
result := node.FindNode(aCat); result := node.FindNode(aCat);
if result.isNil then if result.isNotAssigned then
result := node.TreeNodes.AddChild(node, aCat); result := node.TreeNodes.AddChild(node, aCat);
case stype of case stype of
_alias : begin result.ImageIndex:=0; result.SelectedIndex:=0; end; _alias : begin result.ImageIndex:=0; result.SelectedIndex:=0; end;
@ -782,7 +782,7 @@ procedure TSymbolListWidget.threadedParsingFinished(sender: TObject);
begin begin
result := nil; result := nil;
if node.isNil then if node.isNotAssigned then
case stype of case stype of
_alias : exit(ndAlias); _alias : exit(ndAlias);
_class : exit(ndClass); _class : exit(ndClass);
@ -841,10 +841,10 @@ var
n: TTreeNode; n: TTreeNode;
begin begin
fLockThreadedParsing := false; fLockThreadedParsing := false;
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
if fTreeDataFromThread.isEmpty or ndAlias.isNil then if fTreeDataFromThread.isEmpty or ndAlias.isNotAssigned then
exit; exit;
tree.BeginUpdate; tree.BeginUpdate;
@ -893,9 +893,9 @@ var
for i := 0 to root.Count-1 do for i := 0 to root.Count-1 do
begin begin
n := root.Items[i]; n := root.Items[i];
if n.Data.isNil then if n.Data.isNotAssigned then
continue; continue;
if n.Parent.isNil then if n.Parent.isNotAssigned then
continue; continue;
if (n.Parent = ndAlias) if (n.Parent = ndAlias)
or (n.Parent = ndEnum) or (n.Parent = ndEnum)
@ -916,13 +916,13 @@ var
end; end;
begin begin
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
target := fDoc.CaretY; target := fDoc.CaretY;
for i := 0 to tree.Items.Count-1 do for i := 0 to tree.Items.Count-1 do
look(tree.Items[i]); look(tree.Items[i]);
if toExpand.isNotNil then if toExpand.isAssigned then
begin begin
tree.Selected := toExpand; tree.Selected := toExpand;
toExpand.MakeVisible; toExpand.MakeVisible;

View File

@ -153,7 +153,7 @@ end;
procedure TSymbolExpander.docFocused(document: TDexedMemo); procedure TSymbolExpander.docFocused(document: TDexedMemo);
begin begin
if (document.isNotNil) and (fDoc = document) then if document.isAssigned and (fDoc = document) then
exit; exit;
fDoc := document; fDoc := document;
fNeedUpdate := true; fNeedUpdate := true;
@ -189,16 +189,16 @@ begin
exit; exit;
fNeedUpdate := false; fNeedUpdate := false;
hasNativeProj := fProj.isNotNil; hasNativeProj := fProj.isAssigned;
hasProjItf := fProjInterface <> nil; hasProjItf := fProjInterface <> nil;
hasDoc := fDoc.isNotNil; hasDoc := fDoc.isAssigned;
if not assigned(fExp) then if fExp.isNotAssigned then
fExp := getExplorer; fExp := getExplorer;
for e := FirstVariableSymbol to high(TExpandableSymbol) do for e := FirstVariableSymbol to high(TExpandableSymbol) do
fSymbols[e] := na; fSymbols[e] := na;
if assigned(fExp) then if fExp.isAssigned then
fSymbols[MEP] := fExp.currentLocation; fSymbols[MEP] := fExp.currentLocation;
// document // document

View File

@ -823,7 +823,7 @@ var
i, start, prev: Integer; i, start, prev: Integer;
itm : TFoldCache; itm : TFoldCache;
begin begin
if fMemo.isNil then if fMemo.isNotAssigned then
exit; exit;
fCaretPosition := fMemo.SelStart; fCaretPosition := fMemo.SelStart;
@ -854,7 +854,7 @@ var
i: integer; i: integer;
itm : TFoldCache; itm : TFoldCache;
begin begin
if fMemo.isNil then if fMemo.isNotAssigned then
exit; exit;
if fFontSize > 0 then if fFontSize > 0 then
@ -1008,12 +1008,12 @@ begin
fMemo.Font.Assign(fSource.Font); fMemo.Font.Assign(fSource.Font);
fMemo.Lines := fSource.Lines; fMemo.Lines := fSource.Lines;
width := fSource.Width div 2; width := fSource.Width div 2;
if fSource.Highlighter.isNotNil then if fSource.Highlighter.isAssigned then
begin begin
fMemo.Color:= fSource.Color; fMemo.Color:= fSource.Color;
fMemo.LineHighlightColor.Assign(fSource.LineHighlightColor); fMemo.LineHighlightColor.Assign(fSource.LineHighlightColor);
fMemo.SelectedColor.Assign(fSource.SelectedColor); fMemo.SelectedColor.Assign(fSource.SelectedColor);
if fMemo.Highlighter.isNil then if fMemo.Highlighter.isNotAssigned then
begin begin
fD2Hl.Assign(fSource.Highlighter); fD2Hl.Assign(fSource.Highlighter);
fTxtHl.Assign(fSource.Highlighter); fTxtHl.Assign(fSource.Highlighter);
@ -2573,7 +2573,7 @@ end;
procedure TDexedMemo.sortLines; procedure TDexedMemo.sortLines;
begin begin
if not assigned(fSortDialog) then if fSortDialog.isNotAssigned then
fSortDialog := TSortDialog.construct(self); fSortDialog := TSortDialog.construct(self);
fSortDialog.Show; fSortDialog.Show;
end; end;
@ -2683,14 +2683,14 @@ end;
{$REGION DDoc & CallTip --------------------------------------------------------} {$REGION DDoc & CallTip --------------------------------------------------------}
procedure TDexedMemo.InitHintWins; procedure TDexedMemo.InitHintWins;
begin begin
if fCallTipWin.isNil then if fCallTipWin.isNotAssigned then
begin begin
fCallTipWin := TEditorCallTipWindow.Create(self); fCallTipWin := TEditorCallTipWindow.Create(self);
fCallTipWin.Color := clInfoBk + $01010100; fCallTipWin.Color := clInfoBk + $01010100;
fCallTipWin.Font.Color:= clInfoText; fCallTipWin.Font.Color:= clInfoText;
fCallTipWin.AutoHide:=false; fCallTipWin.AutoHide:=false;
end; end;
if fDDocWin.isNil then if fDDocWin.isNotAssigned then
begin begin
fDDocWin := TEditorHintWindow.Create(self); fDDocWin := TEditorHintWindow.Create(self);
fDDocWin.Color := clInfoBk + $01010100; fDDocWin.Color := clInfoBk + $01010100;
@ -2768,7 +2768,7 @@ begin
if not fIsDSource and not alwaysAdvancedFeatures then if not fIsDSource and not alwaysAdvancedFeatures then
exit; exit;
if assigned(fDebugger) and fDebugger.running then if fDebugger.isAssigned and fDebugger.running then
begin begin
lexWholeText([TLexOption.lxoNoComments]); lexWholeText([TLexOption.lxoNoComments]);
exp := getExpressionAt(fLexToks, fMouseLogical); exp := getExpressionAt(fLexToks, fMouseLogical);
@ -3129,7 +3129,7 @@ begin
begin begin
if fSmartDdocNewline and not (eoAutoIndent in Options) then if fSmartDdocNewline and not (eoAutoIndent in Options) then
Options := Options + [eoAutoIndent]; Options := Options + [eoAutoIndent];
if Beautifier.isNotNil and (Beautifier is TSynBeautifier) then if Beautifier.isAssigned and (Beautifier is TSynBeautifier) then
begin begin
if not (eoTabsToSpaces in Options) and not (eoSpacesToTabs in Options) then if not (eoTabsToSpaces in Options) and not (eoSpacesToTabs in Options) then
TSynBeautifier(Beautifier).IndentType := sbitConvertToTabOnly TSynBeautifier(Beautifier).IndentType := sbitConvertToTabOnly
@ -3819,7 +3819,7 @@ var
s: integer; s: integer;
t: integer; t: integer;
begin begin
if fLifeTimeManager.isNotNil and not fIdentDialShown and (lines.Count <> 0) and if fLifeTimeManager.isAssigned and not fIdentDialShown and (lines.Count <> 0) and
((fLifeTimeManager as ILifetimeManager).getLifetimeStatus = lfsLoaded) ((fLifeTimeManager as ILifetimeManager).getLifetimeStatus = lfsLoaded)
then then
begin begin
@ -3873,7 +3873,7 @@ begin
if findBreakPoint(line) then if findBreakPoint(line) then
exit; exit;
addGutterIcon(line, giBreakSet); addGutterIcon(line, giBreakSet);
if assigned(fDebugger) then if fDebugger.isAssigned then
fDebugger.addBreakPoint(fFilename, line, bpkBreak); fDebugger.addBreakPoint(fFilename, line, bpkBreak);
end; end;
@ -3887,7 +3887,7 @@ begin
removeGutterIcon(line, giBreakSet); removeGutterIcon(line, giBreakSet);
if fDscannerEnabled and lineHasDscannerWarning(line) then if fDscannerEnabled and lineHasDscannerWarning(line) then
addGutterIcon(line, giWarn); addGutterIcon(line, giWarn);
if assigned(fDebugger) then if fDebugger.isAssigned then
begin begin
fDebugger.removeBreakPoint(fFilename, line); fDebugger.removeBreakPoint(fFilename, line);
if break2step and fDebugger.running then if break2step and fDebugger.running then
@ -3928,7 +3928,7 @@ begin
result := false; result := false;
if line <= lines.count then if line <= lines.count then
m := marks.Line[line]; m := marks.Line[line];
if m.isNotNil then if m.isAssigned then
for i := 0 to m.count - 1 do for i := 0 to m.count - 1 do
if (m[i].ImageIndex = integer(value)) then if (m[i].ImageIndex = integer(value)) then
exit(true); exit(true);
@ -3957,7 +3957,7 @@ var
s: boolean = false; s: boolean = false;
begin begin
m := Marks.Line[line]; m := Marks.Line[line];
if m.isNotNil then if m.isAssigned then
for i := 0 to m.Count-1 do for i := 0 to m.Count-1 do
begin begin
n := m.Items[i]; n := m.Items[i];
@ -3982,7 +3982,7 @@ var
i: integer; i: integer;
begin begin
m := Marks.Line[line]; m := Marks.Line[line];
if m.isNotNil then if m.isAssigned then
for i := m.Count-1 downto 0 do for i := m.Count-1 downto 0 do
begin begin
n := m.Items[i]; n := m.Items[i];

View File

@ -339,7 +339,7 @@ procedure TTermWidget.updateScrollBar();
var var
i: TTerminalScrollInfo; i: TTerminalScrollInfo;
begin begin
if fDisableScrollBarSync or not visible or fTerm.isNil then if fDisableScrollBarSync or not visible or fTerm.isNotAssigned then
exit; exit;
i := fTerm.getVScrollInfo(); i := fTerm.getVScrollInfo();
ScrollBar1.SetParams(i.value, i.min, i.max, i.pageSize); ScrollBar1.SetParams(i.value, i.min, i.max, i.pageSize);

View File

@ -99,8 +99,8 @@ inherited TodoListWidget: TTodoListWidget
end end
end end
inherited contextMenu: TPopupMenu inherited contextMenu: TPopupMenu
left = 40 Left = 40
top = 72 Top = 72
object mnuAutoRefresh: TMenuItem[0] object mnuAutoRefresh: TMenuItem[0]
AutoCheck = True AutoCheck = True
Caption = 'Auto resfresh' Caption = 'Auto resfresh'

View File

@ -343,7 +343,7 @@ begin
if fDoc = document then if fDoc = document then
exit; exit;
fDoc := document; fDoc := document;
if fDoc.isNotNil and Visible and fAutoRefresh then if fDoc.isAssigned and Visible and fAutoRefresh then
scanTodoItems(true); scanTodoItems(true);
end; end;
@ -405,11 +405,11 @@ end;
{$REGION Todo list things ------------------------------------------------------} {$REGION Todo list things ------------------------------------------------------}
function TTodoListWidget.getContext: TTodoContext; function TTodoListWidget.getContext: TTodoContext;
begin begin
if (fProj = nil) and fDoc.isNil then if fProj.isNotAssigned and fDoc.isNotAssigned then
exit(tcNone); exit(tcNone);
if (fProj = nil) and fDoc.isNotNil then if fProj.isNotAssigned and fDoc.isAssigned then
exit(tcFile); exit(tcFile);
if (fProj <> nil) and fDoc.isNil then if fProj.isAssigned and fDoc.isNotAssigned then
exit(tcProject); exit(tcProject);
if fProj.isSource(fDoc.fileName) then if fProj.isSource(fDoc.fileName) then
@ -557,7 +557,7 @@ var
itm: TTodoItem; itm: TTodoItem;
fname, ln: string; fname, ln: string;
begin begin
if lstItems.Selected.isNil or lstItems.Selected.Data.isNil then if lstItems.Selected.isNotAssigned or lstItems.Selected.Data.isNotAssigned then
exit; exit;
// the collection will be cleared if a file is opened // the collection will be cleared if a file is opened
@ -568,7 +568,7 @@ begin
ln := itm.line; ln := itm.line;
getMultiDocHandler.openDocument(fname); getMultiDocHandler.openDocument(fname);
if fDoc.isNil then if fDoc.isNotAssigned then
exit; exit;
fDoc.setFocus; fDoc.setFocus;
@ -591,7 +591,7 @@ procedure TTodoListWidget.lstItemsColumnClick(Sender: TObject; Column: TListColu
var var
curr: TListItem; curr: TListItem;
begin begin
if lstItems.Selected.isNil then if lstItems.Selected.isNotAssigned then
exit; exit;
lstItems.BeginUpdate; lstItems.BeginUpdate;
curr := lstItems.Selected; curr := lstItems.Selected;
@ -673,9 +673,9 @@ end;
procedure TTodoListWidget.refreshVisibleColumns; procedure TTodoListWidget.refreshVisibleColumns;
begin begin
if lstItems.isNil then if lstItems.isNotAssigned then
exit; exit;
if lstItems.Columns.isNil then if lstItems.Columns.isNotAssigned then
exit; exit;
if lstItems.ColumnCount <> 6 then if lstItems.ColumnCount <> 6 then
exit; exit;

View File

@ -200,7 +200,7 @@ procedure TToolItem.setToolAlias(value: string);
var var
i: integer = 0; i: integer = 0;
begin begin
while fToolItems.findTool(value).isNotNil do while fToolItems.findTool(value).isAssigned do
begin begin
value += intToStr(i); value += intToStr(i);
i += 1; i += 1;
@ -256,7 +256,7 @@ begin
if fProcess.Executable.fileExists then if fProcess.Executable.fileExists then
begin begin
fProcess.Execute; fProcess.Execute;
if previous.isNotNil and previous.outputToNext if previous.isAssigned and previous.outputToNext
and (poUsePipes in previous.Options) and (poUsePipes in Options) then and (poUsePipes in previous.Options) and (poUsePipes in Options) then
begin begin
setLength(inp, previous.process.StdoutEx.Size); setLength(inp, previous.process.StdoutEx.Size);
@ -310,7 +310,7 @@ begin
if fNextToolAlias.isNotEmpty then if fNextToolAlias.isNotEmpty then
begin begin
nxt := fToolItems.findTool(fNextToolAlias); nxt := fToolItems.findTool(fNextToolAlias);
if nxt.isNotNil then if nxt.isAssigned then
nxt.execute(self); nxt.execute(self);
end; end;
end; end;
@ -351,10 +351,10 @@ var
colitm: TToolItem; colitm: TToolItem;
i: integer; i: integer;
begin begin
if fMenu.isNil then if fMenu.isNotAssigned then
begin begin
mnu := getMainMenu; mnu := getMainMenu;
if not assigned(mnu) then if mnu.isNotAssigned then
exit; exit;
fMenu := mnu.mnuAdd; fMenu := mnu.mnuAdd;
fMenu.Caption:='Custom tools'; fMenu.Caption:='Custom tools';
@ -492,11 +492,11 @@ procedure TTools.executeTool(tool: TToolItem);
var var
txt: string = ''; txt: string = '';
begin begin
if tool.isNil then if tool.isNotAssigned then
exit; exit;
tool.execute(nil); tool.execute(nil);
if (tool.pipeInputKind <> pikNone) and fDoc.isNotNil if (tool.pipeInputKind <> pikNone) and fDoc.isAssigned
and (poUsePipes in tool.options) and tool.fProcess.Input.isNotNil then and (poUsePipes in tool.options) and tool.fProcess.Input.isAssigned then
begin begin
case tool.pipeInputKind of case tool.pipeInputKind of
pikEditor: txt := fDoc.Text; pikEditor: txt := fDoc.Text;

View File

@ -163,7 +163,7 @@ begin
exit; exit;
p := CustomTools.tool[lstTools.ItemIndex].process; p := CustomTools.tool[lstTools.ItemIndex].process;
if p.isNotNil and p.Running then if p.isAssigned and p.Running then
p.Terminate(1); p.Terminate(1);
end; end;

View File

@ -249,13 +249,13 @@ var
begin begin
inherited; inherited;
s := DockMaster.GetAnchorSite(self); s := DockMaster.GetAnchorSite(self);
if s.isNotNil then if s.isAssigned then
n := s.Parent; n := s.Parent;
if fOldSiteParent <> n then if fOldSiteParent <> n then
begin begin
if fOldSiteParent.isNil and n.isNotNil and assigned(fOnDockingChanged) then if fOldSiteParent.isNotAssigned and n.isAssigned and assigned(fOnDockingChanged) then
fOnDockingChanged(self, wdsDocked) fOnDockingChanged(self, wdsDocked)
else if fOldSiteParent.isNotNil and n.isNil and assigned(fOnDockingChanged) then else if fOldSiteParent.isAssigned and n.isNotAssigned and assigned(fOnDockingChanged) then
fOnDockingChanged(self, wdsUndocked) fOnDockingChanged(self, wdsUndocked)
else else
fOnDockingChanged(self, wdsRedocked); fOnDockingChanged(self, wdsRedocked);
@ -289,13 +289,13 @@ begin
fTimerUpdateKind := value; fTimerUpdateKind := value;
if fTimerUpdateKind = tukNone then if fTimerUpdateKind = tukNone then
begin begin
if fUpdateTimer.isNil then if fUpdateTimer.isNotAssigned then
exit; exit;
FreeAndNil(fUpdateTimer); FreeAndNil(fUpdateTimer);
end end
else else
begin begin
if fUpdateTimer.isNil then if fUpdateTimer.isNotAssigned then
fUpdateTimer := TTimer.Create(nil); fUpdateTimer := TTimer.Create(nil);
if fTimerUpdateKind = tukDelay then if fTimerUpdateKind = tukDelay then
begin begin
@ -317,7 +317,7 @@ begin
if fDelayDur = value then if fDelayDur = value then
exit; exit;
fDelayDur := value; fDelayDur := value;
if fUpdateTimer.isNotNil and (fTimerUpdateKind = tukDelay) then if fUpdateTimer.isAssigned and (fTimerUpdateKind = tukDelay) then
fUpdateTimer.Interval := fDelayDur; fUpdateTimer.Interval := fDelayDur;
end; end;
@ -326,7 +326,7 @@ begin
if fLoopInter = value then if fLoopInter = value then
exit; exit;
fLoopInter := value; fLoopInter := value;
if fUpdateTimer.isNotNil and (fTimerUpdateKind = tukLoop) then if fUpdateTimer.isAssigned and (fTimerUpdateKind = tukLoop) then
fUpdateTimer.Interval := fLoopInter; fUpdateTimer.Interval := fLoopInter;
end; end;