diff options
author | Sarper Akdemir <sarper.akdemir@collabora.com> | 2022-08-22 08:49:57 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-08-31 13:34:24 +0200 |
commit | 1a0ceb76e2fe12cdfff7cabf06ef43cfba296a34 (patch) | |
tree | b90c46b19bdb2802f53961b11b04139f428c1480 | |
parent | 2839b604af94dbd1ee59dc6d47dc2f4c6ebd8dc6 (diff) |
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 <vmiklos@collabora.com>
-rw-r--r-- | sd/qa/uitest/impress_tests2/tdf91762.py | 4 | ||||
-rw-r--r-- | svx/source/table/tablelayouter.cxx | 40 |
2 files changed, 4 insertions, 40 deletions
diff --git a/sd/qa/uitest/impress_tests2/tdf91762.py b/sd/qa/uitest/impress_tests2/tdf91762.py index 56a1596b9e5b..2b3282413e15 100644 --- a/sd/qa/uitest/impress_tests2/tdf91762.py +++ b/sd/qa/uitest/impress_tests2/tdf91762.py @@ -39,8 +39,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 d3238042fbe0..72c692c96748 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -743,14 +743,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 ) { @@ -767,39 +762,7 @@ void TableLayouter::LayoutTableHeight( tools::Rectangle& rArea, bool bFit ) } else { - // WARNING: tdf#144092 / tdf#139511 suggest this entire section is invalid. - // Empty cells should not be ignored in regards to row height, - // especially MS formats, despite this code being added to import MS files... - // The problem is getMinimumHeight can give wrong values for empty cells. - - 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() ); } } } @@ -813,6 +776,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; |