mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 19:20:17 +08:00
Work around bug #965: paste text in find or search dialog. Ctrl+C/V/X does just nothing now if a search/replace dialog is open. Looks like the dialogs don't show up as Mainform.ActiveControl so it's impossible to handle it. Even a Windows message WM_CUT onto the dialogs handle has no effect here.
This commit is contained in:
@ -8787,6 +8787,8 @@ begin
|
|||||||
// Copy text from a focused control to clipboard
|
// Copy text from a focused control to clipboard
|
||||||
Success := False;
|
Success := False;
|
||||||
Control := ActiveControl;
|
Control := ActiveControl;
|
||||||
|
// Do not handle Search/replace dialog
|
||||||
|
if not Control.Focused then Exit;
|
||||||
DoCut := Sender = actCut;
|
DoCut := Sender = actCut;
|
||||||
if Control is TCustomEdit then begin
|
if Control is TCustomEdit then begin
|
||||||
Edit := TCustomEdit(Control);
|
Edit := TCustomEdit(Control);
|
||||||
@ -8830,6 +8832,8 @@ begin
|
|||||||
// Paste text into the focused control
|
// Paste text into the focused control
|
||||||
Success := False;
|
Success := False;
|
||||||
Control := ActiveControl;
|
Control := ActiveControl;
|
||||||
|
// Do not handle Search/replace dialog
|
||||||
|
if not Control.Focused then Exit;
|
||||||
if not Clipboard.HasFormat(CF_TEXT) then begin
|
if not Clipboard.HasFormat(CF_TEXT) then begin
|
||||||
// Do nothing, we cannot paste a picture or so
|
// Do nothing, we cannot paste a picture or so
|
||||||
end else if Control is TCustomEdit then begin
|
end else if Control is TCustomEdit then begin
|
||||||
@ -8867,6 +8871,8 @@ begin
|
|||||||
// Select all items, text or whatever
|
// Select all items, text or whatever
|
||||||
Success := False;
|
Success := False;
|
||||||
Control := ActiveControl;
|
Control := ActiveControl;
|
||||||
|
// Do not handle Search/replace dialog
|
||||||
|
if not Control.Focused then Exit;
|
||||||
if Control is TCustomEdit then begin
|
if Control is TCustomEdit then begin
|
||||||
TCustomEdit(Control).SelectAll;
|
TCustomEdit(Control).SelectAll;
|
||||||
Success := True;
|
Success := True;
|
||||||
|
Reference in New Issue
Block a user