From 3000091cd226bcc54ef79274f56d5e162e7a1369 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 20 Jan 2019 11:13:49 +0100 Subject: [PATCH] Allow columns reordering only if its wxCOL_REORDERABLE flag is set Dragging the column should be allowed only if wxHD_ALLOW_REORDER header style and wxCOL_REORDERABLE column flag are both set. Closes #18332. --- src/generic/headerctrlg.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/generic/headerctrlg.cpp b/src/generic/headerctrlg.cpp index 7af227fdbd..4529a849c3 100644 --- a/src/generic/headerctrlg.cpp +++ b/src/generic/headerctrlg.cpp @@ -686,8 +686,11 @@ void wxHeaderCtrl::OnMouse(wxMouseEvent& mevent) wxASSERT_MSG( !IsResizing(), "reentering column resize mode?" ); StartOrContinueResizing(col, xPhysical); } - else if ( HasFlag(wxHD_ALLOW_REORDER) ) // on column itself + // on column itself - both header and column must have the appropriate + // flags to allow dragging the column + else if ( HasFlag(wxHD_ALLOW_REORDER) && GetColumn(col).IsReorderable() ) { + // start dragging the column wxASSERT_MSG( !IsReordering(), "reentering column move mode?" );