From f259be48749fd0cec281a23e2ef2e34b186f3aa2 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Thu, 28 Oct 2010 00:30:30 +0200 Subject: TfpgDrag.Execute: replaced Assert() calls with Exceptions. This does error checking before and DND gets triggered. The error messages must still be replaced with resource strings though. --- src/corelib/fpg_main.pas | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas index 25e8806d..0f117360 100644 --- a/src/corelib/fpg_main.pas +++ b/src/corelib/fpg_main.pas @@ -2458,8 +2458,13 @@ end; function TfpgDrag.Execute(const ADropActions: TfpgDropActions; const ADefaultAction: TfpgDropAction): TfpgDropAction; begin - Assert(FMimeData <> nil, ClassName + ': No mimedata was set before starting the drag'); - Assert(FSource <> nil, ClassName + ': No Source window was specified before starting the drag'); + {$NOTE These exception messages need to become resource strings } + if not Assigned(FMimeData) then + raise Exception.Create(ClassName + ': No mimedata was set before starting the drag'); + if not Assigned(FSource) then + raise Exception.Create(ClassName + ': No Source window was specified before starting the drag'); + if ADropActions = [] then + raise Exception.Create(ClassName + ': No Drop Action was specified'); inherited Execute(ADropActions, ADefaultAction); end; -- cgit v1.2.3-70-g09d2