summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2010-10-28 00:30:30 +0200
committerGraeme Geldenhuys <graemeg@gmail.com>2010-10-28 00:30:30 +0200
commitf259be48749fd0cec281a23e2ef2e34b186f3aa2 (patch)
treecdadf72e41779242b1eee448c0db8cd6634d8097 /src
parentbda7ccb8e5920125cde97dd8f1ef0af25ad39804 (diff)
downloadfpGUI-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.pas9
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;