sw/source/core/layout/tabfrm.cxx |   59 ++++++++++++++++++++-------------------
 1 file changed, 31 insertions(+), 28 deletions(-)

New commits:
commit 6a864890311f477a5ac7e1f854f78078bf7ebe63
Author:     Mike Kaganski <[email protected]>
AuthorDate: Thu Jan 22 11:38:53 2026 +0100
Commit:     Mike Kaganski <[email protected]>
CommitDate: Thu Jan 22 20:56:04 2026 +0100

    Skip calculations that are discarded
    
    Rotated cells are ignored here anyway.
    
    Change-Id: I70c73111eb86e66ddb81c9d862d661d6c59b15f7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197802
    Reviewed-by: Mike Kaganski <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 09865a2f52ff..5acaa759b55f 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -5097,36 +5097,39 @@ static SwTwips lcl_CalcMinRowHeight( const SwRowFrame* 
_pRow,
     const SwCellFrame* pLow = static_cast<const SwCellFrame*>(_pRow->Lower());
     while ( pLow )
     {
-        SwTwips nTmp = 0;
-        const tools::Long nRowSpan = pLow->GetLayoutRowSpan();
-        // --> NEW TABLES
-        // Consider height of
-        // 1. current cell if RowSpan == 1
-        // 2. current cell if cell is "follow" cell of a cell with RowSpan == 
-1
-        // 3. master cell if RowSpan == -1
-        if ( 1 == nRowSpan )
-        {
-            nTmp = ::lcl_CalcMinCellHeight( pLow, _bConsiderObjs );
-        }
-        else if ( -1 == nRowSpan )
-        {
-            // Height of the last cell of a row span is height of master cell
-            // minus the height of the other rows which are covered by the 
master
-            // cell:
-            const SwCellFrame& rMaster = pLow->FindStartEndOfRowSpanCell( true 
);
-            nTmp = ::lcl_CalcMinCellHeight( &rMaster, _bConsiderObjs );
-            const SwFrame* pMasterRow = rMaster.GetUpper();
-            while ( pMasterRow && pMasterRow != _pRow )
-            {
-                nTmp -= aRectFnSet.GetHeight(pMasterRow->getFrameArea());
-                pMasterRow = pMasterRow->GetNext();
+        // Do not consider rotated cells:
+        if (pLow->IsVertical() == aRectFnSet.IsVert())
+        {
+            SwTwips nTmp = 0;
+            const tools::Long nRowSpan = pLow->GetLayoutRowSpan();
+            // --> NEW TABLES
+            // Consider height of
+            // 1. current cell if RowSpan == 1
+            // 2. current cell if cell is "follow" cell of a cell with RowSpan 
== -1
+            // 3. master cell if RowSpan == -1
+            if ( 1 == nRowSpan )
+            {
+                nTmp = ::lcl_CalcMinCellHeight( pLow, _bConsiderObjs );
+            }
+            else if ( -1 == nRowSpan )
+            {
+                // Height of the last cell of a row span is height of master 
cell
+                // minus the height of the other rows which are covered by the 
master
+                // cell:
+                const SwCellFrame& rMaster = pLow->FindStartEndOfRowSpanCell( 
true );
+                nTmp = ::lcl_CalcMinCellHeight( &rMaster, _bConsiderObjs );
+                const SwFrame* pMasterRow = rMaster.GetUpper();
+                while ( pMasterRow && pMasterRow != _pRow )
+                {
+                    nTmp -= aRectFnSet.GetHeight(pMasterRow->getFrameArea());
+                    pMasterRow = pMasterRow->GetNext();
+                }
             }
-        }
-        // <-- NEW TABLES
+            // <-- NEW TABLES
 
-        // Do not consider rotated cells:
-        if ( pLow->IsVertical() == aRectFnSet.IsVert() && nTmp > nHeight )
-            nHeight = nTmp;
+            if (nTmp > nHeight)
+                nHeight = nTmp;
+        }
 
         pLow = static_cast<const SwCellFrame*>(pLow->GetNext());
     }

Reply via email to