diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2010-10-28 00:30:30 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2010-10-28 00:30:30 +0200 |
commit | f259be48749fd0cec281a23e2ef2e34b186f3aa2 (patch) | |
tree | cdadf72e41779242b1eee448c0db8cd6634d8097 /src | |
parent | bda7ccb8e5920125cde97dd8f1ef0af25ad39804 (diff) | |
download | fpGUI-f259be48749fd0cec281a23e2ef2e34b186f3aa2.tar.xz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/fpg_main.pas | 9 |
1 files changed, 7 insertions, 2 deletions
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; |