diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-29 10:21:11 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-12-01 20:51:12 +0100 |
commit | 19d17a739cc61341ca74cfa485e919c6012fe28c (patch) | |
tree | be3823e68681d796275149d08059872dde680534 /include | |
parent | b1f9e704cb9148b6e211005dab0cd153957a1b2b (diff) |
weld FmFieldWin
needs drag source support
fixes a leak of ColumnInfo data as well
Change-Id: I671834726aed3fd4de096b56baaa592f51a9e73e
Reviewed-on: https://gerrit.libreoffice.org/84147
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/dbaexchange.hxx | 12 | ||||
-rw-r--r-- | include/vcl/transfer.hxx | 2 | ||||
-rw-r--r-- | include/vcl/treelistbox.hxx | 6 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 10 |
4 files changed, 23 insertions, 7 deletions
diff --git a/include/svx/dbaexchange.hxx b/include/svx/dbaexchange.hxx index d831dc4e2ed0..bccdf5bacf00 100644 --- a/include/svx/dbaexchange.hxx +++ b/include/svx/dbaexchange.hxx @@ -51,15 +51,17 @@ namespace svx //= OColumnTransferable - class SAL_WARN_UNUSED SVX_DLLPUBLIC OColumnTransferable final : public TransferableHelper + class SAL_WARN_UNUSED SVX_DLLPUBLIC OColumnTransferable final : public TransferDataContainer { public: + OColumnTransferable(ColumnTransferFormatFlags nFormats); + /** construct the transferable from a data access descriptor Note that some of the aspects, in particular all which cannot be represented as string, can only be transported via the CTF_COLUMN_DESCRIPTOR format. - @param _rDescriptor + @param rDescriptor The descriptor for the column. It must contain at least <ul><li>information sufficient to create a connection, that is, either one of DataSource, DatabaseLocation, ConnectionResource, and DataAccessDescriptorProperty::Connection</li> @@ -68,10 +70,8 @@ namespace svx <li>a ColumnName or ColumnObject</li> </ul> */ - OColumnTransferable( - const ODataAccessDescriptor& _rDescriptor, - ColumnTransferFormatFlags _nFormats - ); + void setDescriptor(const ODataAccessDescriptor& rDescriptor); + /** construct the transferable from a DatabaseForm component and a field name diff --git a/include/vcl/transfer.hxx b/include/vcl/transfer.hxx index 75af922a007c..a0b773984d3b 100644 --- a/include/vcl/transfer.hxx +++ b/include/vcl/transfer.hxx @@ -483,7 +483,7 @@ public: struct TransferDataContainer_Impl; -class VCL_DLLPUBLIC TransferDataContainer final : public TransferableHelper +class VCL_DLLPUBLIC TransferDataContainer : public TransferableHelper { std::unique_ptr<TransferDataContainer_Impl> pImpl; diff --git a/include/vcl/treelistbox.hxx b/include/vcl/treelistbox.hxx index ecb1ce8029af..cb4945a96717 100644 --- a/include/vcl/treelistbox.hxx +++ b/include/vcl/treelistbox.hxx @@ -225,9 +225,13 @@ class VCL_DLLPUBLIC SvTreeListBox SelectionMode eSelMode; sal_Int32 nMinWidthInChars; + sal_Int8 mnDragAction; + SvTreeListEntry* pEdEntry; SvLBoxItem* pEdItem; + rtl::Reference<TransferDataContainer> m_xTransferHelper; + protected: std::unique_ptr<SvImpLBox> pImpl; short nColumns; @@ -726,6 +730,8 @@ public: void SetForceMakeVisible(bool bEnable); virtual FactoryFunction GetUITestFactory() const override; + + void SetDragHelper(rtl::Reference<TransferDataContainer>& rHelper, sal_uInt8 eDNDConstants); }; class SvInplaceEdit2 diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index abe71e42fedb..e7025b134506 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -63,6 +63,7 @@ enum class PointerStyle; class SvNumberFormatter; class KeyEvent; class MouseEvent; +class TransferDataContainer; class OutputDevice; class VirtualDevice; struct SystemEnvData; @@ -686,7 +687,10 @@ protected: Link<const TreeIter&, bool> m_aExpandingHdl; Link<TreeView&, void> m_aVisibleRangeChangedHdl; Link<TreeView&, void> m_aModelChangedHdl; + // if handler returns true, then menu has been show and event is consumed Link<const CommandEvent&, bool> m_aPopupMenuHdl; + // if handler returns true, drag is disallowed + Link<TreeView&, bool> m_aDragBeginHdl; std::function<int(const weld::TreeIter&, const weld::TreeIter&)> m_aCustomSort; std::vector<int> m_aRadioIndexes; @@ -937,6 +941,12 @@ public: m_aPopupMenuHdl = rLink; } + virtual void enable_drag_source(rtl::Reference<TransferDataContainer>& rTransferrable, + sal_uInt8 eDNDConstants) + = 0; + + void connect_drag_begin(const Link<TreeView&, bool>& rLink) { m_aDragBeginHdl = rLink; } + //all of them void select_all() { unselect(-1); } void unselect_all() { select(-1); } |