summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaume Pujantell <jaume.pujantell@collabora.com>2024-05-10 10:04:47 +0200
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-05-14 09:37:43 +0200
commit1d83ac544dcd2fbfb0aa19065e16ed82c40d0c86 (patch)
tree6d86e70d20d3ca27db9a905066e6d4f27389ec26
parent320555963d69cbe19570a555a476d0ae757fef98 (diff)
sw: avoid unwanted row height changes
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/+/167459 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index 2e5bb65435ec..24d5585137fa 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -1169,7 +1169,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);