[Libreoffice-commits] core.git: include/svx svx/source sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Apr 30 11:41:44 UTC 2021
include/svx/weldeditview.hxx | 4 ++++
svx/source/dialog/weldeditview.cxx | 7 +++++++
sw/source/ui/dbui/mmaddressblockpage.hxx | 2 --
3 files changed, 11 insertions(+), 2 deletions(-)
New commits:
commit 1320afe376bc52bc64995ba976391ec21db6ccde
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Apr 29 09:49:11 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Apr 30 13:41:08 2021 +0200
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 at redhat.com>
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;
More information about the Libreoffice-commits
mailing list