style modernisation using helpers isNil & isNotNil

This commit is contained in:
Basile Burg 2016-01-11 00:36:10 +01:00
parent 1bbff471ee
commit 3fa80be500
35 changed files with 322 additions and 298 deletions

View File

@ -36,6 +36,18 @@ type
TCEFilename = type string; TCEFilename = type string;
TCEEditEvent = type boolean; TCEEditEvent = type boolean;
// sugar for classes
TObjectHelper = class helper for TObject
function isNil: boolean;
function isNotNil: boolean;
end;
// sugar for pointers
TPointerHelper = type helper for Pointer
function isNil: boolean;
function isNotNil: boolean;
end;
(** (**
* Workaround for a TAsyncProcess Linux issue: OnTerminate event not called. * Workaround for a TAsyncProcess Linux issue: OnTerminate event not called.
* An idle timer is started when executing and trigs the event if necessary. * An idle timer is started when executing and trigs the event if necessary.
@ -284,6 +296,26 @@ begin
else inherited; else inherited;
end; end;
function TObjectHelper.isNil: boolean;
begin
exit(self = nil);
end;
function TObjectHelper.isNotNil: boolean;
begin
exit(self <> nil);
end;
function TPointerHelper.isNil: boolean;
begin
exit(self = nil);
end;
function TPointerHelper.isNotNil: boolean;
begin
exit(self <> nil);
end;
{$IFDEF LINUX} {$IFDEF LINUX}
constructor TCheckedAsyncProcess.Create(aOwner: TComponent); constructor TCheckedAsyncProcess.Create(aOwner: TComponent);
begin begin

View File

@ -95,7 +95,7 @@ begin
fTempLines := TStringList.Create; fTempLines := TStringList.Create;
fImportCache := TStringList.Create; fImportCache := TStringList.Create;
if (fServer <> nil) then if fServer.isNotNil then
fServer.Execute; fServer.Execute;
updateServerlistening; updateServerlistening;
// //
@ -111,10 +111,11 @@ destructor TCEDcdWrapper.destroy;
begin begin
EntitiesConnector.removeObserver(self); EntitiesConnector.removeObserver(self);
fImportCache.Free; fImportCache.Free;
if fTempLines <> nil then if fTempLines.isNotNil then
fTempLines.Free; fTempLines.Free;
if fServer <> nil then begin if fServer.isNotNil then begin
if not fServerWasRunning then killServer; if not fServerWasRunning then
killServer;
fServer.Free; fServer.Free;
end; end;
fClient.Free; fClient.Free;

View File

@ -1,2 +1,3 @@
{$MODE OBJFPC}{$H+} {$MODE OBJFPC}{$H+}
{$INTERFACES CORBA} {$INTERFACES CORBA}
{$MODESWITCH TYPEHELPERS}

View File

@ -251,7 +251,7 @@ var
prc: TProcess; prc: TProcess;
str: TStringList; str: TStringList;
begin begin
if not assigned(fDoc) then if fDoc.isNil then
exit; exit;
if not exeInSysPath('dfmt') then if not exeInSysPath('dfmt') then
exit; exit;
@ -283,9 +283,8 @@ end;
procedure TCEDfmtWidget.doCancel(sender: TObject); procedure TCEDfmtWidget.doCancel(sender: TObject);
begin begin
if not assigned(fDoc) then if fDoc.isNil then
exit; exit;
fDoc.Lines.Assign(fBackup); fDoc.Lines.Assign(fBackup);
end; end;
{$ENDREGION} {$ENDREGION}

View File

@ -372,7 +372,7 @@ procedure TDocOpts.getOpts(aList: TStrings; base: TOptsGroup = nil);
var var
baseopt: TDocOpts; baseopt: TDocOpts;
begin begin
if base = nil then if base.isNil then
begin begin
if fGenDoc then if fGenDoc then
aList.Add('-D'); aList.Add('-D');
@ -483,7 +483,7 @@ var
const const
DepStr : array[TDepHandling] of string = ('-d', '', '-de'); DepStr : array[TDepHandling] of string = ('-d', '', '-de');
begin begin
if base = nil then if base.isNil then
begin begin
dep := DepStr[fDepHandling]; dep := DepStr[fDepHandling];
if dep <> '' then aList.Add(dep); if dep <> '' then aList.Add(dep);
@ -609,7 +609,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 = nil then if base.isNil then
begin begin
str := binKindStr[fBinKind]; str := binKindStr[fBinKind];
if str <> '' then aList.Add(str); if str <> '' then aList.Add(str);
@ -796,7 +796,7 @@ var
idt: string; idt: string;
baseopt: TDebugOpts; baseopt: TDebugOpts;
begin begin
if base = nil then if base.isNil then
begin begin
if fDebug then aList.Add('-debug'); if fDebug then aList.Add('-debug');
if fDbgLevel <> 0 then if fDbgLevel <> 0 then
@ -926,7 +926,7 @@ var
baseopt: TPathsOpts; baseopt: TPathsOpts;
rightList: TStringList; rightList: TStringList;
begin begin
if base = nil then if base.isNil then
begin begin
exts := TStringList.Create; exts := TStringList.Create;
try try
@ -1093,7 +1093,7 @@ var
baseopt: TOtherOpts; baseopt: TOtherOpts;
rightList: TStringList; rightList: TStringList;
begin begin
if base = nil then if base.isNil then
begin begin
for str1 in fCustom do if str1 <> '' then for str1 in fCustom do if str1 <> '' then
begin begin

View File

@ -203,6 +203,8 @@ begin
// //
FreeAndNil(fJSON); FreeAndNil(fJSON);
parser := TJSONParser.Create(loader, true); parser := TJSONParser.Create(loader, true);
//TODO-cDUB: uses parser.options to allow trailing comma (from FPC 3.02)
// http://bugs.freepascal.org/view.php?id=29357
try try
try try
fJSON := parser.Parse as TJSONObject; fJSON := parser.Parse as TJSONObject;
@ -446,7 +448,7 @@ begin
if fConfigIx = 0 then exit; if fConfigIx = 0 then exit;
// //
item := fJSON.Find('configurations'); item := fJSON.Find('configurations');
if not assigned(item) then exit; if item.isNil then exit;
// //
confs := TJSONArray(item); confs := TJSONArray(item);
if fConfigIx > confs.Count -1 then exit; if fConfigIx > confs.Count -1 then exit;
@ -461,7 +463,7 @@ begin
if not assigned(fJSON) then if not assigned(fJSON) then
exit; exit;
value := fJSON.Find('name'); value := fJSON.Find('name');
if not assigned(value) then fPackageName := '' if value.isNil then fPackageName := ''
else fPackageName := value.AsString; else fPackageName := value.AsString;
end; end;
@ -476,7 +478,7 @@ var
begin begin
fBuildTypes.Clear; fBuildTypes.Clear;
fConfigs.Clear; fConfigs.Clear;
if not assigned(fJSON) then if fJSON.isNil 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.
@ -486,7 +488,7 @@ begin
for i:= 0 to arr.Count-1 do for i:= 0 to arr.Count-1 do
begin begin
item := TJSONObject(arr.Items[i]); item := TJSONObject(arr.Items[i]);
if item.Find('name') = nil then if item.Find('name').isNil then
continue; continue;
fConfigs.Add(item.Strings['name']); fConfigs.Add(item.Strings['name']);
end; end;
@ -499,7 +501,7 @@ begin
fBuildTypes.AddStrings(DubBuiltTypeName); fBuildTypes.AddStrings(DubBuiltTypeName);
dat := fJSON.Find('buildTypes'); dat := fJSON.Find('buildTypes');
if assigned(dat) and (dat.JSONType = jtObject) then if dat.isNotNil and (dat.JSONType = jtObject) then
begin begin
obj := fJSON.Objects['buildTypes']; obj := fJSON.Objects['buildTypes'];
for i := 0 to obj.Count-1 do for i := 0 to obj.Count-1 do
@ -526,7 +528,7 @@ var
i: integer; i: integer;
begin begin
item := from.Find('excludedSourceFiles'); item := from.Find('excludedSourceFiles');
if assigned(item) and (item.JSONType = jtArray) then if item.isNotNil and (item.JSONType = jtArray) then
begin begin
arr := TJSONArray(item); arr := TJSONArray(item);
for i := 0 to arr.Count-1 do for i := 0 to arr.Count-1 do
@ -556,13 +558,13 @@ begin
try try
// auto folders & files // auto folders & files
item := fJSON.Find('mainSourceFile'); item := fJSON.Find('mainSourceFile');
if assigned(item) then if item.isNotNil then
fSrcs.Add(patchPlateformPath(ExtractRelativepath(fBasePath, item.AsString))); fSrcs.Add(patchPlateformPath(ExtractRelativepath(fBasePath, item.AsString)));
tryAddFromFolder(fBasePath + 'src'); tryAddFromFolder(fBasePath + 'src');
tryAddFromFolder(fBasePath + 'source'); tryAddFromFolder(fBasePath + 'source');
// custom folders // custom folders
item := fJSON.Find('sourcePaths'); item := fJSON.Find('sourcePaths');
if assigned(item) then if item.isNotNil then
begin begin
arr := TJSONArray(item); arr := TJSONArray(item);
for i := 0 to arr.Count-1 do for i := 0 to arr.Count-1 do
@ -576,21 +578,21 @@ begin
end; end;
// custom files // custom files
item := fJSON.Find('sourceFiles'); item := fJSON.Find('sourceFiles');
if assigned(item) then if item.isNotNil then
begin begin
arr := TJSONArray(item); arr := TJSONArray(item);
for i := 0 to arr.Count-1 do for i := 0 to arr.Count-1 do
fSrcs.Add(patchPlateformPath(ExtractRelativepath(fBasePath, arr.Strings[i]))); fSrcs.Add(patchPlateformPath(ExtractRelativepath(fBasePath, arr.Strings[i])));
end; end;
conf := getCurrentCustomConfig; conf := getCurrentCustomConfig;
if assigned(conf) then if conf.isNotNil then
begin begin
item := conf.Find('mainSourceFile'); item := conf.Find('mainSourceFile');
if assigned(item) then if item.isNotNil then
fSrcs.Add(patchPlateformPath(ExtractRelativepath(fBasePath, item.AsString))); fSrcs.Add(patchPlateformPath(ExtractRelativepath(fBasePath, item.AsString)));
// custom folders in current config // custom folders in current config
item := conf.Find('sourcePaths'); item := conf.Find('sourcePaths');
if assigned(item) then if item.isNotNil then
begin begin
arr := TJSONArray(item); arr := TJSONArray(item);
for i := 0 to arr.Count-1 do for i := 0 to arr.Count-1 do
@ -604,7 +606,7 @@ begin
end; end;
// custom files in current config // custom files in current config
item := conf.Find('sourceFiles'); item := conf.Find('sourceFiles');
if assigned(item) then if item.isNotNil then
begin begin
arr := TJSONArray(item); arr := TJSONArray(item);
for i := 0 to arr.Count-1 do for i := 0 to arr.Count-1 do
@ -616,7 +618,7 @@ begin
lst.Clear; lst.Clear;
getExclusion(fJSON); getExclusion(fJSON);
conf := getCurrentCustomConfig; conf := getCurrentCustomConfig;
if assigned(conf) then if conf.isNotNil then
getExclusion(conf); getExclusion(conf);
for i := fSrcs.Count-1 downto 0 do for i := fSrcs.Count-1 downto 0 do
for j := 0 to lst.Count-1 do for j := 0 to lst.Count-1 do
@ -633,13 +635,13 @@ var
tt: TJSONData; tt: TJSONData;
begin begin
result := true; result := true;
if value.Find('mainSourceFile') <> nil then if value.Find('mainSourceFile').isNotNil then
begin begin
fBinKind := executable; fBinKind := executable;
exit; exit;
end; end;
tt := value.Find('targetType'); tt := value.Find('targetType');
if tt <> nil then if tt.isNotNil then
begin begin
case tt.AsString of case tt.AsString of
'executable': fBinKind := executable; 'executable': fBinKind := executable;
@ -658,11 +660,11 @@ var
src: string; src: string;
begin begin
fBinKind := executable; fBinKind := executable;
if not assigned(fJSON) then exit; if fJSON.isNil then exit;
// note: in Coedit this is only used to known if output can be launched // note: in Coedit this is only used to known if output can be launched
found := findTargetKindInd(fJSON); found := findTargetKindInd(fJSON);
conf := getCurrentCustomConfig; conf := getCurrentCustomConfig;
if assigned(conf) then if conf.isNotNil then
found := found or findTargetKindInd(conf); found := found or findTargetKindInd(conf);
if not found then if not found then
begin begin
@ -700,11 +702,11 @@ procedure TCEDubProject.updateImportPathsFromJson;
var var
conf: TJSONObject; conf: TJSONObject;
begin begin
if not assigned(fJSON) then exit; if fJSON.isNil then exit;
// //
addFrom(fJSON); addFrom(fJSON);
conf := getCurrentCustomConfig; conf := getCurrentCustomConfig;
if assigned(conf) then addFrom(conf); if conf.isNotNil then addFrom(conf);
end; end;
procedure TCEDubProject.updateOutputNameFromJson; procedure TCEDubProject.updateOutputNameFromJson;
@ -718,20 +720,20 @@ var
begin begin
p := obj.Find('targetPath'); p := obj.Find('targetPath');
n := obj.Find('targetName'); n := obj.Find('targetName');
if assigned(p) then pathPart := p.AsString; if p.isNotNil then pathPart := p.AsString;
if assigned(n) then namePart := n.AsString; if n.isNotNil then namePart := n.AsString;
end; end;
begin begin
fOutputFileName := ''; fOutputFileName := '';
if not assigned(fJSON) then exit; if fJSON.isNil then exit;
item := fJSON.Find('name'); item := fJSON.Find('name');
if not assigned(item) then if item.isNil then exit;
exit;
namePart := item.AsString; namePart := item.AsString;
pathPart := fBasePath; pathPart := fBasePath;
setFrom(fJSON); setFrom(fJSON);
conf := getCurrentCustomConfig; conf := getCurrentCustomConfig;
if assigned(conf) then if conf.isNotNil then
setFrom(conf); setFrom(conf);
pathPart := TrimRightSet(pathPart, ['/','\']); pathPart := TrimRightSet(pathPart, ['/','\']);
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
@ -799,7 +801,7 @@ begin
maybe.loadFromFile(filename); maybe.loadFromFile(filename);
if (maybe.json = nil) or (maybe.filename = '') then if (maybe.json = nil) or (maybe.filename = '') then
result := false result := false
else if maybe.json.Find('name') = nil then else if maybe.json.Find('name').isNil then
result := false; result := false;
except except
result := false; result := false;

View File

@ -28,7 +28,7 @@ inherited CEDubProjectEditorWidget: TCEDubProjectEditorWidget
TabOrder = 0 TabOrder = 0
object TabSheet1: TTabSheet object TabSheet1: TTabSheet
Caption = 'Inspector' Caption = 'Inspector'
ClientHeight = 388 ClientHeight = 380
ClientWidth = 395 ClientWidth = 395
object pnlToolBar1: TPanel object pnlToolBar1: TPanel
Left = 4 Left = 4
@ -59,7 +59,7 @@ inherited CEDubProjectEditorWidget: TCEDubProjectEditorWidget
end end
object treeInspect: TTreeView object treeInspect: TTreeView
Left = 4 Left = 4
Height = 352 Height = 344
Top = 32 Top = 32
Width = 387 Width = 387
Align = alClient Align = alClient
@ -81,7 +81,7 @@ inherited CEDubProjectEditorWidget: TCEDubProjectEditorWidget
end end
object TabSheet2: TTabSheet object TabSheet2: TTabSheet
Caption = 'Editor' Caption = 'Editor'
ClientHeight = 388 ClientHeight = 380
ClientWidth = 395 ClientWidth = 395
object propTree: TTreeView object propTree: TTreeView
Left = 4 Left = 4

View File

@ -169,7 +169,7 @@ end;
procedure TCEDubProjectEditorWidget.projChanged(aProject: ICECommonProject); procedure TCEDubProjectEditorWidget.projChanged(aProject: ICECommonProject);
begin begin
if fProj = nil then if fProj.isNil then
exit; exit;
if aProject.getProject <> fProj then if aProject.getProject <> fProj then
exit; exit;
@ -182,7 +182,7 @@ end;
procedure TCEDubProjectEditorWidget.projClosing(aProject: ICECommonProject); procedure TCEDubProjectEditorWidget.projClosing(aProject: ICECommonProject);
begin begin
if fProj = nil then if fProj.isNil then
exit; exit;
if aProject.getProject <> fProj then if aProject.getProject <> fProj then
exit; exit;
@ -219,18 +219,18 @@ begin
fSelectedNode := nil; fSelectedNode := nil;
btnDelProp.Enabled := false; btnDelProp.Enabled := false;
btnAddProp.Enabled := false; btnAddProp.Enabled := false;
if propTree.Selected = nil then exit; if propTree.Selected.isNil then exit;
// //
fSelectedNode := propTree.Selected; fSelectedNode := propTree.Selected;
btnDelProp.Enabled := (fSelectedNode.Level > 0) and (fSelectedNode.Text <> 'name') btnDelProp.Enabled := (fSelectedNode.Level > 0) and (fSelectedNode.Text <> 'name')
and (fSelectedNode.data <> nil); and fSelectedNode.data.isNotNil;
updateValueEditor; updateValueEditor;
btnAddProp.Enabled := TJSONData(fSelectedNode.Data).JSONType in [jtObject, jtArray]; btnAddProp.Enabled := TJSONData(fSelectedNode.Data).JSONType in [jtObject, jtArray];
end; end;
procedure TCEDubProjectEditorWidget.btnAcceptPropClick(Sender: TObject); procedure TCEDubProjectEditorWidget.btnAcceptPropClick(Sender: TObject);
begin begin
if fSelectedNode = nil then exit; if fSelectedNode.isNil then exit;
// //
setJsonValueFromEditor; setJsonValueFromEditor;
propTree.FullExpand; propTree.FullExpand;
@ -240,7 +240,7 @@ procedure TCEDubProjectEditorWidget.btnAddPropClick(Sender: TObject);
var var
pnl: TCEDubProjectPropAddPanel; pnl: TCEDubProjectPropAddPanel;
begin begin
if fSelectedNode = nil then exit; if fSelectedNode.isNil then exit;
// //
pnl := TCEDubProjectPropAddPanel.construct(@addProp); pnl := TCEDubProjectPropAddPanel.construct(@addProp);
pnl.ShowModal; pnl.ShowModal;
@ -254,7 +254,7 @@ var
obj: TJSONObject; obj: TJSONObject;
nod: TTreeNode; nod: TTreeNode;
begin begin
if fSelectedNode = nil then exit; if fSelectedNode.isNil then exit;
// //
fProj.beginModification; fProj.beginModification;
if TJSONData(fSelectedNode.Data).JSONType = jtArray then if TJSONData(fSelectedNode.Data).JSONType = jtArray then
@ -278,9 +278,9 @@ begin
fProj.endModification; fProj.endModification;
propTree.FullExpand; propTree.FullExpand;
nod := propTree.Items.FindNodeWithText('<value>'); nod := propTree.Items.FindNodeWithText('<value>');
if nod = nil then if nod.isNil then
nod := propTree.Items.FindNodeWithText(propName); nod := propTree.Items.FindNodeWithText(propName);
if nod <> nil then if nod.isNotNil then
begin begin
propTree.Selected := nod; propTree.Selected := nod;
propTree.MakeSelectionVisible; propTree.MakeSelectionVisible;
@ -291,11 +291,11 @@ procedure TCEDubProjectEditorWidget.btnDelPropClick(Sender: TObject);
var var
prt: TJSONData; prt: TJSONData;
begin begin
if fSelectedNode = nil then exit; if fSelectedNode.isNil then exit;
if fSelectedNode.Level = 0 then exit; if fSelectedNode.Level = 0 then exit;
if fSelectedNode.Text = 'name' then exit; if fSelectedNode.Text = 'name' then exit;
if fSelectedNode.Data = nil then exit; if fSelectedNode.Data.isNil then exit;
if fSelectedNode.Parent.Data = nil then exit; if fSelectedNode.Parent.Data.isNil then exit;
// //
fProj.beginModification; fProj.beginModification;
prt := TJSONData(fSelectedNode.Parent.Data); prt := TJSONData(fSelectedNode.Parent.Data);
@ -316,9 +316,9 @@ var
vInt64: int64; vInt64: int64;
vBool: boolean; vBool: boolean;
begin begin
if fSelectedNode = nil then exit; if fSelectedNode.isNil then exit;
if fSelectedNode.Data = nil then exit; if fSelectedNode.Data.isNil then exit;
if fProj = nil then exit; if fProj.isNil then exit;
// //
fProj.beginModification; fProj.beginModification;
dat := TJSONData(fSelectedNode.Data); dat := TJSONData(fSelectedNode.Data);
@ -349,8 +349,8 @@ var
dat: TJSONData; dat: TJSONData;
begin begin
edProp.Clear; edProp.Clear;
if fSelectedNode = nil then exit; if fSelectedNode.isNil then exit;
if fSelectedNode.Data = nil then exit; if fSelectedNode.Data.isNil then exit;
// //
dat := TJSONData(fSelectedNode.Data); dat := TJSONData(fSelectedNode.Data);
case dat.JSONType of case dat.JSONType of
@ -416,7 +416,7 @@ procedure TCEDubProjectEditorWidget.updateEditor;
begin begin
propTree.Items.Clear; propTree.Items.Clear;
edProp.Clear; edProp.Clear;
if (fProj = nil) or (fProj.json = nil) then if fProj.isNil or fProj.json.isNil then
exit; exit;
// //
propTree.BeginUpdate; propTree.BeginUpdate;
@ -432,13 +432,13 @@ var
j: integer; j: integer;
node : TTreeNode; node : TTreeNode;
begin begin
if (fNodeConfig = nil) or (fNodeSources = nil) then if fNodeConfig.isNil or fNodeSources.isNil then
exit; exit;
// //
fNodeConfig.DeleteChildren; fNodeConfig.DeleteChildren;
fNodeSources.DeleteChildren; fNodeSources.DeleteChildren;
// //
if (fProj = nil) then if fProj.isNil then
exit; exit;
// //
j := fProj.getActiveConfigurationIndex; j := fProj.getActiveConfigurationIndex;
@ -478,8 +478,8 @@ var
node: TTreeNode; node: TTreeNode;
fname: string; fname: string;
begin begin
if treeInspect.Selected = nil then exit; if treeInspect.Selected.isNil then exit;
if fProj = nil then exit; if fProj.isNil then exit;
node := treeInspect.Selected; node := treeInspect.Selected;
// open file // open file
if node.Parent = fNodeSources then if node.Parent = fNodeSources then

View File

@ -134,7 +134,7 @@ end;
function TCEEditorWidget.closeQuery: boolean; function TCEEditorWidget.closeQuery: boolean;
begin begin
result := inherited and (Parent = nil); result := inherited and Parent.isNil;
end; end;
{$ENDREGION} {$ENDREGION}
@ -164,7 +164,7 @@ end;
procedure TCEEditorWidget.docClosing(aDoc: TCESynMemo); procedure TCEEditorWidget.docClosing(aDoc: TCESynMemo);
begin begin
if aDoc = nil then if aDoc.isNil then
exit; exit;
aDoc.Parent := nil; aDoc.Parent := nil;
if aDoc = fDoc then if aDoc = fDoc then
@ -225,7 +225,7 @@ var
doc: TCESynMemo; doc: TCESynMemo;
begin begin
doc := findDocument(aFilename); doc := findDocument(aFilename);
if doc <> nil then begin if doc.isNotNil then begin
PageControl.currentPage := TCEPage(doc.Parent); PageControl.currentPage := TCEPage(doc.Parent);
exit; exit;
end; end;
@ -238,7 +238,7 @@ var
doc: TCESynMemo; doc: TCESynMemo;
begin begin
doc := getDocument(index); doc := getDocument(index);
if not assigned(doc) then exit(false); if doc.isNil then exit(false);
if (doc.modified or (doc.fileName = doc.tempFilename)) and if (doc.modified or (doc.fileName = doc.tempFilename)) and
(dlgFileChangeClose(doc.fileName) = mrCancel) then exit(false); (dlgFileChangeClose(doc.fileName) = mrCancel) then exit(false);
pageControl.pageIndex:=index; pageControl.pageIndex:=index;
@ -251,7 +251,7 @@ var
page: TCEPage = nil; page: TCEPage = nil;
begin begin
page := TCEPage(doc.Parent); page := TCEPage(doc.Parent);
if not assigned(page) then if page.isNil then
exit(false); exit(false);
exit(closeDocument(page.index)); exit(closeDocument(page.index));
end; end;
@ -271,7 +271,7 @@ end;
procedure TCEEditorWidget.focusedEditorChanged; procedure TCEEditorWidget.focusedEditorChanged;
begin begin
if fDoc = nil then exit; if fDoc.isNil then exit;
// //
macRecorder.Editor:= fDoc; macRecorder.Editor:= fDoc;
fDoc.PopupMenu := mnuEditor; fDoc.PopupMenu := mnuEditor;
@ -286,14 +286,14 @@ end;
procedure TCEEditorWidget.PageControlChanged(Sender: TObject); procedure TCEEditorWidget.PageControlChanged(Sender: TObject);
begin begin
if fDoc = nil then exit; if fDoc.isNil then exit;
fDoc.hideCallTips; fDoc.hideCallTips;
fDoc.hideDDocs; fDoc.hideDDocs;
end; end;
procedure TCEEditorWidget.PageControlChanging(Sender: TObject; var AllowChange: Boolean); procedure TCEEditorWidget.PageControlChanging(Sender: TObject; var AllowChange: Boolean);
begin begin
if fDoc = nil then exit; if fDoc.isNil then exit;
fDoc.hideCallTips; fDoc.hideCallTips;
fDoc.hideDDocs; fDoc.hideDDocs;
end; end;

View File

@ -644,10 +644,8 @@ begin
end; end;
end; end;
end; end;
{$ENDREGION} {$ENDREGION}
initialization initialization
EditorOptions := TCEEditorOptions.Create(nil); EditorOptions := TCEEditorOptions.Create(nil);

View File

@ -25,12 +25,12 @@ inherited CEInfoWidget: TCEInfoWidget
Align = alTop Align = alTop
BorderSpacing.Around = 4 BorderSpacing.Around = 4
Caption = 'about' Caption = 'about'
ClientHeight = 75 ClientHeight = 89
ClientWidth = 399 ClientWidth = 399
TabOrder = 0 TabOrder = 0
object Label1: TLabel object Label1: TLabel
Left = 0 Left = 0
Height = 75 Height = 89
Top = 0 Top = 0
Width = 399 Width = 399
Align = alClient Align = alClient
@ -52,12 +52,12 @@ inherited CEInfoWidget: TCEInfoWidget
Align = alClient Align = alClient
BorderSpacing.Around = 4 BorderSpacing.Around = 4
Caption = 'tools status' Caption = 'tools status'
ClientHeight = 276 ClientHeight = 290
ClientWidth = 399 ClientWidth = 399
TabOrder = 1 TabOrder = 1
object boxTools: TScrollBox object boxTools: TScrollBox
Left = 4 Left = 4
Height = 268 Height = 282
Top = 4 Top = 4
Width = 391 Width = 391
HorzScrollBar.Page = 1 HorzScrollBar.Page = 1

View File

@ -112,7 +112,7 @@ procedure TToolInfo.refreshStatus;
var var
pth: string; pth: string;
begin begin
if (fLabel = nil) or (fStatus = nil) then exit; if fLabel.isNil or fStatus.isNil then exit;
// //
fLabel.Caption:= fToolName; fLabel.Caption:= fToolName;
case fKind of case fKind of

View File

@ -168,7 +168,7 @@ begin
for i := 0 to fCol.Count-1 do for i := 0 to fCol.Count-1 do
begin begin
itm := TLibraryItem(fCol.Items[i]); itm := TLibraryItem(fCol.Items[i]);
if someAliases <> nil then if someAliases.isNotNil then
if someAliases.IndexOf(itm.libAlias) = -1 then if someAliases.IndexOf(itm.libAlias) = -1 then
continue; continue;
// single lib files // single lib files
@ -212,7 +212,7 @@ begin
for i := 0 to fCol.Count-1 do for i := 0 to fCol.Count-1 do
begin begin
itm := TLibraryItem(fCol.Items[i]); itm := TLibraryItem(fCol.Items[i]);
if someAliases <> nil then if someAliases.isNotNil then
if someAliases.IndexOf(itm.libAlias) = -1 then if someAliases.IndexOf(itm.libAlias) = -1 then
continue; continue;
// //

View File

@ -92,7 +92,7 @@ procedure TCELibManEditorWidget.updateButtonsState;
begin begin
btnReg.Enabled := (fProj <> nil) and (fProj.binaryKind = staticlib) and btnReg.Enabled := (fProj <> nil) and (fProj.binaryKind = staticlib) and
FileExists(fProj.Filename); FileExists(fProj.Filename);
btnOpenProj.Enabled := (List.Selected <> nil) and btnOpenProj.Enabled := (List.Selected.isNotNil) and
(fileExists(List.Selected.SubItems[2])); (fileExists(List.Selected.SubItems[2]));
end; end;
@ -168,7 +168,7 @@ var
begin begin
if not InputQuery('DUB library import', 'please enter the name of the package', if not InputQuery('DUB library import', 'please enter the name of the package',
nme) then exit; nme) then exit;
if List.Items.FindCaption(0, nme, false, false, false) <> nil then if List.Items.FindCaption(0, nme, false, false, false).isNotNil then
begin begin
dlgOkInfo(format('a library item with the alias "%s" already exists, delete it before trying again.', dlgOkInfo(format('a library item with the alias "%s" already exists, delete it before trying again.',
[nme])); [nme]));
@ -296,7 +296,7 @@ procedure TCELibManEditorWidget.btnEditAliasClick(Sender: TObject);
var var
al: string; al: string;
begin begin
if List.Selected = nil then if List.Selected.isNil then
exit; exit;
al := List.Selected.Caption; al := List.Selected.Caption;
if inputQuery('library alias', '', al) then if inputQuery('library alias', '', al) then
@ -308,7 +308,7 @@ procedure TCELibManEditorWidget.btnOpenProjClick(Sender: TObject);
var var
fname: string; fname: string;
begin begin
if List.Selected = nil then exit; if List.Selected.isNil then exit;
fname := List.Selected.SubItems[2]; fname := List.Selected.SubItems[2];
if not FileExists(fname) then exit; if not FileExists(fname) then exit;
// //
@ -397,7 +397,7 @@ end;
procedure TCELibManEditorWidget.btnRemLibClick(Sender: TObject); procedure TCELibManEditorWidget.btnRemLibClick(Sender: TObject);
begin begin
if List.Selected = nil then if List.Selected.isNil then
exit; exit;
List.Items.Delete(List.Selected.Index); List.Items.Delete(List.Selected.Index);
gridToData; gridToData;
@ -407,7 +407,7 @@ procedure TCELibManEditorWidget.btnSelProjClick(Sender: TObject);
var var
ini: string = ''; ini: string = '';
begin begin
if List.Selected = nil then if List.Selected.isNil then
exit; exit;
if List.Selected.SubItems.Count > 2 then if List.Selected.SubItems.Count > 2 then
ini := List.Selected.SubItems[2] ini := List.Selected.SubItems[2]
@ -427,7 +427,7 @@ procedure TCELibManEditorWidget.btnSelFileClick(Sender: TObject);
var var
ini: string = ''; ini: string = '';
begin begin
if List.Selected = nil then if List.Selected.isNil then
exit; exit;
if List.Selected.SubItems.Count > 0 then if List.Selected.SubItems.Count > 0 then
ini := List.Selected.SubItems[0] ini := List.Selected.SubItems[0]
@ -457,7 +457,7 @@ procedure TCELibManEditorWidget.btnSelfoldOfFilesClick(Sender: TObject);
var var
dir, outdir: string; dir, outdir: string;
begin begin
if List.Selected = nil then if List.Selected.isNil then
exit; exit;
if List.Selected.SubItems.Count > 0 then if List.Selected.SubItems.Count > 0 then
dir := List.Selected.SubItems[0] dir := List.Selected.SubItems[0]
@ -475,7 +475,7 @@ procedure TCELibManEditorWidget.btnSelRootClick(Sender: TObject);
var var
dir, outdir: string; dir, outdir: string;
begin begin
if List.Selected = nil then if List.Selected.isNil then
exit; exit;
if List.Selected.SubItems.Count > 1 then if List.Selected.SubItems.Count > 1 then
dir := List.Selected.SubItems[1] dir := List.Selected.SubItems[1]
@ -492,7 +492,7 @@ end;
procedure TCELibManEditorWidget.btnMoveUpClick(Sender: TObject); procedure TCELibManEditorWidget.btnMoveUpClick(Sender: TObject);
begin begin
if list.Selected = nil then if list.Selected.isNil then
exit; exit;
if list.Selected.Index = 0 then if list.Selected.Index = 0 then
exit; exit;
@ -503,7 +503,7 @@ end;
procedure TCELibManEditorWidget.btnMoveDownClick(Sender: TObject); procedure TCELibManEditorWidget.btnMoveDownClick(Sender: TObject);
begin begin
if list.Selected = nil then if list.Selected.isNil then
exit; exit;
if list.Selected.Index = list.Items.Count - 1 then if list.Selected.Index = list.Items.Count - 1 then
exit; exit;
@ -524,7 +524,7 @@ var
row: TListItem; row: TListItem;
i: Integer; i: Integer;
begin begin
if LibMan = nil then if LibMan.isNil then
exit; exit;
List.BeginUpdate; List.BeginUpdate;
List.Clear; List.Clear;
@ -545,7 +545,7 @@ var
itm: TLibraryItem; itm: TLibraryItem;
row: TListItem; row: TListItem;
begin begin
if LibMan = nil then if LibMan.isNil then
exit; exit;
LibMan.libraries.BeginUpdate; LibMan.libraries.BeginUpdate;
LibMan.libraries.Clear; LibMan.libraries.Clear;

View File

@ -715,7 +715,8 @@ begin
EntitiesConnector.forceUpdate; EntitiesConnector.forceUpdate;
// //
getCMdParams; getCMdParams;
if fNativeProject = nil then newNativeProj; if fNativeProject.isNil then
newNativeProj;
// //
fInitialized := true; fInitialized := true;
end; end;
@ -1065,7 +1066,7 @@ procedure TCEMainForm.FreeRunnableProc;
var var
fname: string; fname: string;
begin begin
if fRunProc = nil then if fRunProc.isNil then
exit; exit;
// //
fname := fRunProc.Executable; fname := fRunProc.Executable;
@ -1139,7 +1140,7 @@ end;
procedure TCEMainForm.ApplicationProperties1Exception(Sender: TObject;E: Exception); procedure TCEMainForm.ApplicationProperties1Exception(Sender: TObject;E: Exception);
begin begin
if fMesgWidg = nil then if fMesgWidg.isNil then
dlgOkError(E.Message) dlgOkError(E.Message)
else else
fMsgs.message(E.Message, nil, amcApp, amkErr); fMsgs.message(E.Message, nil, amcApp, amkErr);
@ -1163,7 +1164,7 @@ end;
procedure TCEMainForm.updateDocumentBasedAction(sender: TObject); procedure TCEMainForm.updateDocumentBasedAction(sender: TObject);
begin begin
TAction(sender).Enabled := fDoc <> nil; TAction(sender).Enabled := fDoc.isNotNil;
end; end;
procedure TCEMainForm.updateProjectBasedAction(sender: TObject); procedure TCEMainForm.updateProjectBasedAction(sender: TObject);
@ -1173,7 +1174,7 @@ end;
procedure TCEMainForm.updateDocEditBasedAction(sender: TObject); procedure TCEMainForm.updateDocEditBasedAction(sender: TObject);
begin begin
if (fDoc <> nil) and fDoc.Focused then if fDoc.isNotNil and fDoc.Focused then
TAction(sender).Enabled := true TAction(sender).Enabled := true
else else
TAction(sender).Enabled := false; TAction(sender).Enabled := false;
@ -1187,7 +1188,7 @@ begin
try try
clearActProviderEntries; clearActProviderEntries;
collectedActProviderEntries; collectedActProviderEntries;
if (AAction <> nil ) then if AAction.isNotNil then
if not AAction.Update then if not AAction.Update then
TAction(AAction).enabled := true; TAction(AAction).enabled := true;
updateMainMenuProviders; updateMainMenuProviders;
@ -1235,9 +1236,9 @@ var
i: NativeInt; i: NativeInt;
begin begin
srcLst := TCEMruFileList(Sender); srcLst := TCEMruFileList(Sender);
if srcLst = nil then exit; if srcLst.isNil then exit;
trgMnu := TMenuItem(srcLst.objectTag); trgMnu := TMenuItem(srcLst.objectTag);
if trgMnu = nil then exit; if trgMnu.isNil then exit;
if fUpdateCount > 0 then exit; if fUpdateCount > 0 then exit;
Inc(fUpdateCount); Inc(fUpdateCount);
@ -1276,7 +1277,7 @@ var
srcLst: TCEMruFileList; srcLst: TCEMruFileList;
begin begin
srcLst := TCEMruFileList(TmenuItem(Sender).Tag); srcLst := TCEMruFileList(TmenuItem(Sender).Tag);
if srcLst = nil then exit; if srcLst.isNil then exit;
// //
srcLst.Clear; srcLst.Clear;
end; end;
@ -1441,7 +1442,7 @@ procedure TCEMainForm.actFileHtmlExportExecute(Sender: TObject);
var var
exp: TSynExporterHTML; exp: TSynExporterHTML;
begin begin
if fDoc = nil then if fDoc.isNil then
exit; exit;
exp := TSynExporterHTML.Create(nil); exp := TSynExporterHTML.Create(nil);
try try
@ -1487,8 +1488,6 @@ end;
procedure TCEMainForm.actFileOpenExecute(Sender: TObject); procedure TCEMainForm.actFileOpenExecute(Sender: TObject);
begin begin
if fEditWidg = nil then exit;
//
with TOpenDialog.Create(nil) do with TOpenDialog.Create(nil) do
try try
filter := DdiagFilter; filter := DdiagFilter;
@ -1533,7 +1532,7 @@ end;
procedure TCEMainForm.actFileSaveAsExecute(Sender: TObject); procedure TCEMainForm.actFileSaveAsExecute(Sender: TObject);
begin begin
if fDoc = nil then exit; if fDoc.isNil then exit;
// //
with TSaveDialog.Create(nil) do with TSaveDialog.Create(nil) do
try try
@ -1549,7 +1548,7 @@ procedure TCEMainForm.actFileSaveExecute(Sender: TObject);
var var
str: string; str: string;
begin begin
if fDoc = nil then exit; if fDoc.isNil then exit;
// //
str := fDoc.fileName; str := fDoc.fileName;
if (str <> fDoc.tempFilename) and (fileExists(str)) then if (str <> fDoc.tempFilename) and (fileExists(str)) then
@ -1560,7 +1559,7 @@ end;
procedure TCEMainForm.actFileAddToProjExecute(Sender: TObject); procedure TCEMainForm.actFileAddToProjExecute(Sender: TObject);
begin begin
if fDoc = nil then exit; if fDoc.isNil then exit;
if fDoc.isProjectFile then exit; if fDoc.isProjectFile then exit;
if fProjectInterface = nil then exit; if fProjectInterface = nil then exit;
// //
@ -1576,9 +1575,8 @@ end;
procedure TCEMainForm.actFileCloseExecute(Sender: TObject); procedure TCEMainForm.actFileCloseExecute(Sender: TObject);
begin begin
if fDoc = nil then if fDoc.isNotNil then
exit; getMultiDocHandler.closeDocument(fDoc);
getMultiDocHandler.closeDocument(fDoc);
end; end;
procedure TCEMainForm.actFileSaveAllExecute(Sender: TObject); procedure TCEMainForm.actFileSaveAllExecute(Sender: TObject);
@ -1610,7 +1608,7 @@ procedure TCEMainForm.actFileSaveCopyAsExecute(Sender: TObject);
var var
str: TStringList; str: TStringList;
begin begin
if fDoc = nil then if fDoc.isNil then
exit; exit;
with TSaveDialog.create(nil) do with TSaveDialog.create(nil) do
try try
@ -1635,43 +1633,43 @@ end;
{$REGION edit ------------------------------------------------------------------} {$REGION edit ------------------------------------------------------------------}
procedure TCEMainForm.actEdCopyExecute(Sender: TObject); procedure TCEMainForm.actEdCopyExecute(Sender: TObject);
begin begin
if assigned(fDoc) then if fDoc.isNotNil then
fDoc.CopyToClipboard; fDoc.CopyToClipboard;
end; end;
procedure TCEMainForm.actEdCutExecute(Sender: TObject); procedure TCEMainForm.actEdCutExecute(Sender: TObject);
begin begin
if assigned(fDoc) then if fDoc.isNotNil then
fDoc.CutToClipboard; fDoc.CutToClipboard;
end; end;
procedure TCEMainForm.actEdPasteExecute(Sender: TObject); procedure TCEMainForm.actEdPasteExecute(Sender: TObject);
begin begin
if assigned(fDoc) then if fDoc.isNotNil then
fDoc.PasteFromClipboard; fDoc.PasteFromClipboard;
end; end;
procedure TCEMainForm.actEdUndoExecute(Sender: TObject); procedure TCEMainForm.actEdUndoExecute(Sender: TObject);
begin begin
if assigned(fDoc) then if fDoc.isNotNil then
fDoc.Undo; fDoc.Undo;
end; end;
procedure TCEMainForm.actEdRedoExecute(Sender: TObject); procedure TCEMainForm.actEdRedoExecute(Sender: TObject);
begin begin
if assigned(fDoc) then if fDoc.isNotNil then
fDoc.Redo; fDoc.Redo;
end; end;
procedure TCEMainForm.actEdMacPlayExecute(Sender: TObject); procedure TCEMainForm.actEdMacPlayExecute(Sender: TObject);
begin begin
if assigned(fDoc) then if fDoc.isNotNil then
fEditWidg.macRecorder.PlaybackMacro(fDoc); fEditWidg.macRecorder.PlaybackMacro(fDoc);
end; end;
procedure TCEMainForm.actEdMacStartStopExecute(Sender: TObject); procedure TCEMainForm.actEdMacStartStopExecute(Sender: TObject);
begin begin
if assigned(fDoc) then if fDoc.isNotNil then
begin begin
if fEditWidg.macRecorder.State = msRecording then if fEditWidg.macRecorder.State = msRecording then
fEditWidg.macRecorder.Stop fEditWidg.macRecorder.Stop
@ -1681,13 +1679,13 @@ end;
procedure TCEMainForm.actEdIndentExecute(Sender: TObject); procedure TCEMainForm.actEdIndentExecute(Sender: TObject);
begin begin
if assigned(fDoc) then if fDoc.isNotNil then
fDoc.ExecuteCommand(ecBlockIndent, '', nil); fDoc.ExecuteCommand(ecBlockIndent, '', nil);
end; end;
procedure TCEMainForm.actEdUnIndentExecute(Sender: TObject); procedure TCEMainForm.actEdUnIndentExecute(Sender: TObject);
begin begin
if assigned(fDoc) then if fDoc.isNotNil then
fDoc.ExecuteCommand(ecBlockUnIndent, '', nil); fDoc.ExecuteCommand(ecBlockUnIndent, '', nil);
end; end;
@ -1697,10 +1695,10 @@ var
str: string; str: string;
begin begin
win := DockMaster.GetAnchorSite(fFindWidg); win := DockMaster.GetAnchorSite(fFindWidg);
if win = nil then exit; if win.isNil then exit;
win.Show; win.Show;
win.BringToFront; win.BringToFront;
if fDoc = nil then exit; if fDoc.isNil then exit;
// //
if fDoc.SelAvail then if fDoc.SelAvail then
str := fDoc.SelText str := fDoc.SelText
@ -1811,7 +1809,7 @@ begin
fMsgs.clearByData(fDoc); fMsgs.clearByData(fDoc);
FreeRunnableProc; FreeRunnableProc;
if fDoc = nil then exit; if fDoc.isNil then exit;
if fDoc.Lines.Count = 0 then exit; if fDoc.Lines.Count = 0 then exit;
firstlineFlags := fDoc.Lines[0]; firstlineFlags := fDoc.Lines[0];
@ -1906,34 +1904,33 @@ end;
procedure TCEMainForm.actFileUnittestExecute(Sender: TObject); procedure TCEMainForm.actFileUnittestExecute(Sender: TObject);
begin begin
if fDoc = nil then exit; if fDoc.isNotNil then
compileAndRunFile(true); compileAndRunFile(true);
end; end;
procedure TCEMainForm.actFileCompAndRunExecute(Sender: TObject); procedure TCEMainForm.actFileCompAndRunExecute(Sender: TObject);
begin begin
if fDoc = nil then exit; if fDoc.isNotNil then
compileAndRunFile(false); compileAndRunFile(false);
end; end;
procedure TCEMainForm.actFileCompileAndRunOutExecute(Sender: TObject); procedure TCEMainForm.actFileCompileAndRunOutExecute(Sender: TObject);
begin begin
if fDoc = nil then exit; if fDoc.isNotNil then
compileAndRunFile(false, false); compileAndRunFile(false, false);
end; end;
procedure TCEMainForm.actFileCompAndRunWithArgsExecute(Sender: TObject); procedure TCEMainForm.actFileCompAndRunWithArgsExecute(Sender: TObject);
var var
runargs: string = ''; runargs: string = '';
begin begin
if fDoc = nil then exit; if fDoc.isNotNil and InputQuery('Execution arguments', '', runargs) then
if InputQuery('Execution arguments', '', runargs) then
compileAndRunFile(false, true, runargs); compileAndRunFile(false, true, runargs);
end; end;
procedure TCEMainForm.actFileOpenContFoldExecute(Sender: TObject); procedure TCEMainForm.actFileOpenContFoldExecute(Sender: TObject);
begin begin
if fDoc = nil then exit; if fDoc.isNil then exit;
if not fileExists(fDoc.fileName) then exit; if not fileExists(fDoc.fileName) then exit;
// //
DockMaster.GetAnchorSite(fExplWidg).Show; DockMaster.GetAnchorSite(fExplWidg).Show;
@ -1991,7 +1988,7 @@ var
widg: TCEWidget; widg: TCEWidget;
act: TAction; act: TAction;
begin begin
if sender = nil then exit; if sender.isNil then exit;
act := TAction(sender); act := TAction(sender);
if act.Tag = 0 then exit; if act.Tag = 0 then exit;
// //
@ -2012,7 +2009,7 @@ var
widg: TCEWidget; widg: TCEWidget;
begin begin
widg := TCEWidget( TComponent(sender).tag ); widg := TCEWidget( TComponent(sender).tag );
if widg = nil then exit; if widg.isNil then exit;
// //
widg.showWidget; widg.showWidget;
end; end;
@ -2128,8 +2125,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 <> nil) and for widg in fWidgList do if widg.Parent.isNotNil and
(widg.Parent.Parent = nil) and widg.isDockable then widg.Parent.Parent.isNil and widg.isDockable then
begin begin
TForm(widg.Parent).FormStyle := fstyle[onTop]; TForm(widg.Parent).FormStyle := fstyle[onTop];
//TODO-bugfix: floating widg on top from true to false, widg remains on top //TODO-bugfix: floating widg on top from true to false, widg remains on top
@ -2277,7 +2274,7 @@ begin
pfNative: win := DockMaster.GetAnchorSite(fPrjCfWidg); pfNative: win := DockMaster.GetAnchorSite(fPrjCfWidg);
end end
else win := DockMaster.GetAnchorSite(fPrjCfWidg); else win := DockMaster.GetAnchorSite(fPrjCfWidg);
if assigned(win) then if win.isNotNil then
begin begin
win.Show; win.Show;
win.BringToFront; win.BringToFront;

View File

@ -24,7 +24,7 @@ inherited CEMessagesWidget: TCEMessagesWidget
Width = 759 Width = 759
Align = alClient Align = alClient
BorderSpacing.Around = 2 BorderSpacing.Around = 2
DefaultItemHeight = 16 DefaultItemHeight = 18
Font.Height = -12 Font.Height = -12
Font.Name = 'Courier New' Font.Name = 'Courier New'
Font.Quality = fqProof Font.Quality = fqProof

View File

@ -339,9 +339,9 @@ procedure TCEMessagesWidget.listDeletion(Sender: TObject; Node: TTreeNode);
var var
i: integer; i: integer;
begin begin
if node.Data <> nil then if node.data.isNotNil then
Dispose(PMessageData(Node.Data)); Dispose(PMessageData(Node.Data));
if fToDemangleObjs <> nil then if fToDemangleObjs.isNotNil then
begin begin
i := fToDemangleObjs.IndexOf(node); i := fToDemangleObjs.IndexOf(node);
if i <> -1 then if i < fToDemangleObjs.Count then if i <> -1 then if i < fToDemangleObjs.Count then
@ -389,7 +389,7 @@ var
btn: TToolButton; btn: TToolButton;
i: Integer; i: Integer;
begin begin
if sender = nil then if sender.isNil then
exit; exit;
// //
fCtxt := amcAll; fCtxt := amcAll;
@ -573,7 +573,7 @@ begin
case fCtxt of case fCtxt of
amcAll, amcApp, amcMisc : amcAll, amcApp, amcMisc :
clearbyContext(fCtxt); clearbyContext(fCtxt);
amcEdit: if fDoc <> nil then amcEdit: if fDoc.isNotNil then
clearbyData(fDoc); clearbyData(fDoc);
amcProj: if fProj <> nil then amcProj: if fProj <> nil then
clearbyData(fProj); clearbyData(fProj);
@ -746,7 +746,7 @@ var
i: Integer; i: Integer;
msgdt: PMessageData; msgdt: PMessageData;
begin begin
if aData = nil then if aData.isNil then
exit; exit;
list.BeginUpdate; list.BeginUpdate;
for i := List.Items.Count-1 downto 0 do for i := List.Items.Count-1 downto 0 do
@ -811,7 +811,7 @@ begin
for i := 0 to fToDemangleObjs.Count -1 do for i := 0 to fToDemangleObjs.Count -1 do
begin begin
itm := TTreeNode(fToDemangleObjs.Items[i]); itm := TTreeNode(fToDemangleObjs.Items[i]);
if itm = nil then continue; if itm.isNil then continue;
itm.Text := fToDemangle.Strings[i]; itm.Text := fToDemangle.Strings[i];
end; end;
freeDemangler; freeDemangler;
@ -819,7 +819,7 @@ end;
procedure TCEMessagesWidget.freeDemangler; procedure TCEMessagesWidget.freeDemangler;
begin begin
if fDemangler = nil then if fDemangler.isNil then
exit; exit;
// //
if fDemangler.Active then if fDemangler.Active then
@ -862,7 +862,7 @@ procedure TCEMessagesWidget.scrollToBack;
begin begin
if not Visible then if not Visible then
exit; exit;
if List.BottomItem <> nil then if List.BottomItem.isNotNil then
List.BottomItem.MakeVisible; List.BottomItem.MakeVisible;
end; end;
@ -873,14 +873,14 @@ var
begin begin
//TODO-cbugfix: AV the the 3rd time a same message is clicked (when option singleClick is set), //TODO-cbugfix: AV the the 3rd time a same message is clicked (when option singleClick is set),
// click to open matching file, back to editor, click (nothing, item is null), then click again: AV // click to open matching file, back to editor, click (nothing, item is null), then click again: AV
if List.Selected = nil then if List.Selected.isNil then
exit; exit;
msg := List.Selected.Text; msg := List.Selected.Text;
if not openFileFromDmdMessage(msg) then if not openFileFromDmdMessage(msg) then
exit; exit;
// 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 = nil then if fDoc.isNil then
exit; exit;
fDoc.CaretXY := pos; fDoc.CaretXY := pos;
fDoc.SelectLine; fDoc.SelectLine;

View File

@ -62,7 +62,7 @@ inherited CEMiniExplorerWidget: TCEMiniExplorerWidget
Top = 32 Top = 32
Width = 335 Width = 335
Align = alTop Align = alTop
DefaultItemHeight = 16 DefaultItemHeight = 18
Images = imgList Images = imgList
ReadOnly = True ReadOnly = True
ScrollBars = ssAutoBoth ScrollBars = ssAutoBoth

View File

@ -206,7 +206,7 @@ end;
procedure TCEMiniExplorerWidget.lstDeletion(Sender: TObject; Item: TListItem); procedure TCEMiniExplorerWidget.lstDeletion(Sender: TObject; Item: TListItem);
begin begin
if Item.Data <> nil then if Item.Data.isNotNil then
DisposeStr(PString(Item.Data)); DisposeStr(PString(Item.Data));
end; end;
{$ENDREGION} {$ENDREGION}
@ -281,7 +281,7 @@ procedure TCEMiniExplorerWidget.btnRemFavClick(Sender: TObject);
var var
i: Integer; i: Integer;
begin begin
if lstFav.Selected = nil then exit; if lstFav.Selected.isNil then exit;
i := fFavorites.IndexOf(PString(lstFav.Selected.Data)^); i := fFavorites.IndexOf(PString(lstFav.Selected.Data)^);
if i <> -1 then fFavorites.Delete(i); if i <> -1 then fFavorites.Delete(i);
lstFiles.Clear; lstFiles.Clear;
@ -294,13 +294,13 @@ end;
procedure TCEMiniExplorerWidget.btnAddFavClick(Sender: TObject); procedure TCEMiniExplorerWidget.btnAddFavClick(Sender: TObject);
begin begin
if Tree.Selected = nil then exit; if Tree.Selected.isNil then exit;
fFavorites.Add(PString(Tree.Selected.Data)^); fFavorites.Add(PString(Tree.Selected.Data)^);
end; end;
procedure TCEMiniExplorerWidget.lstFavDblClick(Sender: TObject); procedure TCEMiniExplorerWidget.lstFavDblClick(Sender: TObject);
begin begin
if lstFav.Selected = nil then exit; if lstFav.Selected.isNil then exit;
lstFiles.Items.Clear; lstFiles.Items.Clear;
expandPath(lstFav.Selected.Caption); expandPath(lstFav.Selected.Caption);
tree.MakeSelectionVisible; tree.MakeSelectionVisible;
@ -343,8 +343,8 @@ var
fname: string; fname: string;
proj: boolean = false; proj: boolean = false;
begin begin
if lstFiles.Selected = nil then exit; if lstFiles.Selected.isNil then exit;
if lstFiles.Selected.Data = nil then exit; if lstFiles.Selected.Data.isNil then exit;
fname := PString(lstFiles.Selected.Data)^; fname := PString(lstFiles.Selected.Data)^;
if not fileExists(fname) then exit; if not fileExists(fname) then exit;
{$IFNDEF WINDOWS} {$IFNDEF WINDOWS}
@ -394,19 +394,19 @@ var
begin begin
if fLastListOrTree = lstFiles then if fLastListOrTree = lstFiles then
begin begin
if lstFiles.Selected = nil then exit; if lstFiles.Selected.isNil then exit;
if lstFiles.Selected.Data = nil then exit; if lstFiles.Selected.data.isNil then exit;
fname := PString(lstFiles.Selected.Data)^; fname := PString(lstFiles.Selected.Data)^;
end else if fLastListOrTree = Tree then end else if fLastListOrTree = Tree then
begin begin
if tree.Selected = nil then exit; if tree.Selected.isNil then exit;
if tree.Selected.Data = nil then exit; if tree.Selected.Data.isNil then exit;
fname := PString(tree.Selected.Data)^; fname := PString(tree.Selected.Data)^;
end end
else if fLastListOrTree = lstFav then else if fLastListOrTree = lstFav then
begin begin
if lstFav.Selected = nil then exit; if lstFav.Selected.isNil then exit;
if lstFav.Selected.Data = nil then exit; if lstFav.Selected.Data.isNil then exit;
fname := PString(lstFav.Selected.Data)^; fname := PString(lstFav.Selected.Data)^;
end; end;
if fileExists(fname) then if not shellOpen(fname) then if fileExists(fname) then if not shellOpen(fname) then
@ -428,7 +428,7 @@ end;
procedure TCEMiniExplorerWidget.treeDeletion(Sender: TObject; Item: TTreeNode); procedure TCEMiniExplorerWidget.treeDeletion(Sender: TObject; Item: TTreeNode);
begin begin
if Item.Data <> nil then if Item.Data.isNotNil then
DisposeStr(PString(Item.Data)); DisposeStr(PString(Item.Data));
end; end;
@ -458,7 +458,7 @@ var
lst: TStringList; lst: TStringList;
pth: string; pth: string;
begin begin
if Tree.Selected = nil then exit; if Tree.Selected.isNil then exit;
// //
lst := TStringList.Create; lst := TStringList.Create;
try try
@ -499,14 +499,14 @@ end;
procedure TCEMiniExplorerWidget.treeExpanding(Sender: TObject; Node: TTreeNode; var allow: boolean); procedure TCEMiniExplorerWidget.treeExpanding(Sender: TObject; Node: TTreeNode; var allow: boolean);
begin begin
if Node <> nil then if Node.isNotNil then
treeScanSubFolders(Node); treeScanSubFolders(Node);
allow := true; allow := true;
end; end;
procedure TCEMiniExplorerWidget.treeChanged(Sender: TObject; Node: TTreeNode); procedure TCEMiniExplorerWidget.treeChanged(Sender: TObject; Node: TTreeNode);
begin begin
if Node = nil then exit; if Node.isNil then exit;
Node.DeleteChildren; Node.DeleteChildren;
treeScanSubFolders(Node); treeScanSubFolders(Node);
lstFilesFromTree; lstFilesFromTree;
@ -519,7 +519,7 @@ end;
procedure TCEMiniExplorerWidget.treeClick(sender: TObject); procedure TCEMiniExplorerWidget.treeClick(sender: TObject);
begin begin
if Tree.Selected = nil then exit; if Tree.Selected.isNil then exit;
if Tree.Selected.Expanded then exit; if Tree.Selected.Expanded then exit;
treeScanSubFolders(Tree.Selected); treeScanSubFolders(Tree.Selected);
end; end;
@ -540,7 +540,7 @@ begin
{$ENDIF} {$ENDIF}
for i := 0 to aRoot.Count-1 do for i := 0 to aRoot.Count-1 do
begin begin
if aRoot.Items[i].Data = nil then if aRoot.Items[i].Data.isNil then
continue; continue;
str := PString(aRoot.Items[i].Data)^; str := PString(aRoot.Items[i].Data)^;
if SameText(LeftStr(aPath, length(str)), str) then if SameText(LeftStr(aPath, length(str)), str) then

View File

@ -691,7 +691,7 @@ begin
result := false; result := false;
config := currentConfiguration; config := currentConfiguration;
msgs := getMessageDisplay; msgs := getMessageDisplay;
if config = nil then if config.isNil then
begin begin
msgs.message('unexpected project error: no active configuration', msgs.message('unexpected project error: no active configuration',
self as ICECommonProject, amcProj, amkErr); self as ICECommonProject, amcProj, amkErr);

View File

@ -97,7 +97,7 @@ var
ed: ICEEditableOptions; ed: ICEEditableOptions;
sel: string = ''; sel: string = '';
begin begin
if selCat.Selected <> nil then if selCat.Selected.isNotNil then
sel := selCat.Selected.Text; sel := selCat.Selected.Text;
fUpdatingCat := true; fUpdatingCat := true;
inspector.TIObject := nil; inspector.TIObject := nil;
@ -127,7 +127,7 @@ end;
procedure TCEOptionEditorWidget.selCatDeletion(Sender: TObject; Node: TTreeNode); procedure TCEOptionEditorWidget.selCatDeletion(Sender: TObject; Node: TTreeNode);
begin begin
if node.Data <> nil then if node.Data.isNotNil then
Dispose(PCategoryData(node.Data)); Dispose(PCategoryData(node.Data));
end; end;
@ -138,8 +138,8 @@ begin
result := true; result := true;
if fUpdatingCat then exit; if fUpdatingCat then exit;
if csDestroying in ComponentState then exit; if csDestroying in ComponentState then exit;
if selCat.Selected = nil then exit; if selCat.Selected.isNil then exit;
if selCat.Selected.Data = nil then exit; if selCat.Selected.Data.isNil then 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);
// generic editor, changes are tracked directly here // generic editor, changes are tracked directly here
@ -155,7 +155,7 @@ begin
end else end else
begin begin
dt := PCategoryData(selCat.Selected.Data); dt := PCategoryData(selCat.Selected.Data);
if dt^.container = nil then exit; if dt^.container.isNil then exit;
if dt^.observer = nil then exit; if dt^.observer = nil then exit;
if dt^.observer.optionedOptionsModified() then if dt^.observer.optionedOptionsModified() then
begin begin
@ -180,11 +180,11 @@ begin
if pnlEd.ControlCount > 0 then if pnlEd.ControlCount > 0 then
pnlEd.Controls[0].Parent := nil; pnlEd.Controls[0].Parent := nil;
// //
if selCat.Selected = nil then exit; if selCat.Selected.isNil then exit;
if selCat.Selected.Data = nil then exit; if selCat.Selected.Data.isNil then exit;
// //
dt := PCategoryData(selCat.Selected.Data); dt := PCategoryData(selCat.Selected.Data);
if dt^.container = nil then exit; if dt^.container.isNil then exit;
case dt^.kind of case dt^.kind of
oekControl: oekControl:
begin begin
@ -213,8 +213,8 @@ end;
procedure TCEOptionEditorWidget.inspectorModified(Sender: TObject); procedure TCEOptionEditorWidget.inspectorModified(Sender: TObject);
begin begin
if selCat.Selected = nil then exit; if selCat.Selected.isNil then exit;
if selcat.Selected.Data = nil then exit; if selcat.Selected.Data.isNil then exit;
// //
fCatChanged := true; fCatChanged := true;
PCategoryData(selCat.Selected.Data)^ PCategoryData(selCat.Selected.Data)^
@ -224,11 +224,11 @@ end;
procedure TCEOptionEditorWidget.btnCancelClick(Sender: TObject); procedure TCEOptionEditorWidget.btnCancelClick(Sender: TObject);
begin begin
if selCat.Selected = nil then exit; if selCat.Selected.isNil then exit;
if selcat.Selected.Data = nil then exit; if selcat.Selected.Data.isNil then exit;
// //
fCatChanged := false; fCatChanged := false;
if inspector.Parent <> nil then if inspector.Parent.isNotNil then
inspector.ItemIndex := -1; inspector.ItemIndex := -1;
PCategoryData(selCat.Selected.Data)^ PCategoryData(selCat.Selected.Data)^
.observer .observer
@ -263,11 +263,11 @@ end;
procedure TCEOptionEditorWidget.btnAcceptClick(Sender: TObject); procedure TCEOptionEditorWidget.btnAcceptClick(Sender: TObject);
begin begin
if selCat.Selected = nil then exit; if selCat.Selected.isNil then exit;
if selcat.Selected.Data = nil then exit; if selcat.Selected.Data.isNil then exit;
// //
fCatChanged := false; fCatChanged := false;
if inspector.Parent <> nil then if inspector.Parent.isNotNil then
inspector.ItemIndex := -1; inspector.ItemIndex := -1;
PCategoryData(selCat.Selected.Data)^ PCategoryData(selCat.Selected.Data)^
.observer .observer

View File

@ -81,18 +81,18 @@ begin
// TODO-cfeature: process list, imply that each TCESynMemo must have its own runnable TProcess // TODO-cfeature: process list, imply that each TCESynMemo must have its own runnable TProcess
// currently they share the CEMainForm.fRunProc variable. // currently they share the CEMainForm.fRunProc variable.
if fProc <> nil then if fProc.isNotNil 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 aProcess = nil then if aProcess.isNil then
exit; exit;
if not (poUsePipes in aProcess.Options) then if not (poUsePipes in aProcess.Options) then
exit; exit;
fProc := aProcess; fProc := aProcess;
if fProc <> nil then Panel1.Enabled:=true; if fProc.isNotNil then Panel1.Enabled:=true;
txtExeName.Caption := shortenPath(fProc.Executable); txtExeName.Caption := shortenPath(fProc.Executable);
end; end;
@ -125,9 +125,8 @@ end;
procedure TCEProcInputWidget.btnSendClick(Sender: TObject); procedure TCEProcInputWidget.btnSendClick(Sender: TObject);
begin begin
if fProc = nil then if fProc.isNotNil then
exit; sendInput;
sendInput;
end; end;
procedure TCEProcInputWidget.txtInpKeyDown(Sender: TObject; var Key: Word; procedure TCEProcInputWidget.txtInpKeyDown(Sender: TObject; var Key: Word;
@ -135,7 +134,7 @@ procedure TCEProcInputWidget.txtInpKeyDown(Sender: TObject; var Key: Word;
begin begin
case Key of case Key of
VK_RETURN: VK_RETURN:
if fProc <> nil then sendInput; if fProc.isNotNil then sendInput;
VK_UP: begin VK_UP: begin
fMruPos += 1; fMruPos += 1;
if fMruPos > fMru.Count-1 then fMruPos := 0; if fMruPos > fMru.Count-1 then fMruPos := 0;

View File

@ -31,14 +31,14 @@ inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
TabOrder = 0 TabOrder = 0
object selConf: TComboBox object selConf: TComboBox
Left = 0 Left = 0
Height = 23 Height = 25
Hint = 'select a configuration' Hint = 'select a configuration'
Top = 1 Top = 1
Width = 324 Width = 324
Align = alClient Align = alClient
BorderSpacing.Top = 1 BorderSpacing.Top = 1
BorderSpacing.Right = 1 BorderSpacing.Right = 1
ItemHeight = 15 ItemHeight = 0
OnChange = selConfChange OnChange = selConfChange
Style = csDropDownList Style = csDropDownList
TabOrder = 0 TabOrder = 0

View File

@ -8,7 +8,7 @@ uses
Classes, SysUtils, FileUtil, RTTIGrids, RTTICtrls, Forms, Controls, Graphics, Classes, SysUtils, FileUtil, RTTIGrids, RTTICtrls, Forms, Controls, Graphics,
Dialogs, ExtCtrls, ComCtrls, StdCtrls, Menus, Buttons, rttiutils, typinfo, Dialogs, ExtCtrls, ComCtrls, StdCtrls, Menus, Buttons, rttiutils, typinfo,
PropEdits, ObjectInspector, ce_dmdwrap, ce_nativeproject, ce_widget, PropEdits, ObjectInspector, ce_dmdwrap, ce_nativeproject, ce_widget,
ce_interfaces, ce_observer, ce_sharedres; ce_interfaces, ce_observer, ce_sharedres, ce_common;
type type
@ -112,7 +112,7 @@ end;
procedure TCEProjectConfigurationWidget.projClosing(aProject: ICECommonProject); procedure TCEProjectConfigurationWidget.projClosing(aProject: ICECommonProject);
begin begin
if fProj = nil then exit; if fProj.isNil then exit;
if fProj <> aProject.getProject then if fProj <> aProject.getProject then
exit; exit;
inspector.TIObject := nil; inspector.TIObject := nil;
@ -125,7 +125,7 @@ end;
procedure TCEProjectConfigurationWidget.projChanged(aProject: ICECommonProject); procedure TCEProjectConfigurationWidget.projChanged(aProject: ICECommonProject);
begin begin
if fProj = nil then exit; if fProj.isNil then exit;
if fProj <> aProject.getProject then if fProj <> aProject.getProject then
exit; exit;
if Visible then updateImperative; if Visible then updateImperative;
@ -151,7 +151,7 @@ end;
{$REGION config. things --------------------------------------------------------} {$REGION config. things --------------------------------------------------------}
procedure TCEProjectConfigurationWidget.selConfChange(Sender: TObject); procedure TCEProjectConfigurationWidget.selConfChange(Sender: TObject);
begin begin
if fProj = nil then exit; if fProj.isNil then exit;
if Updating then exit; if Updating then exit;
if selConf.ItemIndex = -1 then exit; if selConf.ItemIndex = -1 then exit;
// //
@ -164,7 +164,7 @@ procedure TCEProjectConfigurationWidget.TreeChange(Sender: TObject;
Node: TTreeNode); Node: TTreeNode);
begin begin
inspector.TIObject := getGridTarget; inspector.TIObject := getGridTarget;
selconf.Enabled := (inspector.TIObject <> fProj) and (fProj <> nil); selconf.Enabled := (inspector.TIObject <> fProj) and fProj.isNotNil;
end; end;
procedure TCEProjectConfigurationWidget.setSyncroMode(aValue: boolean); procedure TCEProjectConfigurationWidget.setSyncroMode(aValue: boolean);
@ -200,9 +200,9 @@ var
trg_obj: TPersistent; trg_obj: TPersistent;
i: Integer; i: Integer;
begin begin
if fProj = nil then exit; if fProj.isNil then exit;
if not fSyncroMode then exit; if not fSyncroMode then exit;
if inspector.TIObject = nil then exit; if inspector.TIObject.isNil then exit;
if inspector.ItemIndex = -1 then exit; if inspector.ItemIndex = -1 then exit;
// //
storage := nil; storage := nil;
@ -270,7 +270,7 @@ var
nme: string; nme: string;
cfg: TCompilerConfiguration; cfg: TCompilerConfiguration;
begin begin
if fProj = nil then exit; if fProj.isNil then exit;
// //
nme := ''; nme := '';
beginImperativeUpdate; beginImperativeUpdate;
@ -283,7 +283,7 @@ end;
procedure TCEProjectConfigurationWidget.btnDelConfClick(Sender: TObject); procedure TCEProjectConfigurationWidget.btnDelConfClick(Sender: TObject);
begin begin
if fProj = nil then exit; if fProj.isNil then exit;
if fProj.OptionsCollection.Count = 1 then exit; if fProj.OptionsCollection.Count = 1 then exit;
// //
beginImperativeUpdate; beginImperativeUpdate;
@ -300,7 +300,7 @@ var
nme: string; nme: string;
trg,src: TCompilerConfiguration; trg,src: TCompilerConfiguration;
begin begin
if fProj = nil then exit; if fProj.isNil then exit;
// //
nme := ''; nme := '';
beginImperativeUpdate; beginImperativeUpdate;
@ -318,14 +318,14 @@ procedure TCEProjectConfigurationWidget.btnSyncEditClick(Sender: TObject);
begin begin
fSynchroValue.Clear; fSynchroValue.Clear;
fSynchroItem.Clear; fSynchroItem.Clear;
if fProj = nil then exit; if fProj.isNil then exit;
syncroMode := not syncroMode; syncroMode := not syncroMode;
end; end;
procedure TCEProjectConfigurationWidget.GridFilter(Sender: TObject; aEditor: TPropertyEditor; procedure TCEProjectConfigurationWidget.GridFilter(Sender: TObject; aEditor: TPropertyEditor;
var aShow: boolean); var aShow: boolean);
begin begin
if fProj = nil then exit; if fProj.isNil then exit;
// filter TComponent things. // filter TComponent things.
if getGridTarget = fProj then if getGridTarget = fProj then
@ -361,9 +361,9 @@ end;
function TCEProjectConfigurationWidget.getGridTarget: TPersistent; function TCEProjectConfigurationWidget.getGridTarget: TPersistent;
begin begin
if fProj = nil then exit(nil); if fProj.isNil then exit(nil);
if fProj.ConfigurationIndex = -1 then exit(nil); if fProj.ConfigurationIndex = -1 then exit(nil);
if Tree.Selected = nil then exit(nil); if Tree.Selected.isNil then 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
1: exit( fProj ); 1: exit( fProj );
@ -387,8 +387,8 @@ var
begin begin
selConf.ItemIndex:= -1; selConf.ItemIndex:= -1;
selConf.Clear; selConf.Clear;
selconf.Enabled := (inspector.TIObject <> fProj) and (fProj <> nil); selconf.Enabled := (inspector.TIObject <> fProj) and fProj.isNotNil;
if fProj = nil then exit; if fProj.isNil then exit;
// //
for i:= 0 to fProj.OptionsCollection.Count-1 do for i:= 0 to fProj.OptionsCollection.Count-1 do
selConf.Items.Add(fProj.configuration[i].name); selConf.Items.Add(fProj.configuration[i].name);

View File

@ -150,7 +150,7 @@ end;
procedure TCEProjectInspectWidget.projClosing(aProject: ICECommonProject); procedure TCEProjectInspectWidget.projClosing(aProject: ICECommonProject);
begin begin
if fProject = nil then exit; if fProject.isNil then exit;
if fProject <> aProject.getProject then if fProject <> aProject.getProject then
exit; exit;
fProject := nil; fProject := nil;
@ -174,7 +174,7 @@ end;
procedure TCEProjectInspectWidget.projChanged(aProject: ICECommonProject); procedure TCEProjectInspectWidget.projChanged(aProject: ICECommonProject);
begin begin
if fProject = nil then exit; if fProject.isNil then exit;
if fProject <> aProject.getProject then if fProject <> aProject.getProject then
exit; exit;
if Visible then beginDelayedUpdate; if Visible then beginDelayedUpdate;
@ -195,9 +195,7 @@ end;
procedure TCEProjectInspectWidget.TreeSelectionChanged(Sender: TObject); procedure TCEProjectInspectWidget.TreeSelectionChanged(Sender: TObject);
begin begin
actUpdate(sender); actUpdate(sender);
if fProject = nil then if fProject.isNil or Tree.Selected.isNil then
exit;
if Tree.Selected = nil then
exit; exit;
if (Tree.Selected.Parent = fFileNode) then if (Tree.Selected.Parent = fFileNode) then
fLastFileOrFolder := expandFilenameEx(fProject.basePath,tree.Selected.Text) fLastFileOrFolder := expandFilenameEx(fProject.basePath,tree.Selected.Text)
@ -210,8 +208,8 @@ var
fname: string; fname: string;
i: NativeInt; i: NativeInt;
begin begin
if fProject = nil then exit; if fProject.isNil or Tree.Selected.isNil then
if Tree.Selected = nil then exit; exit;
// //
if (Tree.Selected.Parent = fFileNode) or (Tree.Selected.Parent = fXtraNode) then if (Tree.Selected.Parent = fFileNode) or (Tree.Selected.Parent = fXtraNode) then
begin begin
@ -234,14 +232,14 @@ procedure TCEProjectInspectWidget.actUpdate(sender: TObject);
begin begin
fActSelConf.Enabled := false; fActSelConf.Enabled := false;
fActOpenFile.Enabled := false; fActOpenFile.Enabled := false;
if Tree.Selected = nil then exit; if Tree.Selected.isNil then exit;
fActSelConf.Enabled := Tree.Selected.Parent = fConfNode; fActSelConf.Enabled := Tree.Selected.Parent = fConfNode;
fActOpenFile.Enabled := Tree.Selected.Parent = fFileNode; fActOpenFile.Enabled := Tree.Selected.Parent = fFileNode;
end; end;
procedure TCEProjectInspectWidget.btnAddFileClick(Sender: TObject); procedure TCEProjectInspectWidget.btnAddFileClick(Sender: TObject);
begin begin
if fProject = nil then exit; if fProject.isNil then exit;
// //
with TOpenDialog.Create(nil) do with TOpenDialog.Create(nil) do
try try
@ -267,7 +265,7 @@ var
lst: TStringList; lst: TStringList;
i: NativeInt; i: NativeInt;
begin begin
if fProject = nil then exit; if fProject.isNil then exit;
// //
dir := ''; dir := '';
if FileExists(fLastFileOrFolder) then if FileExists(fLastFileOrFolder) then
@ -300,8 +298,8 @@ var
dir, fname: string; dir, fname: string;
i: Integer; i: Integer;
begin begin
if fProject = nil then exit; if fProject.isNil or Tree.Selected.isNil then
if Tree.Selected = nil then exit; exit;
if Tree.Selected.Parent <> fFileNode then exit; if Tree.Selected.Parent <> fFileNode then exit;
// //
fname := Tree.Selected.Text; fname := Tree.Selected.Text;
@ -323,8 +321,8 @@ var
fname: string; fname: string;
i: NativeInt; i: NativeInt;
begin begin
if fProject = nil then exit; if fProject.isNil or Tree.Selected.isNil then
if Tree.Selected = nil then exit; exit;
// //
if Tree.Selected.Parent = fFileNode then if Tree.Selected.Parent = fFileNode then
begin begin
@ -355,7 +353,7 @@ var
fname, direntry: string; fname, direntry: string;
lst: TStringList; lst: TStringList;
begin begin
if fProject = nil then exit; if fProject.isNil then exit;
lst := TStringList.Create; lst := TStringList.Create;
fProject.beginUpdate; fProject.beginUpdate;
try for fname in Filenames do try for fname in Filenames do
@ -392,7 +390,7 @@ begin
fInclNode.DeleteChildren; fInclNode.DeleteChildren;
fXtraNode.DeleteChildren; fXtraNode.DeleteChildren;
// //
if not assigned(fProject) then if fProject.isNil then
exit; exit;
// //
Tree.BeginUpdate; Tree.BeginUpdate;

View File

@ -129,7 +129,7 @@ inherited CESearchWidget: TCESearchWidget
Align = alClient Align = alClient
BorderSpacing.Around = 4 BorderSpacing.Around = 4
Caption = 'Options' Caption = 'Options'
ClientHeight = 78 ClientHeight = 92
ClientWidth = 382 ClientWidth = 382
TabOrder = 4 TabOrder = 4
object chkWWord: TCheckBox object chkWWord: TCheckBox

View File

@ -282,7 +282,7 @@ var
i: integer; i: integer;
res: array of TPoint = nil; res: array of TPoint = nil;
begin begin
if fDoc = nil then exit; if fDoc.isNil then exit;
// //
fSearchMru.Insert(0,fToFind); fSearchMru.Insert(0,fToFind);
cbToFind.Items.Assign(fSearchMru); cbToFind.Items.Assign(fSearchMru);
@ -320,7 +320,7 @@ end;
procedure TCESearchWidget.actFindNextExecute(sender: TObject); procedure TCESearchWidget.actFindNextExecute(sender: TObject);
begin begin
if fDoc = nil then exit; if fDoc.isNil then exit;
// //
fSearchMru.Insert(0,fToFind); fSearchMru.Insert(0,fToFind);
cbToFind.Items.Assign(fSearchMru); cbToFind.Items.Assign(fSearchMru);
@ -356,7 +356,7 @@ end;
procedure TCESearchWidget.actReplaceNextExecute(sender: TObject); procedure TCESearchWidget.actReplaceNextExecute(sender: TObject);
begin begin
if fDoc = nil then exit; if fDoc.isNil then exit;
// //
fSearchMru.Insert(0, fToFind); fSearchMru.Insert(0, fToFind);
fReplaceMru.Insert(0, fReplaceWth); fReplaceMru.Insert(0, fReplaceWth);
@ -389,7 +389,7 @@ procedure TCESearchWidget.actReplaceAllExecute(sender: TObject);
var var
opts: TSynSearchOptions; opts: TSynSearchOptions;
begin begin
if fDoc = nil then exit; if fDoc.isNil then exit;
cbReplaceWth.Items.Assign(fReplaceMru); cbReplaceWth.Items.Assign(fReplaceMru);
opts := getOptions + [ssoReplace]; opts := getOptions + [ssoReplace];
opts -= [ssoBackwards]; opts -= [ssoBackwards];
@ -463,12 +463,12 @@ end;
procedure TCESearchWidget.updateImperative; procedure TCESearchWidget.updateImperative;
begin begin
btnFind.Enabled := (fDoc <> nil) and (fToFind <> ''); btnFind.Enabled := fDoc.isNotNil and (fToFind <> '');
btnFindAll.Enabled := (fDoc <> nil) and (fToFind <> ''); btnFindAll.Enabled := fDoc.isNotNil and (fToFind <> '');
btnReplace.Enabled := (fDoc <> nil) and (chkEnableRep.Checked) and (fToFind <> ''); btnReplace.Enabled := fDoc.isNotNil and (chkEnableRep.Checked) and (fToFind <> '');
btnReplaceAll.Enabled := btnReplace.Enabled; btnReplaceAll.Enabled := btnReplace.Enabled;
cbReplaceWth.Enabled := (fDoc <> nil) and (chkEnableRep.Checked); cbReplaceWth.Enabled := fDoc.isNotNil and (chkEnableRep.Checked);
cbToFind.Enabled := fDoc <> nil; cbToFind.Enabled := fDoc.isNotNil;
end; end;
{$ENDREGION} {$ENDREGION}

View File

@ -6,8 +6,6 @@ object CEShortcutEditor: TCEShortcutEditor
ClientHeight = 463 ClientHeight = 463
ClientWidth = 424 ClientWidth = 424
TabOrder = 0 TabOrder = 0
DesignLeft = 759
DesignTop = 225
object Panel1: TPanel object Panel1: TPanel
Left = 0 Left = 0
Height = 463 Height = 463

View File

@ -258,18 +258,18 @@ end;
procedure TCEShortcutEditor.btnActivateClick(Sender: TObject); procedure TCEShortcutEditor.btnActivateClick(Sender: TObject);
begin begin
if tree.Selected = nil then exit; if tree.Selected.isNil then exit;
if tree.Selected.Level = 0 then exit; if tree.Selected.Level = 0 then exit;
if tree.Selected.Data = nil then exit; if tree.Selected.Data.isNil then exit;
// //
shortcutCatcher.Enabled := not shortcutCatcher.Enabled; shortcutCatcher.Enabled := not shortcutCatcher.Enabled;
end; end;
procedure TCEShortcutEditor.btnClearClick(Sender: TObject); procedure TCEShortcutEditor.btnClearClick(Sender: TObject);
begin begin
if tree.Selected = nil then exit; if tree.Selected.isNil then exit;
if tree.Selected.Level = 0 then exit; if tree.Selected.Level = 0 then exit;
if tree.Selected.Data = nil then exit; if tree.Selected.Data.isNil then exit;
// //
if TShortcutItem(tree.Selected.Data).data <> 0 then if TShortcutItem(tree.Selected.Data).data <> 0 then
begin begin
@ -289,9 +289,9 @@ var
const const
msg = '"%s" is already assigned in the same category by "%s". The new shortcut will be ignored'; msg = '"%s" is already assigned in the same category by "%s". The new shortcut will be ignored';
begin begin
if tree.Selected = nil then exit; if tree.Selected.isNil then exit;
if tree.Selected.Level = 0 then exit; if tree.Selected.Level = 0 then exit;
if tree.Selected.Data = nil then exit; if tree.Selected.Data.isNil then exit;
// //
if Key = VK_RETURN then if Key = VK_RETURN then
shortcutCatcher.Enabled := false shortcutCatcher.Enabled := false
@ -305,7 +305,7 @@ begin
if i <> tree.Selected.Index then if i <> tree.Selected.Index then
if TShortcutItem(tree.Selected.Parent.Items[i].Data).data = sh then if TShortcutItem(tree.Selected.Parent.Items[i].Data).data = sh then
dup := TShortcutItem(tree.Selected.Parent.Items[i].Data); dup := TShortcutItem(tree.Selected.Parent.Items[i].Data);
if assigned(dup) then if dup.isNotNil then
dlgOkInfo(format(msg,[ShortCutToText(sh), dup.identifier])) dlgOkInfo(format(msg,[ShortCutToText(sh), dup.identifier]))
else if TShortcutItem(tree.Selected.Data).data <> sh then else if TShortcutItem(tree.Selected.Data).data <> sh then
begin begin
@ -321,9 +321,9 @@ procedure TCEShortcutEditor.updateEditCtrls;
begin begin
schrtText.Caption := ''; schrtText.Caption := '';
// //
if tree.Selected = nil then exit; if tree.Selected.isNil then exit;
if tree.Selected.Level = 0 then exit; if tree.Selected.Level = 0 then exit;
if tree.Selected.Data = nil then exit; if tree.Selected.Data.isNil then exit;
// //
schrtText.Caption := TShortcutItem(tree.Selected.Data).combination; schrtText.Caption := TShortcutItem(tree.Selected.Data).combination;
shortcutCatcher.Text := ''; shortcutCatcher.Text := '';
@ -372,7 +372,7 @@ begin
if cat = '' then exit; if cat = '' then exit;
if idt = '' then exit; if idt = '' then exit;
prt := findCategory(cat, obs); prt := findCategory(cat, obs);
if prt = nil then if prt.isNil then
prt := tree.Items.AddObject(nil, cat, obs); prt := tree.Items.AddObject(nil, cat, obs);
// item as child // item as child
itm := TShortcutItem(fShortcuts.items.Add); itm := TShortcutItem(fShortcuts.items.Add);

View File

@ -387,13 +387,13 @@ end;
procedure TCEStaticEditorMacro.Execute; procedure TCEStaticEditorMacro.Execute;
begin begin
if fDoc <> nil then if fDoc.isNotNil then
fCompletor.Execute(fDoc.Identifier, fDoc); fCompletor.Execute(fDoc.Identifier, fDoc);
end; end;
procedure TCEStaticEditorMacro.Execute(aEditor: TCustomSynEdit; const aToken: string); procedure TCEStaticEditorMacro.Execute(aEditor: TCustomSynEdit; const aToken: string);
begin begin
if aEditor <> nil then if aEditor.isNotNil then
fCompletor.Execute(aToken, aEditor); fCompletor.Execute(aToken, aEditor);
end; end;
{$ENDREGION} {$ENDREGION}

View File

@ -458,8 +458,8 @@ end;
procedure TCESymbolListWidget.actCopyIdentExecute(Sender: TObject); procedure TCESymbolListWidget.actCopyIdentExecute(Sender: TObject);
begin begin
if Tree.Selected = nil then exit; if Tree.Selected.isNotNil then
Clipboard.AsText:= Tree.Selected.Text; Clipboard.AsText:= Tree.Selected.Text;
end; end;
{$ENDREGION} {$ENDREGION}
@ -551,7 +551,7 @@ end;
procedure TCESymbolListWidget.updateVisibleCat; procedure TCESymbolListWidget.updateVisibleCat;
begin begin
if (fDoc <> nil) then if fDoc.isNotNil then
begin begin
ndAlias.Visible := ndAlias.Count > 0; ndAlias.Visible := ndAlias.Count > 0;
ndClass.Visible := ndClass.Count > 0; ndClass.Visible := ndClass.Count > 0;
@ -614,7 +614,7 @@ begin
// //
if TreeFilterEdit1.Filter <> '' then if TreeFilterEdit1.Filter <> '' then
tree.FullExpand tree.FullExpand
else if tree.Selected = nil then else if tree.Selected.isNil then
tree.FullCollapse tree.FullCollapse
else tree.MakeSelectionVisible; else tree.MakeSelectionVisible;
result := false; result := false;
@ -636,9 +636,9 @@ procedure TCESymbolListWidget.TreeDblClick(Sender: TObject);
var var
line: NativeUint; line: NativeUint;
begin begin
if fDoc = nil then exit; if fDoc.isNil then exit;
if Tree.Selected = nil then exit; if Tree.Selected.isNil then exit;
if Tree.Selected.Data = nil then exit; if Tree.Selected.Data.isNil then exit;
// //
{$HINTS OFF} {$HINTS OFF}
line := NativeUInt(Tree.Selected.Data); line := NativeUInt(Tree.Selected.Data);
@ -658,7 +658,7 @@ var
str: string; str: string;
begin begin
if not fHasToolExe then exit; if not fHasToolExe then exit;
if fDoc = nil then exit; if fDoc.isNil then exit;
if fDoc.Lines.Count = 0 then exit; if fDoc.Lines.Count = 0 then exit;
if not fDoc.isDSource then exit; if not fDoc.isDSource then exit;
// //
@ -682,12 +682,13 @@ function getCatNode(node: TTreeNode; stype: TSymbolType ): TTreeNode;
function newCat(const aCat: string): TTreeNode; function newCat(const aCat: string): TTreeNode;
begin begin
result := node.FindNode(aCat); result := node.FindNode(aCat);
if result = nil then result := node.TreeNodes.AddChild(node, aCat); if result.isNil then
result := node.TreeNodes.AddChild(node, aCat);
end; end;
// //
begin begin
result := nil; result := nil;
if node = nil then case stype of if node.isNil then case stype of
_alias : exit(ndAlias); _alias : exit(ndAlias);
_class : exit(ndClass); _class : exit(ndClass);
_enum : exit(ndEnum); _enum : exit(ndEnum);
@ -738,10 +739,10 @@ var
i: Integer; i: Integer;
flt: string; flt: string;
begin begin
if ndAlias = nil then exit; if ndAlias.isNil then exit;
clearTree; clearTree;
updateVisibleCat; updateVisibleCat;
if fDoc = nil then exit; if fDoc.isNil then exit;
// //
fToolProc.OnTerminate := nil; fToolProc.OnTerminate := nil;
fToolProc.OnReadData := nil; fToolProc.OnReadData := nil;
@ -786,9 +787,9 @@ var
begin begin
for i := 0 to root.Count-1 do for i := 0 to root.Count-1 do
begin begin
if root.Items[i].Data = nil then if root.Items[i].Data.isNil then
continue; continue;
if root.Items[i].Parent = nil then if root.Items[i].Parent.isNil then
continue; continue;
case root.Items[i].Parent.Text of case root.Items[i].Parent.Text of
'Alias', 'Enum', 'Import', 'Variable': 'Alias', 'Enum', 'Import', 'Variable':
@ -808,12 +809,12 @@ var
end; end;
begin begin
if not assigned(fDoc) then exit; if fDoc.isNil then 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 assigned(toExpand) then if toExpand.isNotNil then
begin begin
tree.Selected := toExpand; tree.Selected := toExpand;
toExpand.MakeVisible; toExpand.MakeVisible;

View File

@ -127,7 +127,7 @@ end;
procedure TCESymbolExpander.docFocused(aDoc: TCESynMemo); procedure TCESymbolExpander.docFocused(aDoc: TCESynMemo);
begin begin
if (aDoc <> nil) and (fDoc = aDoc) then if (aDoc.isNotNil) and (fDoc = aDoc) then
exit; exit;
fDoc := aDoc; fDoc := aDoc;
fNeedUpdate := true; fNeedUpdate := true;
@ -158,9 +158,9 @@ begin
if not fNeedUpdate then exit; if not fNeedUpdate then exit;
fNeedUpdate := false; fNeedUpdate := false;
// //
hasNativeProj := fProj <> nil; hasNativeProj := fProj.isNotNil;
hasProjItf := fProjInterface <> nil; hasProjItf := fProjInterface <> nil;
hasDoc := fDoc <> nil; hasDoc := fDoc.isNotNil;
// //
for e := low(TCESymbol) to high(TCESymbol) do for e := low(TCESymbol) to high(TCESymbol) do
fSymbols[e] := na; fSymbols[e] := na;
@ -259,7 +259,7 @@ begin
elem := ''; elem := '';
for i := 0 to elems.Count - 1 do for i := 0 to elems.Count - 1 do
begin begin
if elems.Objects[i] = nil then if elems.Objects[i].isNil then
Result += elems.Strings[i] Result += elems.Strings[i]
else else
case elems.Strings[i] of case elems.Strings[i] of

View File

@ -271,7 +271,7 @@ procedure TCESynMemoCache.writeBreakpoints(str: TStream);
var var
i: integer; i: integer;
begin begin
if fMemo = nil then exit; if fMemo.isNil then exit;
{$HINTS OFF} {$HINTS OFF}
for i:= 0 to fMemo.fBreakPoints.Count-1 do for i:= 0 to fMemo.fBreakPoints.Count-1 do
str.Write(PtrUint(fMemo.fBreakPoints.Items[i]), sizeOf(PtrUint)); str.Write(PtrUint(fMemo.fBreakPoints.Items[i]), sizeOf(PtrUint));
@ -283,7 +283,7 @@ var
i, cnt: integer; i, cnt: integer;
line: ptrUint = 0; line: ptrUint = 0;
begin begin
if fMemo = nil then exit; if fMemo.isNil then exit;
cnt := str.Size div sizeOf(PtrUint); cnt := str.Size div sizeOf(PtrUint);
for i := 0 to cnt-1 do for i := 0 to cnt-1 do
begin begin
@ -297,7 +297,7 @@ var
i, start, prev: Integer; i, start, prev: Integer;
itm : TCEFoldCache; itm : TCEFoldCache;
begin begin
if fMemo = nil then exit; if fMemo.isNil then exit;
// //
fCaretPosition := fMemo.SelStart; fCaretPosition := fMemo.SelStart;
fSourceFilename := fMemo.fileName; fSourceFilename := fMemo.fileName;
@ -329,7 +329,7 @@ var
i: integer; i: integer;
itm : TCEFoldCache; itm : TCEFoldCache;
begin begin
if fMemo = nil then exit; if fMemo.isNil then exit;
// //
if fFontSize > 0 then if fFontSize > 0 then
fMemo.Font.Size := fFontSize; fMemo.Font.Size := fFontSize;
@ -762,13 +762,13 @@ end;
{$REGION DDoc & CallTip --------------------------------------------------------} {$REGION DDoc & CallTip --------------------------------------------------------}
procedure TCESynMemo.InitHintWins; procedure TCESynMemo.InitHintWins;
begin begin
if fCallTipWin = nil then if fCallTipWin.isNil then
begin begin
fCallTipWin := TCEEditorHintWindow.Create(self); fCallTipWin := TCEEditorHintWindow.Create(self);
fCallTipWin.Color := clInfoBk + $01010100; fCallTipWin.Color := clInfoBk + $01010100;
fCallTipWin.Font.Color:= clInfoText; fCallTipWin.Font.Color:= clInfoText;
end; end;
if fDDocWin = nil then if fDDocWin.isNil then
begin begin
fDDocWin := TCEEditorHintWindow.Create(self); fDDocWin := TCEEditorHintWindow.Create(self);
fDDocWin.Color := clInfoBk + $01010100; fDDocWin.Color := clInfoBk + $01010100;
@ -1247,7 +1247,7 @@ procedure TCESynMemo.removeBreakPoint(line: integer);
begin begin
if not findBreakPoint(line) then if not findBreakPoint(line) then
exit; exit;
if (marks.Line[line] <> nil) and (marks.Line[line].Count > 0) then if marks.Line[line].isNotNil and (marks.Line[line].Count > 0) then
marks.Line[line].Clear(true); marks.Line[line].Clear(true);
{$WARNINGS OFF} {$WARNINGS OFF}
fBreakPoints.Remove(pointer(line)); fBreakPoints.Remove(pointer(line));

View File

@ -378,11 +378,11 @@ end;
{$REGION Todo list things ------------------------------------------------------} {$REGION Todo list things ------------------------------------------------------}
function TCETodoListWidget.getContext: TTodoContext; function TCETodoListWidget.getContext: TTodoContext;
begin begin
if ((fProj = nil) and (fDoc = nil)) then if (fProj = nil) and fDoc.isNil then
exit(tcNone); exit(tcNone);
if ((fProj = nil) and (fDoc <> nil)) then if (fProj = nil) and fDoc.isNotNil then
exit(tcFile); exit(tcFile);
if ((fProj <> nil) and (fDoc = nil)) then if (fProj <> nil) and fDoc.isNil then
exit(tcProject); exit(tcProject);
// //
if fProj.isSource(fDoc.fileName) then if fProj.isSource(fDoc.fileName) then
@ -393,7 +393,7 @@ end;
procedure TCETodoListWidget.killToolProcess; procedure TCETodoListWidget.killToolProcess;
begin begin
if fToolProc = nil then if fToolProc.isNil then
exit; exit;
// //
fToolProc.Terminate(0); fToolProc.Terminate(0);
@ -521,9 +521,7 @@ var
itm: TTodoItem; itm: TTodoItem;
fname, ln: string; fname, ln: string;
begin begin
if lstItems.Selected = nil then if lstItems.Selected.isNil or lstItems.Selected.Data.isNil then
exit;
if lstItems.Selected.Data = nil then
exit; exit;
// the collection will be cleared if a file is opened // the collection will be cleared if a file is opened
// docFocused->callToolProcess->fTodos....clear // docFocused->callToolProcess->fTodos....clear
@ -533,7 +531,7 @@ begin
ln := itm.line; ln := itm.line;
getMultiDocHandler.openDocument(fname); getMultiDocHandler.openDocument(fname);
// //
if fDoc = nil then if fDoc.isNil then
exit; exit;
fDoc.CaretY := StrToInt(ln); fDoc.CaretY := StrToInt(ln);
fDoc.SelectLine; fDoc.SelectLine;
@ -549,7 +547,7 @@ procedure TCETodoListWidget.lstItemsColumnClick(Sender: TObject; Column: TListCo
var var
curr: TListItem; curr: TListItem;
begin begin
if lstItems.Selected = nil then if lstItems.Selected.isNil then
exit; exit;
lstItems.BeginUpdate; lstItems.BeginUpdate;
curr := lstItems.Selected; curr := lstItems.Selected;
@ -630,8 +628,8 @@ end;
procedure TCETodoListWidget.refreshVisibleColumns; procedure TCETodoListWidget.refreshVisibleColumns;
begin begin
if lstItems = nil then exit; if lstItems.isNil then exit;
if lstItems.Columns = nil then exit; if lstItems.Columns.isNil then exit;
if lstItems.ColumnCount <> 6 then exit; if lstItems.ColumnCount <> 6 then exit;
// //
lstItems.Column[1].Visible := TTodoColumn.category in fColumns ; lstItems.Column[1].Visible := TTodoColumn.category in fColumns ;

View File

@ -178,7 +178,7 @@ procedure TCEToolItem.setToolAlias(value: string);
var var
i: integer = 0; i: integer = 0;
begin begin
while fToolItems.findTool(value) <> nil do while fToolItems.findTool(value).isNotNil do
begin begin
value += intToStr(i); value += intToStr(i);
i += 1; i += 1;
@ -216,7 +216,7 @@ begin
if FileExists(fProcess.Executable) then if FileExists(fProcess.Executable) then
begin begin
fProcess.Execute; fProcess.Execute;
if (previous <> nil) and (previous.outputToNext) if previous.isNotNil 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.OutputStack.Size); setLength(inp, previous.process.OutputStack.Size);
@ -249,7 +249,7 @@ begin
if (not fProcess.Running) and (fNextToolAlias <> '') then if (not fProcess.Running) and (fNextToolAlias <> '') then
begin begin
nxt := fToolItems.findTool(fNextToolAlias); nxt := fToolItems.findTool(fNextToolAlias);
if assigned(nxt) then nxt.execute(self); if nxt.isNotNil then nxt.execute(self);
end; end;
end; end;
{$ENDREGION --------------------------------------------------------------------} {$ENDREGION --------------------------------------------------------------------}
@ -313,7 +313,7 @@ var
colitm: TCEToolItem; colitm: TCEToolItem;
mnuitm: TMenuItem; mnuitm: TMenuItem;
begin begin
if item = nil then exit; if item.isNil then exit;
if item.Count <> tools.Count then if item.Count <> tools.Count then
menuDeclare(item) menuDeclare(item)
else for i:= 0 to tools.Count-1 do else for i:= 0 to tools.Count-1 do
@ -404,11 +404,11 @@ procedure TCETools.executeTool(aTool: TCEToolItem);
var var
txt: string; txt: string;
begin begin
if aTool = nil then exit; if aTool.isNil then exit;
// //
aTool.execute(nil); aTool.execute(nil);
if aTool.editorToInput and assigned(fDoc) and (poUsePipes in aTool.options) if aTool.editorToInput and fDoc.isNotNil and (poUsePipes in aTool.options)
and (aTool.fProcess.Input <> nil) then and aTool.fProcess.Input.isNotNil then
begin begin
txt := fDoc.Text; txt := fDoc.Text;
aTool.fProcess.Input.Write(txt[1], length(txt)); aTool.fProcess.Input.Write(txt[1], length(txt));