IDE: sourceeditor: fixed crash if mouse enters while no editor has focus

git-svn-id: trunk@32224 -
This commit is contained in:
mattias 2011-09-08 08:13:27 +00:00
parent 80920f6286
commit 66e4658fc5

View File

@ -4435,16 +4435,21 @@ begin
end;
procedure TSourceEditor.EditorEnter(Sender: TObject);
var
SrcEdit: TSourceEditor;
begin
if (FSourceNoteBook.FUpdateLock <> 0) or
(FSourceNoteBook.FFocusLock <> 0)
then exit;
if (FSourceNoteBook.PageIndex = PageIndex) then
Activate
else
SourceNotebook.GetActiveSE.FocusEditor;
else begin
SrcEdit:=SourceNotebook.GetActiveSE;
if SrcEdit<>nil then
SrcEdit.FocusEditor;
// Navigating with mousebuttons between editors (eg jump history on btn 4/5)
// can trigger the old editor to be refocused (while not visible)
end;
end;
procedure TSourceEditor.EditorActivateSyncro(Sender: TObject);