include/vcl/treelistbox.hxx | 5 ++--- vcl/source/treelist/treelistbox.cxx | 27 +++++++++++---------------- 2 files changed, 13 insertions(+), 19 deletions(-)
New commits: commit 84f1c0f7cafc0afb01eac53995d987cbe9b0c771 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Jul 3 11:50:46 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Jul 3 13:22:08 2020 +0200 DragDropMode::CTRL_COPY is dead since commit 3c5e074a8fe5e0a18d326d37bc54a5ec0f077e4e Date: Fri Jun 19 12:37:05 2020 +0100 weld DataNavigator Change-Id: Ib1a0474e0543f863236d58195653c6369c21e2fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97829 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/vcl/treelistbox.hxx b/include/vcl/treelistbox.hxx index 41af57b75097..ce45fab4a9ee 100644 --- a/include/vcl/treelistbox.hxx +++ b/include/vcl/treelistbox.hxx @@ -148,16 +148,15 @@ enum class DragDropMode { NONE = 0x0000, CTRL_MOVE = 0x0001, - CTRL_COPY = 0x0002, APP_COPY = 0x0004, // Entries may be dropped via the uppermost Entry // The DropTarget is 0 in that case ENABLE_TOP = 0x0010, - ALL = 0x0017, + ALL = 0x0015, }; namespace o3tl { - template<> struct typed_flags<DragDropMode> : is_typed_flags<DragDropMode, 0x0017> {}; + template<> struct typed_flags<DragDropMode> : is_typed_flags<DragDropMode, 0x0015> {}; } enum class SvTreeListBoxFlags diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index f8a196ef29b4..ef3176e08162 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -492,25 +492,20 @@ bool SvTreeListBox::DoubleClickHdl() bool SvTreeListBox::CheckDragAndDropMode( SvTreeListBox const * pSource, sal_Int8 nAction ) { - if ( pSource == this ) + if ( pSource != this ) + return false; // no drop + + if ( !(nDragDropMode & DragDropMode::CTRL_MOVE) ) + return false; // D&D locked within list + + if( DND_ACTION_MOVE == nAction ) { - if ( !(nDragDropMode & (DragDropMode::CTRL_MOVE | DragDropMode::CTRL_COPY) ) ) - return false; // D&D locked within list - if( DND_ACTION_MOVE == nAction ) - { - if ( !(nDragDropMode & DragDropMode::CTRL_MOVE) ) - return false; // no local move - } - else - { - if ( !(nDragDropMode & DragDropMode::CTRL_COPY)) - return false; // no local copy - } + if ( !(nDragDropMode & DragDropMode::CTRL_MOVE) ) + return false; // no local move } else - { - return false; // no drop - } + return false; // no local copy + return true; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits