sd/qa/uitest/impress_tests/tdf91762.py |    4 +--
 svx/source/table/tablelayouter.cxx     |   35 +--------------------------------
 2 files changed, 4 insertions(+), 35 deletions(-)

New commits:
commit 365a590bc323ce77eb872fe729b08da3e31ddc0e
Author:     Sarper Akdemir <sarper.akde...@collabora.com>
AuthorDate: Mon Aug 22 08:49:57 2022 +0300
Commit:     Sarper Akdemir <sarper.akde...@collabora.com>
CommitDate: Mon Sep 19 10:55:14 2022 +0200

    tdf#144092 tdf#139511: revert parts of tdf#91762 tdf#137949 tdf#139511
    
    Reverts parts that have wrong assumptions wrt layouting a table in svx.
    
    The problems reverted commits solved previously, were refixed by commits:
    - tdf#144092 pptx import: correct table height during import
      (a5126a21351c87138ff86a6636326eb6cd6a0f8c)
    - tdf#144092 pptx import: fix import of empty cell and shape text properties
      (57f9b4b7d1ad164c56af12009ef1dafbc1be8369)
    
    So hopefully, reverting these now won't cause many regressions.
    
    Change-Id: Ie96293810b033dc86e41c200f10cf63326511cea
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138653
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    (cherry picked from commit 1a0ceb76e2fe12cdfff7cabf06ef43cfba296a34)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139223
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Sarper Akdemir <sarper.akde...@collabora.com>

diff --git a/sd/qa/uitest/impress_tests/tdf91762.py 
b/sd/qa/uitest/impress_tests/tdf91762.py
index 00f9dc084c5d..5e2236d83834 100644
--- a/sd/qa/uitest/impress_tests/tdf91762.py
+++ b/sd/qa/uitest/impress_tests/tdf91762.py
@@ -36,8 +36,8 @@ class tdf91762(UITestCase):
                 xEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"RETURN"}))
 
             # tdf#138011: Without the fix in place, this test would have 
failed with
-            # AssertionError: 5494 != 3559
-            self.assertEqual(5494, 
document.DrawPages[0].getByIndex(1).BoundRect.Height)
+            # AssertionError: 5504 != 3559
+            self.assertEqual(5504, 
document.DrawPages[0].getByIndex(1).BoundRect.Height)
 
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/svx/source/table/tablelayouter.cxx 
b/svx/source/table/tablelayouter.cxx
index 0c517707f4f8..d846a719c154 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -742,14 +742,9 @@ void TableLayouter::LayoutTableHeight( tools::Rectangle& 
rArea, bool bFit )
     sal_Int32 nCol, nRow;
     for( nRow = 0; nRow < nRowCount; ++nRow )
     {
-        Reference< XPropertySet > xRowSet( xRows->getByIndex(nRow), 
UNO_QUERY_THROW );
-        sal_Int32 nRowPropHeight = 0;
-        xRowSet->getPropertyValue( gsSize ) >>= nRowPropHeight;
         sal_Int32 nMinHeight = 0;
 
         bool bIsEmpty = true; // check if all cells in this row are merged
-        bool bRowHasText = false;
-        bool bRowHasCellInEditMode = false;
 
         for( nCol = 0; nCol < nColCount; ++nCol )
         {
@@ -766,34 +761,7 @@ void TableLayouter::LayoutTableHeight( tools::Rectangle& 
rArea, bool bFit )
                 }
                 else
                 {
-                    bool bCellHasText = xCell->hasText();
-                    bool bCellInEditMode = xCell->IsTextEditActive();
-
-                    if (!bRowHasCellInEditMode && bCellInEditMode)
-                        bRowHasCellInEditMode = true;
-
-                    if ((bRowHasText == bCellHasText) || (bRowHasText && 
bCellInEditMode))
-                    {
-                        nMinHeight = std::max( nMinHeight, 
xCell->getMinimumHeight() );
-                    }
-                    else if ( !bRowHasText && bCellHasText )
-                    {
-                        bRowHasText = true;
-                        nMinHeight = xCell->getMinimumHeight();
-                    }
-
-                    // tdf#137949  We should consider "Height" property while 
calculating minimum height.
-                    // This control decides when we use "Height" property 
value instead of calculated minimum height
-                    //     Case 1: * Row has "Height" property
-                    //             * Calculated minimum height is smaller than 
Height property value.
-                    //     Case 2: * Row has "Height" property
-                    //             * Calculated minimum height is bigger than 
Height property value and
-                    //             * Row has not any text of any cell in edit 
mode in the row (means completely empty)
-                    if ((nMinHeight < nRowPropHeight && nRowPropHeight > 0 && 
(bRowHasText || bRowHasCellInEditMode)) ||
-                        (nMinHeight > nRowPropHeight && nRowPropHeight > 0 && 
(!bRowHasText && !bRowHasCellInEditMode)))
-                    {
-                        nMinHeight = nRowPropHeight;
-                    }
+                    nMinHeight = std::max( nMinHeight, 
xCell->getMinimumHeight() );
                 }
             }
         }
@@ -807,6 +775,7 @@ void TableLayouter::LayoutTableHeight( tools::Rectangle& 
rArea, bool bFit )
         else
         {
             sal_Int32 nRowHeight = 0;
+            Reference<XPropertySet> xRowSet(xRows->getByIndex(nRow), 
UNO_QUERY_THROW);
 
             bool bOptimal = false;
             xRowSet->getPropertyValue( sOptimalSize ) >>= bOptimal;

Reply via email to