diff options
author | Sarper Akdemir <sarper.akdemir@collabora.com> | 2022-09-16 14:53:28 +0300 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2022-09-16 18:29:32 +0200 |
commit | b92c4de7da81318abefce4750e826ac59094b748 (patch) | |
tree | 0a3ccca708b806340a3223eb96a4941e7f3711b7 /oox | |
parent | 28a7615ccdd000270f71e2eb32efeec4c87780f1 (diff) |
Related: tdf#144092 improve wording
Attempts to address concerns pointed out by Justin in:
https://gerrit.libreoffice.org/c/core/+/138652/#message-6dd69691fbaabf26424b4c3fb85f42e550b53ee2
Change-Id: I1af4d316fae73626ce734ca60c6539502eb80f14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140067
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/shape.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index cfe1ea29dc95..2a46f93a440e 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -835,8 +835,7 @@ Reference< XShape > const & Shape::createAndInsert( maSize.Height = 0; for (auto const& elem : mpTablePropertiesPtr->getTableRows()) { - // WARN: When less than minimum sized rows exist, calculated height here - // is corrected before layouting takes place + // WARN: If some rows can't fit the content, this is not the final height maSize.Height = o3tl::saturating_add(maSize.Height, elem.getHeight()); } } @@ -1263,7 +1262,7 @@ Reference< XShape > const & Shape::createAndInsert( mpTablePropertiesPtr->pushToPropSet( rFilterBase, xSet, mpMasterTextListStyle ); if ( auto* pTableShape = dynamic_cast<sdr::table::SdrTableObj*>(SdrObject::getSdrObjectFromXShape(mxShape)) ) { - // Disable layouting until an attempt at correcting faulty table height is made + // Disable layouting until table height is expanded to fit the content pTableShape->SetSkipChangeLayout(true); } } @@ -1502,11 +1501,13 @@ Reference< XShape > const & Shape::createAndInsert( if (mpTablePropertiesPtr && aServiceName == "com.sun.star.drawing.TableShape") { - // Powerpoint sometimes export row heights less than the minimum size, - // which during import expanded to the minimum + // Powerpoint exports desired row heights (i.e. what user attempted to set it as, not how it appears visually) + // Expand table height if there are rows that can't fit the content if (auto* pTableShape = dynamic_cast<sdr::table::SdrTableObj*>(SdrObject::getSdrObjectFromXShape(mxShape))) { - sal_Int32 nCorrectedHeight = pTableShape->getHeightWithoutFitting(); + tools::Rectangle aArea{}; + pTableShape->LayoutTableHeight(aArea, /*bFit=*/false); + sal_Int32 nCorrectedHeight = aArea.GetHeight(); const auto& aShapeSize = mxShape->getSize(); if( nCorrectedHeight > aShapeSize.Height ) mxShape->setSize( {aShapeSize.Width, nCorrectedHeight} ); |