sw/source/uibase/uiview/viewtab.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 16341a2f2dbc44fc21fcfa23399d4827c1422eb7
Author:     Jaume Pujantell <jaume.pujant...@collabora.com>
AuthorDate: Fri May 10 10:04:47 2024 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Tue May 14 12:48:40 2024 +0200

    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 <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>
    (cherry picked from commit c6c1c7afc18f32453c06a3af25f389ccb9074a1b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167458

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);

Reply via email to