diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-04-29 09:49:11 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-04-30 13:41:08 +0200 |
commit | 1320afe376bc52bc64995ba976391ec21db6ccde (patch) | |
tree | 21c1583357ce2e74aedbd886fd810ce637298c63 | |
parent | 5f89b8cc5521b683a519b93bbc3da739ed0fd795 (diff) |
allow dnd into weldeditview
Change-Id: I42fafed01a3884279781642154656f0ee32ad431
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114846
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/svx/weldeditview.hxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/weldeditview.cxx | 7 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmaddressblockpage.hxx | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/include/svx/weldeditview.hxx b/include/svx/weldeditview.hxx index 1f388cbabc73..c40a754a2fc8 100644 --- a/include/svx/weldeditview.hxx +++ b/include/svx/weldeditview.hxx @@ -49,6 +49,8 @@ public: protected: bool m_bAcceptsTab; + // m_xDropTarget must outlive m_xEditView + css::uno::Reference<css::datatransfer::dnd::XDropTarget> m_xDropTarget; std::unique_ptr<EditEngine> m_xEditEngine; std::unique_ptr<EditView> m_xEditView; rtl::Reference<WeldEditAccessible> m_xAccessible; @@ -69,6 +71,8 @@ protected: virtual void LoseFocus() override; virtual void Resize() override; + virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> GetDropTarget() override; + // Whether Tab will result in entering a tab or not bool GetAcceptsTab() const { return m_bAcceptsTab; } diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx index 6e83d079c722..83f24e8337d4 100644 --- a/svx/source/dialog/weldeditview.cxx +++ b/svx/source/dialog/weldeditview.cxx @@ -1603,6 +1603,13 @@ void WeldEditView::LoseFocus() } } +css::uno::Reference<css::datatransfer::dnd::XDropTarget> WeldEditView::GetDropTarget() +{ + if (!m_xDropTarget) + m_xDropTarget = weld::CustomWidgetController::GetDropTarget(); + return m_xDropTarget; +} + namespace { class WeldEditViewUIObject final : public DrawingAreaUIObject diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx index 8170b9193211..1ab100c9539b 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.hxx +++ b/sw/source/ui/dbui/mmaddressblockpage.hxx @@ -140,8 +140,6 @@ class AddressMultiLineEdit : public WeldEditView Link<AddressMultiLineEdit&,void> m_aModifyLink; SwCustomizeAddressBlockDialog* m_pParentDialog; - css::uno::Reference<css::datatransfer::dnd::XDropTarget> m_xDropTarget; - virtual void EditViewSelectionChange() override; virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> GetDropTarget() override; |