IDE, DockedFormEditor: fixed deprecation warnings, patch by Don Siders, issue #40921

This commit is contained in:
Maxim Ganetsky 2024-04-25 02:12:06 +03:00
parent fcaca1fe6a
commit f130c3af96
9 changed files with 31 additions and 27 deletions

View File

@ -21,6 +21,8 @@ uses
// LCL
Controls, ExtCtrls, Graphics, LCLProc, Dialogs, PairSplitter, ComCtrls,
LCLType, IDEDialogs,
// LazUtils
LazLoggerBase,
// DockedFormEditor
DockedOptionsIDE, DockedStrConsts, DockedTools;
@ -240,7 +242,7 @@ end;
procedure TAnchorControl.AnchorControlShowHint(Sender: TObject; HintInfo: PHintInfo);
begin
HintInfo^.HintStr := 'Name [' + DbgSName(RootControl) + ']' + LineEnding +
HintInfo^.HintStr := 'Name [' + LazLoggerBase.DbgSName(RootControl) + ']' + LineEnding +
'Bounds [' + BoundsString + ']' + LineEnding +
'Align [' + DbgS(Align) + ']' + LineEnding +
AnchorsString +

View File

@ -17,7 +17,7 @@ uses
// RTL
Classes, SysUtils,
// LazUtils
LazConfigStorage, LazFileUtils, LazFileCache,
LazConfigStorage, LazFileUtils, LazFileCache, LazLoggerBase,
// LCL
LCLProc, ComCtrls, Graphics, DockedStrConsts,
// IdeIntf
@ -286,7 +286,7 @@ begin
Modified := False;
except
on E: Exception do
DebugLn(['Error: (lazarus) [TDockedOptions.SaveSafe] ', E.Message]);
LazLoggerBase.DebugLn(['Error: (lazarus) [TDockedOptions.SaveSafe] ', E.Message]);
end;
end;
@ -296,7 +296,7 @@ begin
LoadFromFile(DockedOptionsFileName);
except
on E: Exception do
DebugLn(['Error: (lazarus) [TDockedOptions.LoadSafe] ', E.Message]);
LazLoggerBase.DebugLn(['Error: (lazarus) [TDockedOptions.LoadSafe] ', E.Message]);
end;
Modified := False;
end;

View File

@ -20,6 +20,8 @@ uses
Classes, SysUtils,
// LCL
LCLProc, Forms, Controls,
//LazUtils
LazLoggerBase,
// IDEIntf
IDEMsgIntf, SrcEditorIntf, IDEExternToolIntf,
// DockedFormEditor
@ -77,7 +79,7 @@ end;
procedure IDEMessage(AString: String);
begin
LCLProc.DebugLn(AString);
LazLoggerBase.DebugLn(AString);
if Assigned(IDEMessagesWindow) then
IDEMessagesWindow.AddCustomMessage(mluNone, AString, '');
end;

View File

@ -42,7 +42,7 @@ uses
LCLProc, LCLType, LCLIntf, LResources, LMessages, Forms, Controls,
Graphics, Dialogs, Themes, Buttons,
// LazUtils
LazStringUtils, GraphMath,
LazStringUtils, GraphMath, LazLoggerBase,
// SynEdit
SynEdit, SynEditKeyCmds,
// CodeTools
@ -438,7 +438,7 @@ procedure TCodeContextFrm.CreateHints(const CodeContexts: TCodeContextInfo);
Result:=true;
end;
if not Result then
debugln(['TCodeContextFrm.CreateHints.FindBaseType: not yet supported: ',ExprTypeToString(Expr)]);
LazLoggerBase.debugln(['TCodeContextFrm.CreateHints.FindBaseType: not yet supported: ',ExprTypeToString(Expr)]);
except
end;
finally

View File

@ -41,7 +41,7 @@ uses
// RTL+FCL
Classes, SysUtils, Types, AVL_Tree,
// LazUtils
LazStringUtils, LazLoggerBase,
LazStringUtils, LazLoggerBase, LazTracer,
// LCL
LCLProc, LCLType, Forms, Controls, Dialogs, Buttons, ComCtrls, Menus, ExtCtrls, EditBtn,
// CodeTools
@ -2055,7 +2055,7 @@ var
CurPage: TCodeExplorerPage;
begin
if FUpdateCount<=0 then
RaiseGDBException('TCodeExplorerView.EndUpdate');
LazTracer.RaiseGDBException('TCodeExplorerView.EndUpdate');
dec(FUpdateCount);
if FUpdateCount=0 then begin
CurPage:=CurrentPage;
@ -2942,7 +2942,7 @@ end;
function TCodeObserverStatementState.Pop: TCodeObsStackItemType;
begin
if StackPtr=0 then
RaiseGDBException('inconsistency');
LazTracer.RaiseGDBException('inconsistency');
dec(StackPtr);
Result:=Stack[StackPtr].Typ;
if IgnoreConstLevel>StackPtr then

View File

@ -1228,7 +1228,7 @@ end;
procedure TFPDocEditor.EndUpdate;
begin
dec(fUpdateLock);
if fUpdateLock<0 then RaiseGDBException('');
if fUpdateLock<0 then LazTracer.RaiseGDBException('');
if fUpdateLock=0 then begin
if fpdefCaptionNeedsUpdate in FFlags then UpdateCaption;
end;

View File

@ -71,7 +71,7 @@ uses
// use lazutf8, lazfileutils and lazfilecache after FileProcs and FileUtil
FileUtil, LazFileUtils, LazUtilities, LazUTF8, UTF8Process,
LConvEncoding, Laz2_XMLCfg, LazLoggerBase, LazLogger, LazFileCache, AvgLvlTree,
GraphType, LazStringUtils,
GraphType, LazStringUtils, LazTracer,
LCLExceptionStacktrace, {$IFDEF WINDOWS} Win32Proc, {$ENDIF}
// SynEdit
SynEdit, AllSynEdit, SynEditKeyCmds, SynEditMarks, SynEditHighlighter,
@ -6510,7 +6510,7 @@ begin
AFilename:=ExpandFileNameUTF8(TrimFilename(AFilename));
//debugln('TMainIDE.DoOpenProjectFile A2 "'+AFileName+'"');
if not FilenameIsAbsolute(AFilename) then
RaiseGDBException('TMainIDE.DoOpenProjectFile: buggy ExpandFileNameUTF8');
LazTracer.RaiseGDBException('TMainIDE.DoOpenProjectFile: buggy ExpandFileNameUTF8');
DiskFilename:=GetPhysicalFilenameCached(AFilename,false);
if DiskFilename<>AFilename then begin
// e.g. encoding changed
@ -8744,10 +8744,10 @@ begin
ActiveUnitInfo:=nil;
if AForm<>nil then begin
if (AForm.Designer=nil) then
RaiseGDBException('TMainIDE.GetUnitWithForm AForm.Designer');
LazTracer.RaiseGDBException('TMainIDE.GetUnitWithForm AForm.Designer');
AComponent:=AForm.Designer.LookupRoot;
if AComponent=nil then
RaiseGDBException('TMainIDE.GetUnitWithForm AComponent=nil');
LazTracer.RaiseGDBException('TMainIDE.GetUnitWithForm AComponent=nil');
GetUnitWithPersistent(AComponent,ActiveSourceEditor,ActiveUnitInfo);
end;
end;
@ -12016,7 +12016,7 @@ begin
AComponent.Name,NewName,AComponent.ClassName,true);
ApplyBossResult(lisUnableToRenameVariableInSource);
end else begin
RaiseGDBException('TMainIDE.DesignerRenameComponent internal error:'+AComponent.Name+':'+AComponent.ClassName);
LazTracer.RaiseGDBException('TMainIDE.DesignerRenameComponent internal error:'+AComponent.Name+':'+AComponent.ClassName);
end;
// rename inherited components
@ -13026,7 +13026,7 @@ var
begin
AComponent:=ADesigner.LookupRoot;
if AComponent=nil then
RaiseGDBException('TMainIDE.GetProjectFileWithDesigner Designer.LookupRoot=nil');
LazTracer.RaiseGDBException('TMainIDE.GetProjectFileWithDesigner Designer.LookupRoot=nil');
Result:=GetProjectFileWithRootComponent(AComponent);
end;
@ -13558,11 +13558,11 @@ begin
if not BeginCodeTool(CurDesigner,SrcEdit,UnitInfo,[ctfSwitchToFormSource]) then
exit;
if CurDesigner.Form=nil then
RaiseGDBException('[TMainIDE.OnPropHookPersistentDeleting] Error: TDesigner without a form');
LazTracer.RaiseGDBException('[TMainIDE.OnPropHookPersistentDeleting] Error: TDesigner without a form');
// find source for form
Assert(UnitInfo=Project1.UnitWithComponent(CurDesigner.LookupRoot), 'TMainIDE.PropHookPersistentDeleting check fail.');
if UnitInfo=nil then
RaiseGDBException('[TMainIDE.OnPropHookPersistentDeleting] Error: form without source');
LazTracer.RaiseGDBException('[TMainIDE.OnPropHookPersistentDeleting] Error: form without source');
// mark references modified
MarkUnitsModifiedUsingSubComponent(Comp);
// remember cursor position

View File

@ -53,7 +53,7 @@ uses
LinkScanner, CodeToolManager, CodeCache, CodeTree, StdCodeTools,
// LazUtils
FPCAdds, LazUtilities, FileUtil, LazFileUtils, LazFileCache, LazMethodList,
LazLoggerBase, FileReferenceList, LazUTF8, Laz2_XMLCfg, Maps, AvgLvlTree,
LazLoggerBase, LazTracer, FileReferenceList, LazUTF8, Laz2_XMLCfg, Maps, AvgLvlTree,
// BuildIntf
BaseIDEIntf, ProjectIntf, PackageIntf, MacroIntf, MacroDefIntf,
CompOptsIntf, IDEOptionsIntf,
@ -2124,7 +2124,7 @@ end;
procedure TUnitInfo.SetFilename(const AValue: string);
begin
if fSource<>nil then
RaiseGDBException('TUnitInfo.SetFilename Source<>nil')
LazTracer.RaiseGDBException('TUnitInfo.SetFilename Source<>nil')
else
SetInternalFilename(AValue);
end;
@ -2324,8 +2324,8 @@ end;
function TUnitInfo.AddRequiresComponentDependency(RequiredUnit: TUnitInfo;
Types: TUnitCompDependencyTypes): TUnitComponentDependency;
begin
if RequiredUnit=nil then RaiseGDBException('inconsistency');
if RequiredUnit=Self then RaiseGDBException('inconsistency');
if RequiredUnit=nil then LazTracer.RaiseGDBException('inconsistency');
if RequiredUnit=Self then LazTracer.RaiseGDBException('inconsistency');
// search a dependency to this RequiredUnit
Result:=FirstRequiredComponent;
while Result<>nil do begin
@ -4068,7 +4068,7 @@ end;
procedure TProject.EndUpdate;
begin
if FUpdateLock<=0 then RaiseGDBException('TProject.EndUpdate');
if FUpdateLock<=0 then LazTracer.RaiseGDBException('TProject.EndUpdate');
dec(FUpdateLock);
FSourceDirectories.EndUpdate;
FDefineTemplates.EndUpdate;
@ -4140,7 +4140,7 @@ end;
procedure TProject.SetMainUnitID(const AValue: Integer);
begin
if AValue>=UnitCount then
RaiseGDBException('');
LazTracer.RaiseGDBException('');
if MainUnitID=AValue then exit;
if (MainUnitID>=0) and (MainUnitID<UnitCount) then

View File

@ -44,7 +44,7 @@ uses
// LazControls
TreeFilterEdit, ExtendedNotebook,
// LazUtils
LazUTF8, LazUtilities, LazFileUtils, LazLoggerBase, LazStringUtils,
LazUTF8, LazUtilities, LazFileUtils, LazLoggerBase, LazTracer, LazStringUtils,
// IdeIntf
IDEImagesIntf, IDECommands, InputHistory,
// IdeConfig
@ -1804,7 +1804,7 @@ var
i: integer;
begin
if (fUpdateCount = 0) then
RaiseGDBException('TLazSearchResultTV.EndUpdate');
LazTracer.RaiseGDBException('TLazSearchResultTV.EndUpdate');
Dec(fUpdateCount);
if (fUpdateCount = 0) then
begin