From 6f4eac6eeb60835bf85382b5844b1e83819369eb Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Tue, 4 Dec 2018 20:50:26 +0100 Subject: [PATCH] Support dropping databases with leading space. Closes #427. --- source/main.pas | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/main.pas b/source/main.pas index 2a9ca125..1926f8aa 100644 --- a/source/main.pas +++ b/source/main.pas @@ -3213,12 +3213,13 @@ begin if DBTreeClicked(Sender) then begin // drop table selected in tree view. - case ActiveDBObj.NodeType of + DBObject := ActiveDBObj; + case DBObject.NodeType of lntDb: begin - if MessageDialog(f_('Drop Database "%s"?', [Conn.Database]), f_('WARNING: You will lose all objects in database %s!', [Conn.Database]), mtCriticalConfirmation, [mbok,mbcancel]) <> mrok then + if MessageDialog(f_('Drop Database "%s"?', [DBObject.Database]), f_('WARNING: You will lose all objects in database %s!', [DBObject.Database]), mtCriticalConfirmation, [mbok,mbcancel]) <> mrok then Abort; try - db := Conn.Database; + db := DBObject.Database; Node := FindDBNode(DBtree, Conn, db); SetActiveDatabase('', Conn); Conn.Query('DROP DATABASE ' + Conn.QuoteIdent(db)); @@ -3232,7 +3233,7 @@ begin end; Exit; end; - lntTable..lntEvent: ObjectList.Add(ActiveDbObj); + lntTable..lntEvent: ObjectList.Add(ActiveDBObj); end; end else begin // Invoked from database tab