diff options
author | Jaume Pujantell <jaume.pujantell@collabora.com> | 2024-05-10 10:04:47 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-05-14 12:48:40 +0200 |
commit | 16341a2f2dbc44fc21fcfa23399d4827c1422eb7 (patch) | |
tree | 4e2a81aeb9e271ad577e86c74eeb13104e41b4d2 | |
parent | 6d2f14936040a60909ec0815f39b2622411bd4ee (diff) |
sw: avoid unwanted row height changesdistro/collabora/co-23.05
When changing a row's height with SID_TABLE_CHANGE_CURRENT_BORDER_POSITION
avoid knock-on effects to lower rows.
Change-Id: I0af5a6ec2ceb685ec5dd97e4a00237a4c7857589
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167438
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit c6c1c7afc18f32453c06a3af25f389ccb9074a1b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167458
-rw-r--r-- | sw/source/uibase/uiview/viewtab.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 44282cd665db..2fc090258d77 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -1153,7 +1153,15 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) auto & rEntry = aTabRows.GetEntry(nIndex); tools::Long nNewPosition = rEntry.nPos + nOffset; nNewPosition = std::clamp(nNewPosition, rEntry.nMin, rEntry.nMax - constDistanceOffset); + tools::Long nActualOffset = nNewPosition - rEntry.nPos; rEntry.nPos = nNewPosition; + // Maintain the size of the other rows + for (size_t i = nIndex + 1; i < aTabRows.Count(); ++i) + { + auto& rNextEntry = aTabRows.GetEntry(i); + rNextEntry.nPos += nActualOffset; + } + aTabRows.SetRight(aTabRows.GetRight() + nActualOffset); } rSh.SetTabRows(aTabRows, false); |