summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTibor Nagy <tibor.nagy.extern@allotropia.de>2024-03-29 15:19:10 +0100
committerNagy Tibor <tibor.nagy.extern@allotropia.de>2024-03-29 23:38:18 +0100
commit40d3d510fca99b555381deb74b9915c91c924de5 (patch)
tree9cd60037e930561d9231a68eb9b6189d21930590 /oox
parent4f13c6c5cbd958cbd3cb79385335abe512bb6de2 (diff)
tdf#157285 PPTX import: fix placeholder height
The "TextAutoGrowHeight" property doesn't shrink the shape automatically when its content is smaller than the current size. Change-Id: Ia7f94d7452d1a1c3f004aebd73b6ed5cbfd9b43b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165551 Tested-by: Jenkins Reviewed-by: Nagy Tibor <tibor.nagy.extern@allotropia.de>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/shape.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index bd81fa9b42bf..23be28b546b6 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1251,6 +1251,17 @@ Reference< XShape > const & Shape::createAndInsert(
{
xSet->setPropertyValue("Decorative", Any(m_isDecorative));
}
+
+ // set the placeholder height to "0" if it has the 'TextAutoGrowHeight' property
+ // the placeholder height is set later to the correct size.
+ bool bAutoGrowHeight = false;
+ xSet->getPropertyValue("TextAutoGrowHeight") >>= bAutoGrowHeight;
+ if (bAutoGrowHeight && mxShape->getShapeType().startsWith("com.sun.star.presentation."))
+ {
+ awt::Size aSize(mxShape->getSize().Width, 0);
+ mxShape->setSize(aSize);
+ }
+
if (aServiceName != "com.sun.star.text.TextFrame")
rxShapes->add( mxShape );