ide: fix compilation with fpc 2.5.1

git-svn-id: trunk@21277 -
This commit is contained in:
paul 2009-08-18 08:42:22 +00:00
parent ef638bce2e
commit e447466f59
12 changed files with 26 additions and 32 deletions

View File

@ -1980,7 +1980,7 @@ begin
begin begin
//MenuItem.Remove(MenuItem[index_sequence[Ind]]); //MenuItem.Remove(MenuItem[index_sequence[Ind]]);
temp_menuitem:=MenuItem[index_sequence[Ind]]; temp_menuitem:=MenuItem[index_sequence[Ind]];
GlobalDesignHook.DeletePersistent(temp_menuitem); GlobalDesignHook.DeletePersistent(TPersistent(temp_menuitem));
//MenuItem[index_sequence[Ind]].Free; //MenuItem[index_sequence[Ind]].Free;
end else end else
UpdateMenu(MenuItem.Items[index_sequence[Ind]], DesignerMenuItem, Ind + 1, TheAction) UpdateMenu(MenuItem.Items[index_sequence[Ind]], DesignerMenuItem, Ind + 1, TheAction)
@ -1992,7 +1992,7 @@ begin
for i := MenuItem[index_sequence[Ind]].Count - 1 downto 0 do for i := MenuItem[index_sequence[Ind]].Count - 1 downto 0 do
begin begin
temp_menuitem:=MenuItem[index_sequence[Ind]].Items[i]; temp_menuitem:=MenuItem[index_sequence[Ind]].Items[i];
GlobalDesignHook.DeletePersistent(temp_menuitem); GlobalDesignHook.DeletePersistent(TPersistent(temp_menuitem));
//MenuItem[index_sequence[Ind]].Delete(i); //MenuItem[index_sequence[Ind]].Delete(i);
//MenuItem[index_sequence[Ind]].Items.Free //MenuItem[index_sequence[Ind]].Items.Free
end; end;

View File

@ -125,7 +125,7 @@ var
ContentsDir: String; ContentsDir: String;
MacOSDir: String; MacOSDir: String;
ResourcesDir: String; ResourcesDir: String;
sl: TStringList; sl: TStrings;
begin begin
AppBundleDir := ExtractFileNameWithoutExt(Filename) + ApplicationBundleExt + PathDelim; AppBundleDir := ExtractFileNameWithoutExt(Filename) + ApplicationBundleExt + PathDelim;
if not Recreate and DirectoryExistsUTF8(AppBundleDir) then exit(mrOk); if not Recreate and DirectoryExistsUTF8(AppBundleDir) then exit(mrOk);

View File

@ -1667,7 +1667,7 @@ var
NewUnit:=List.AddUnit(''); NewUnit:=List.AddUnit('');
end; end;
//DebugLn(['AddUnits AddUnitNodes ',CurUnit.Filename]); //DebugLn(['AddUnits AddUnitNodes ',CurUnit.Filename]);
AddUnitNodes(CurUnit,NewUnit); AddUnitNodes(CurUnit,TObject(NewUnit));
if (DestParentList=nil) then if (DestParentList=nil) then
DestParentList:=NewUnit; DestParentList:=NewUnit;
end; end;
@ -1709,7 +1709,7 @@ var
end; end;
end; end;
// create nodes for units // create nodes for units
AddUnits(SrcList,NewList); AddUnits(SrcList,TObject(NewList));
// update DestParentList // update DestParentList
if (DestParentList=nil) then if (DestParentList=nil) then
DestParentList:=NewList; DestParentList:=NewList;

View File

@ -676,7 +676,7 @@ procedure TLazFPDocFile.SetChildValue(Node: TDOMNode; const ChildName: string;
procedure ReadXMLFragmentFromString(AParentNode: TDOMNode; const s: string); procedure ReadXMLFragmentFromString(AParentNode: TDOMNode; const s: string);
var var
MemStream: TMemoryStream; MemStream: TStream;
begin begin
if s='' then exit; if s='' then exit;
try try

View File

@ -346,7 +346,7 @@ function CompareDefPropCacheItems(Item1, Item2: TDefinePropertiesCacheItem): int
function ComparePersClassNameAndDefPropCacheItem(Key: Pointer; function ComparePersClassNameAndDefPropCacheItem(Key: Pointer;
Item: TDefinePropertiesCacheItem): integer; Item: TDefinePropertiesCacheItem): integer;
function TryFreeComponent(var AComponent: TComponent): boolean; function TryFreeComponent(var obj): boolean;
procedure RegisterStandardClasses; procedure RegisterStandardClasses;
@ -393,16 +393,17 @@ begin
RegisterClasses([TStringList]); RegisterClasses([TStringList]);
end; end;
function TryFreeComponent(var AComponent: TComponent): boolean; function TryFreeComponent(var obj): boolean;
var var
OldName, OldClassName: string; OldName, OldClassName: string;
AComponent: TComponent absolute obj;
Begin Begin
Result:=false; Result := False;
{$IFNDEF NoCompCatch} {$IFNDEF NoCompCatch}
try try
{$ENDIF} {$ENDIF}
OldName:=AComponent.Name; OldName := AComponent.Name;
OldClassName:=AComponent.ClassName; OldClassName := AComponent.ClassName;
AComponent.Free; AComponent.Free;
Result := True; Result := True;
{$IFNDEF NoCompCatch} {$IFNDEF NoCompCatch}
@ -432,7 +433,7 @@ Begin
end; end;
end; end;
end; end;
AComponent:=nil; AComponent := nil;
end; end;
{ TComponentInterface } { TComponentInterface }

View File

@ -45,7 +45,7 @@ uses
{ for Get/SetForegroundWindow } { for Get/SetForegroundWindow }
LCLType, LCLIntf, LCLType, LCLIntf,
SynEdit, CodeCache, CodeToolManager, SynEdit, CodeCache, CodeToolManager,
MenuIntf, IDECommands, LazIDEIntf, ProjectIntf, SrcEditorIntf, MenuIntf, IDECommands, LazIDEIntf, ProjectIntf,
LazConf, LazConf,
CompilerOptions, EditorOptions, EnvironmentOpts, ProjectOpts, KeyMapping, SourceEditor, CompilerOptions, EditorOptions, EnvironmentOpts, ProjectOpts, KeyMapping, SourceEditor,
ProjectDefs, Project, IDEProcs, InputHistory, Debugger, CmdLineDebugger, ProjectDefs, Project, IDEProcs, InputHistory, Debugger, CmdLineDebugger,
@ -2409,7 +2409,7 @@ end;
function TDebugManager.DoRunToCursor: TModalResult; function TDebugManager.DoRunToCursor: TModalResult;
var var
ActiveSrcEdit: TSourceEditor; ActiveSrcEdit: TSourceEditorInterface;
ActiveUnitInfo: TUnitInfo; ActiveUnitInfo: TUnitInfo;
UnitFilename: string; UnitFilename: string;
begin begin
@ -2446,7 +2446,7 @@ begin
DebugLn('TDebugManager.DoRunToCursor C'); DebugLn('TDebugManager.DoRunToCursor C');
{$endif} {$endif}
FDebugger.RunTo(ExtractFilename(UnitFilename), FDebugger.RunTo(ExtractFilename(UnitFilename),
ActiveSrcEdit.EditorComponent.CaretY); TSourceEditor(ActiveSrcEdit).EditorComponent.CaretY);
{$ifdef VerboseDebugger} {$ifdef VerboseDebugger}
DebugLn('TDebugManager.DoRunToCursor D'); DebugLn('TDebugManager.DoRunToCursor D');

View File

@ -231,7 +231,6 @@ function ProgramDirectory: string;
procedure RaiseException(const Msg: string); procedure RaiseException(const Msg: string);
// miscellaneous // miscellaneous
procedure FreeThenNil(var Obj: TObject);
function CompareCaret(const FirstCaret, SecondCaret: TPoint): integer; function CompareCaret(const FirstCaret, SecondCaret: TPoint): integer;
function CompareBoolean(b1, b2: boolean): integer; function CompareBoolean(b1, b2: boolean): integer;
procedure CheckList(List: TList; TestListNil, TestDoubles, TestNils: boolean); procedure CheckList(List: TList; TestListNil, TestDoubles, TestNils: boolean);
@ -1123,12 +1122,6 @@ begin
Params:=RightStr(CmdLine,length(CmdLine)-p+1); Params:=RightStr(CmdLine,length(CmdLine)-p+1);
end; end;
procedure FreeThenNil(var Obj: TObject);
begin
Obj.Free;
Obj:=nil;
end;
{------------------------------------------------------------------------------- {-------------------------------------------------------------------------------
function CompareCaret(const FirstCaret, SecondCaret: TPoint): integer; function CompareCaret(const FirstCaret, SecondCaret: TPoint): integer;
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}

View File

@ -178,7 +178,7 @@ Lines: TStringList;
PreList, PreList,
AList, AList,
BList, BList,
PostList: TStringList; PostList: TStrings;
Indents: PInteger; Indents: PInteger;
X, Y: Integer; X, Y: Integer;
EqPos: Integer; EqPos: Integer;

View File

@ -749,7 +749,7 @@ begin
if Assigned(OldAction) then if Assigned(OldAction) then
begin begin
try try
FDesigner.PropertyEditorHook.DeletePersistent(OldAction); FDesigner.PropertyEditorHook.DeletePersistent(TPersistent(OldAction));
OldAction:=nil; OldAction:=nil;
except except
on E: Exception do begin on E: Exception do begin

View File

@ -697,12 +697,12 @@ procedure TNotebookComponentEditor.DoDeletePage;
var var
Hook: TPropertyEditorHook; Hook: TPropertyEditorHook;
OldIndex: integer; OldIndex: integer;
PageComponent: TComponent; PageComponent: TPersistent;
begin begin
OldIndex:=Notebook.PageIndex; OldIndex:=Notebook.PageIndex;
if (OldIndex>=0) and (OldIndex<Notebook.PageCount) then begin if (OldIndex>=0) and (OldIndex<Notebook.PageCount) then begin
if not GetHook(Hook) then exit; if not GetHook(Hook) then exit;
PageComponent:=TComponent(NoteBook.Pages.Objects[OldIndex]); PageComponent := TPersistent(NoteBook.Pages.Objects[OldIndex]);
Hook.DeletePersistent(PageComponent); Hook.DeletePersistent(PageComponent);
end; end;
end; end;

View File

@ -157,7 +157,7 @@ var
i: LongInt; i: LongInt;
Editor: TCompOptsExprEditor; Editor: TCompOptsExprEditor;
begin begin
SelTVNode:=GetSelectedNode(BuildProperty,NodeType); SelTVNode:=GetSelectedNode(TLazBuildProperty(BuildProperty),NodeType);
if BuildProperty=nil then exit; if BuildProperty=nil then exit;
if MessageDlg(lisConfirmDelete, if MessageDlg(lisConfirmDelete,
Format(lisDeleteBuildMode, ['"', BuildProperty.Identifier, '"']), Format(lisDeleteBuildMode, ['"', BuildProperty.Identifier, '"']),

View File

@ -50,7 +50,7 @@ uses
CodeToolManager, CodeCache, NonPascalCodeTools, BasicCodeTools, CodeToolManager, CodeCache, NonPascalCodeTools, BasicCodeTools,
DefineTemplates, FileProcs, AVL_Tree, Laz_XMLCfg, DefineTemplates, FileProcs, AVL_Tree, Laz_XMLCfg,
// IDE Interface // IDE Interface
IDEExternToolIntf, NewItemIntf, ProjectIntf, PackageIntf, MenuIntf, SrcEditorIntf, IDEExternToolIntf, NewItemIntf, ProjectIntf, PackageIntf, MenuIntf,
PropEdits, IDEMsgIntf, MacroIntf, LazIDEIntf, PropEdits, IDEMsgIntf, MacroIntf, LazIDEIntf,
// IDE // IDE
LazConf, LazarusIDEStrConsts, IDEProcs, ObjectLists, DialogProcs, IDECommands, LazConf, LazarusIDEStrConsts, IDEProcs, ObjectLists, DialogProcs, IDECommands,
@ -692,7 +692,7 @@ end;
procedure TPkgManager.MainIDEitmPkgOpenPackageOfCurUnitClicked(Sender: TObject); procedure TPkgManager.MainIDEitmPkgOpenPackageOfCurUnitClicked(Sender: TObject);
var var
ActiveSourceEditor: TSourceEditor; ActiveSourceEditor: TSourceEditorInterface;
ActiveUnitInfo: TUnitInfo; ActiveUnitInfo: TUnitInfo;
PkgFile: TPkgFile; PkgFile: TPkgFile;
Filename: String; Filename: String;
@ -2850,8 +2850,8 @@ var
function RemoveExistingUnitnames: TModalResult; function RemoveExistingUnitnames: TModalResult;
var var
ImplementationUsesSection: TStringList; ImplementationUsesSection: TStrings;
MainUsesSection: TStringList; MainUsesSection: TStrings;
j: LongInt; j: LongInt;
i: Integer; i: Integer;
begin begin
@ -3403,7 +3403,7 @@ end;
function TPkgManager.DoAddActiveUnitToAPackage: TModalResult; function TPkgManager.DoAddActiveUnitToAPackage: TModalResult;
var var
ActiveSourceEditor: TSourceEditor; ActiveSourceEditor: TSourceEditorInterface;
ActiveUnitInfo: TUnitInfo; ActiveUnitInfo: TUnitInfo;
PkgFile: TPkgFile; PkgFile: TPkgFile;
Filename: String; Filename: String;