summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2023-07-27 08:43:59 +0200
committerHenry Castro <hcastro@collabora.com>2023-07-31 18:32:27 +0200
commit1eed2e57b1848e8f129e98d1bbdb5f8851740d6b (patch)
treedd7a2a2749e693c360d0b7e85d977091eef7f098 /oox
parentbc7db71d2293d43e6e74ba9feb4a4f73afccece8 (diff)
pptx: import shape text from master page
If shape has custom text defined in master page but no text itself - don't prefer placeholder text but text from master page. Change-Id: Id4f7aeca0e74ecd8565905cd656a182c1195fa30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154980 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/shape.cxx2
-rw-r--r--oox/source/drawingml/shapecontext.cxx2
-rw-r--r--oox/source/ppt/pptshape.cxx4
3 files changed, 8 insertions, 0 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 497fd57db922..039b51977850 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -149,6 +149,7 @@ Shape::Shape( const char* pServiceName, bool bDefaultHeight )
, mbWps( false )
, mbTextBox( false )
, mbHasLinkedTxbx( false )
+, mbHasCustomPrompt( false )
, maDiagramDoms( 0 )
, mpDiagramHelper( nullptr )
{
@@ -193,6 +194,7 @@ Shape::Shape( const ShapePtr& pSourceShape )
, mbWps( pSourceShape->mbWps )
, mbTextBox( pSourceShape->mbTextBox )
, mbHasLinkedTxbx(false)
+, mbHasCustomPrompt( pSourceShape->mbHasCustomPrompt )
, maDiagramDoms( pSourceShape->maDiagramDoms )
, mnZOrder(pSourceShape->mnZOrder)
, mnZOrderOff(pSourceShape->mnZOrderOff)
diff --git a/oox/source/drawingml/shapecontext.cxx b/oox/source/drawingml/shapecontext.cxx
index 3ac32abd11aa..55c6639d8fe4 100644
--- a/oox/source/drawingml/shapecontext.cxx
+++ b/oox/source/drawingml/shapecontext.cxx
@@ -81,6 +81,8 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 aElementToken, const
mpShapePtr->setSubType( rAttribs.getToken( XML_type, XML_obj ) );
if( rAttribs.hasAttribute( XML_idx ) )
mpShapePtr->setSubTypeIndex( rAttribs.getInteger( XML_idx, 0 ) );
+ if( rAttribs.hasAttribute( XML_hasCustomPrompt ) )
+ mpShapePtr->setHasCustomPrompt( rAttribs.getBool( XML_hasCustomPrompt, false ) );
break;
// nvSpPr CT_ShapeNonVisual end
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index be7046c7498e..0baf47e49815 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -454,6 +454,10 @@ void PPTShape::addShape(
Reference < XText > xText(mxShape, UNO_QUERY);
if (xText.is())
{
+ if (mpPlaceholder && mpPlaceholder->getTextBody() && !mpPlaceholder->getTextBody()->isEmpty()
+ && mpPlaceholder->hasCustomPrompt())
+ xText->setString(mpPlaceholder->getTextBody()->toString());
+
TextCharacterProperties aCharStyleProperties;
getTextBody()->ApplyStyleEmpty(rFilterBase, xText, aCharStyleProperties, mpMasterTextListStyle);
}