[Libreoffice-commits] core.git: vcl/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Tue Feb 25 16:19:54 UTC 2020
vcl/source/app/salvtables.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit bc8488ed715102f08423ce5953727ad8e97fd687
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Feb 25 11:45:41 2020 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Feb 25 17:19:18 2020 +0100
tdf#130915 SvTreeList::Move needs to move from lower index to higher
the reverse doesn't work
Change-Id: I0d84e6e44b26c0c4f1f0d221de3fad03c183f6ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89425
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 49acab55dcb7..0dc8b989f408 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -3571,9 +3571,11 @@ public:
virtual void swap(int pos1, int pos2) override
{
+ int min = std::min(pos1, pos2);
+ int max = std::max(pos1, pos2);
SvTreeList* pModel = m_xTreeView->GetModel();
- SvTreeListEntry* pEntry1 = pModel->GetEntry(nullptr, pos1);
- SvTreeListEntry* pEntry2 = pModel->GetEntry(nullptr, pos2);
+ SvTreeListEntry* pEntry1 = pModel->GetEntry(nullptr, min);
+ SvTreeListEntry* pEntry2 = pModel->GetEntry(nullptr, max);
pModel->Move(pEntry1, pEntry2);
}
More information about the Libreoffice-commits
mailing list