IDE: Text was pasted from clipboard to both OI (or other window) and source editor. Issue #22143

git-svn-id: trunk@37492 -
This commit is contained in:
juha 2012-06-02 23:30:19 +00:00
parent 326c5a7fb3
commit 35adfd6e3d

View File

@ -19093,14 +19093,15 @@ begin
end; end;
end; end;
procedure TMainIDE.DoSourceEditorCommand(EditorCommand: integer; procedure TMainIDE.DoSourceEditorCommand(EditorCommand: integer; CheckFocus: boolean);
CheckFocus: boolean);
var var
CurFocusControl: TWinControl; CurFocusControl: TWinControl;
ActiveSourceEditor: TSourceEditor; ActiveSourceEditor: TSourceEditor;
ActiveUnitInfo: TUnitInfo; ActiveUnitInfo: TUnitInfo;
begin begin
// check that the currently focus is on the MainIDEBar or on the SourceEditor CurFocusControl:=Nil;
ActiveSourceEditor:=Nil;
// check if focus is on MainIDEBar or on SourceEditor
if CheckFocus then if CheckFocus then
begin begin
CurFocusControl:=FindOwnerControl(GetFocus); CurFocusControl:=FindOwnerControl(GetFocus);
@ -19109,17 +19110,16 @@ begin
break; break;
CurFocusControl:=CurFocusControl.Parent; CurFocusControl:=CurFocusControl.Parent;
end; end;
if CurFocusControl=nil then
begin
// continue processing shortcut, not handled yet
MainIDEBar.mnuMainMenu.ShortcutHandled := false;
end;
end; end;
GetCurrentUnit(ActiveSourceEditor,ActiveUnitInfo); if Assigned(CurFocusControl) then
if ActiveSourceEditor=nil then begin // MainIDEBar or SourceNotebook has focus -> find active source editor
MainIDEBar.mnuMainMenu.ShortcutHandled := false GetCurrentUnit(ActiveSourceEditor,ActiveUnitInfo);
else if Assigned(ActiveSourceEditor) then
ActiveSourceEditor.DoEditorExecuteCommand(EditorCommand); ActiveSourceEditor.DoEditorExecuteCommand(EditorCommand); // pass the command
end;
// Not passed to source editor -> continue processing shortcut, not handled yet
if (CurFocusControl=Nil) or (ActiveSourceEditor=Nil) then
MainIDEBar.mnuMainMenu.ShortcutHandled := false;
end; end;
procedure TMainIDE.DoInsertGUID; procedure TMainIDE.DoInsertGUID;