From 9e62d5ca0266a7572919a448921d8e2907d48412 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Fri, 30 Jan 2009 20:00:31 +0000 Subject: [PATCH] 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. --- source/main.pas | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/main.pas b/source/main.pas index 5c01f4d6..17706dbc 100644 --- a/source/main.pas +++ b/source/main.pas @@ -8787,6 +8787,8 @@ begin // Copy text from a focused control to clipboard Success := False; Control := ActiveControl; + // Do not handle Search/replace dialog + if not Control.Focused then Exit; DoCut := Sender = actCut; if Control is TCustomEdit then begin Edit := TCustomEdit(Control); @@ -8830,6 +8832,8 @@ begin // Paste text into the focused control Success := False; Control := ActiveControl; + // Do not handle Search/replace dialog + if not Control.Focused then Exit; if not Clipboard.HasFormat(CF_TEXT) then begin // Do nothing, we cannot paste a picture or so end else if Control is TCustomEdit then begin @@ -8867,6 +8871,8 @@ begin // Select all items, text or whatever Success := False; Control := ActiveControl; + // Do not handle Search/replace dialog + if not Control.Focused then Exit; if Control is TCustomEdit then begin TCustomEdit(Control).SelectAll; Success := True;