summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@collabora.com>2022-08-22 08:49:57 +0300
committerSarper Akdemir <sarper.akdemir@collabora.com>2022-09-19 10:55:14 +0200
commit365a590bc323ce77eb872fe729b08da3e31ddc0e (patch)
tree35b8e7951fb27ba8b7b4edcbad2d63a26396857f /svx
parent0b784f6f0d9e29b499b3f76a7c0fcc03e1a2af7b (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> (cherry picked from commit 1a0ceb76e2fe12cdfff7cabf06ef43cfba296a34) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139223 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Sarper Akdemir <sarper.akdemir@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/table/tablelayouter.cxx35
1 files changed, 2 insertions, 33 deletions
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;