diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-08-19 13:01:51 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-08-19 16:28:12 +0200 |
commit | db56c1ccdb03a8b22e6021e2bd394745a1f997cf (patch) | |
tree | d39e260aa8e576d27285e557f82954062d149f81 /dbaccess | |
parent | 3a79f2241443e1dbbbe4ca783e8f27a3a6611447 (diff) |
restore call to dragFinished on successful drop
Change-Id: Ib8a1e7f38d4e5f658ff55b645d39b0c521e21f87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100990
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/inc/JoinTableView.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/TableWindowListBox.hxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/callbacks.hxx | 11 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/JoinTableView.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/TableWindowListBox.cxx | 14 |
5 files changed, 33 insertions, 1 deletions
diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx index 53201878ad56..413cccf32e7d 100644 --- a/dbaccess/source/ui/inc/JoinTableView.hxx +++ b/dbaccess/source/ui/inc/JoinTableView.hxx @@ -75,6 +75,7 @@ namespace dbaui class OJoinTableView : public vcl::Window, + public IDragTransferableListener, public DropTargetHelper { friend class OJoinMoveTabWinUndoAct; @@ -274,6 +275,7 @@ namespace dbaui virtual void Resize() override; + virtual void dragFinished( ) override; /// @note here the physical position (that can be changed while /// resizing) is used, as no scrolling can take place while resizing virtual void Command(const CommandEvent& rEvt) override; diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx index 968ef93ab506..5ca01098266b 100644 --- a/dbaccess/source/ui/inc/TableWindowListBox.hxx +++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx @@ -50,6 +50,7 @@ namespace dbaui class OTableWindowListBox : public InterimItemWindow + , public IDragTransferableListener { std::unique_ptr<weld::TreeView> m_xTreeView; std::unique_ptr<TableWindowListBoxHelper> m_xDragDropTargetHelper; @@ -71,6 +72,8 @@ namespace dbaui virtual void LoseFocus() override; virtual void GetFocus() override; + virtual void dragFinished( ) override; + public: OTableWindowListBox(OTableWindow* pParent); virtual ~OTableWindowListBox() override; diff --git a/dbaccess/source/ui/inc/callbacks.hxx b/dbaccess/source/ui/inc/callbacks.hxx index d55edc6a63cb..c7a8864eae29 100644 --- a/dbaccess/source/ui/inc/callbacks.hxx +++ b/dbaccess/source/ui/inc/callbacks.hxx @@ -105,6 +105,17 @@ namespace dbaui ~IContextMenuProvider() {} }; + // IDragTransferableListener + class SAL_NO_VTABLE IDragTransferableListener + { + public: + /// called when a drag operation done with a Transferable has been finished + virtual void dragFinished( ) = 0; + + protected: + ~IDragTransferableListener() {} + }; + } // namespace dbaui #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_CALLBACKS_HXX diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index ecd6d47aedea..5ef30e19aeda 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -1473,6 +1473,10 @@ sal_Int8 OJoinTableView::ExecuteDrop( const ExecuteDropEvent& /*_rEvt*/ ) return DND_ACTION_NONE; } +void OJoinTableView::dragFinished( ) +{ +} + void OJoinTableView::clearLayoutInformation() { m_pLastFocusTabWin = nullptr; diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx index db2af6ad9458..ae83c8714458 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -58,6 +58,16 @@ OTableWindowListBox::OTableWindowListBox( OTableWindow* pParent ) m_xTreeView->connect_drag_begin(LINK(this, OTableWindowListBox, DragBeginHdl)); } +void OTableWindowListBox::dragFinished( ) +{ + // first show the error msg when existing + m_pTabWin->getDesignView()->getController().showError(m_pTabWin->getDesignView()->getController().clearOccurredError()); + // second look for ui activities which should happen after d&d + if (m_nUiEvent) + Application::RemoveUserEvent(m_nUiEvent); + m_nUiEvent = Application::PostUserEvent(LINK(this, OTableWindowListBox, LookForUiHdl), nullptr, true); +} + OTableWindowListBox::~OTableWindowListBox() { disposeOnce(); @@ -203,7 +213,9 @@ sal_Int8 OTableWindowListBox::ExecuteDrop( const ExecuteDropEvent& _rEvt ) Application::RemoveUserEvent(m_nDropEvent); m_nDropEvent = Application::PostUserEvent(LINK(this, OTableWindowListBox, DropHdl), nullptr, true); - return DND_ACTION_LINK; + dragFinished(); + + return DND_ACTION_NONE; } return DND_ACTION_NONE; } |