Open attachment 150630 [details] from bug 124629; right-click inside the pivot table, and select "Edit Layout..." (or select a cell inside the pivot table, then menu Data▸Pivot Table▸Create...); try to drag Years2 in Column Fields to the topmost position (above Years). It is impossible; only possible to put it second. So moving a field to top requires two actions: moving it to the second position, then dragging topmost item one position down.
Confirm in Version: 6.3.0.0.alpha0+ Build ID: 7327260de3c0c627e62f7c3fddbe3d71ea88e88f CPU threads: 4; OS: Windows 6.1; UI render: default; VCL: win; TinderBox: Win-x86@42, Branch:master, Time: 2019-04-05_06:26:35 Locale: ru-RU (ru_RU); UI-Language: en-US Calc: threaded
Code pointers: the code to handle drag&drop in the list boxes is in vcl/source/treelist/treelistbox.cxx. Look at SvTreeListBox::AcceptDrop, which uses GetDropTarget to find out *below* which element to draw the drop cursor, and which element to remember for actual drop. The drop method (SvTreeListBox::ExecuteDrop), as well as drop cursor drawing method (ImplShowTargetEmphasis), accept nullptr as target element, meaning "at the top". So the question is how to make GetDropTarget return nullptr when mouse is over top half of topmost element of the list (a hint: SvImpLBox::GetEntry might need to be modified to take an optional out bool parameter telling if the pos is at the top half of the element).
(In reply to Mike Kaganski from comment #2) > Code pointers: > > the code to handle drag&drop in the list boxes is in > vcl/source/treelist/treelistbox.cxx. Look at SvTreeListBox::AcceptDrop, > which uses GetDropTarget to find out *below* which element to draw the drop > cursor, and which element to remember for actual drop. The drop method > (SvTreeListBox::ExecuteDrop), as well as drop cursor drawing method > (ImplShowTargetEmphasis), accept nullptr as target element, meaning "at the > top". So the question is how to make GetDropTarget return nullptr when mouse > is over top half of topmost element of the list (a hint: SvImpLBox::GetEntry > might need to be modified to take an optional out bool parameter telling if > the pos is at the top half of the element). ImplShowTargetEmphasis(nullptr,true) doesn't draw anything and forcing GetDropTarget to return nullptr doesn't move an entry to the top but to the bottom.What am I doing wrong?
(In reply to perzde from comment #3) > (In reply to Mike Kaganski from comment #2) > > Code pointers: > > > > the code to handle drag&drop in the list boxes is in > > vcl/source/treelist/treelistbox.cxx. Look at SvTreeListBox::AcceptDrop, > > which uses GetDropTarget to find out *below* which element to draw the drop > > cursor, and which element to remember for actual drop. The drop method > > (SvTreeListBox::ExecuteDrop), as well as drop cursor drawing method > > (ImplShowTargetEmphasis), accept nullptr as target element, meaning "at the > > top". So the question is how to make GetDropTarget return nullptr when mouse > > is over top half of topmost element of the list (a hint: SvImpLBox::GetEntry > > might need to be modified to take an optional out bool parameter telling if > > the pos is at the top half of the element). > > ImplShowTargetEmphasis(nullptr,true) doesn't draw anything and forcing > GetDropTarget to return nullptr doesn't move an entry to the top but to the > bottom.What am I doing wrong? Hi! Thanks for looking into it. But let's discuss all the code-related questions in a gerrit change that you create, where it's only possible to actually see what you do, and - what you do wrong, or where I am wrong.
(In reply to Mike Kaganski from comment #4) > > Hi! Thanks for looking into it. > But let's discuss all the code-related questions in a gerrit change that you > create, where it's only possible to actually see what you do, and - what you > do wrong, or where I am wrong. I submitted a patch for review (work in progress). https://gerrit.libreoffice.org/#/c/71241/
Ah, it was fixed independently by Caolán in https://git.libreoffice.org/core/+/f82356d9a1ce1457593a5f42728e2962561328cf; see tdf#125095 where I described results from that patch. perzde@hotmail.com : sorry for that; it happens sometimes. Looking forward to see your patches for other issues!