From 7b938aafdc3a0ce9d8bbb36c53e6e05efe17a5c9 Mon Sep 17 00:00:00 2001 From: martin Date: Sat, 27 Mar 2010 00:03:48 +0000 Subject: [PATCH] SourceEditor, fixed accidental removed method from SrcEditorInterface git-svn-id: trunk@24235 - --- ide/main.pp | 7 +++++++ ide/sourceeditor.pp | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ide/main.pp b/ide/main.pp index 8818da3600..61e7fc5de3 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -864,6 +864,7 @@ type deprecated; // deprecated in 0.9.29 March 2010 procedure GetDesignerUnit(ADesigner: TDesigner; var ActiveSourceEditor: TSourceEditor; var ActiveUnitInfo: TUnitInfo); override; + function GetProjectFileForProjectEditor(AEditor: TSourceEditorInterface): TLazProjectFile; override; function GetDesignerForProjectEditor(AEditor: TSourceEditorInterface; LoadForm: boolean): TIDesigner; override; function GetDesignerWithProjectFile(AFile: TLazProjectFile; @@ -11544,6 +11545,12 @@ begin end; end; +function TMainIDE.GetProjectFileForProjectEditor(AEditor: TSourceEditorInterface + ): TLazProjectFile; +begin + Result := Project1.UnitWithEditorComponent(AEditor); +end; + function TMainIDE.GetDesignerForProjectEditor(AEditor: TSourceEditorInterface; LoadForm: boolean): TIDesigner; var diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp index 179f52848e..51d131a250 100644 --- a/ide/sourceeditor.pp +++ b/ide/sourceeditor.pp @@ -53,6 +53,7 @@ uses SynPluginSyncronizedEditBase, // Intf SrcEditorIntf, MenuIntf, LazIDEIntf, PackageIntf, IDEHelpIntf, IDEImagesIntf, + ProjectIntf, // IDE units IDEDialogs, LazarusIDEStrConsts, IDECommands, EditorOptions, WordCompletion, FindReplaceDialog, IDEProcs, IDEOptionDefs, @@ -386,6 +387,7 @@ type procedure SetLines(const AValue: TStrings); override; // context + function GetProjectFile: TLazProjectFile; override; procedure UpdateProjectFile; override; function GetDesigner(LoadForm: boolean): TIDesigner; override; @@ -3984,6 +3986,11 @@ begin FEditor.Lines:=AValue; end; +function TSourceEditor.GetProjectFile: TLazProjectFile; +begin + Result:=LazarusIDE.GetProjectFileForProjectEditor(Self); +end; + procedure TSourceEditor.UpdateProjectFile; begin if Assigned(Manager) and Assigned(Manager.OnEditorMoved) @@ -6300,7 +6307,6 @@ end; Procedure TSourceNotebook.ReloadEditorOptions; var I: integer; - h: TLazSyntaxHighlighter; Begin for i := 0 to EditorCount-1 do Editors[i].RefreshEditorSettings;