From 54d6937ab4b1c52100c9d0de7ddf756266b73f2e Mon Sep 17 00:00:00 2001 From: Regina Henschel Date: Fri, 12 Jun 2026 15:51:45 +0200 Subject: [PATCH] cool#15716 find associated shape in SmartArt export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The export needs to write pt-elements for content text nodes with the original modelId to data.xml. However, the shape has not this modelId but the modelId of the associated pt-element of type=pres. Thus this element is searched for in getMasterXShapeForPoint(). The error was, to examine msPresentationLayoutName. That name is created by the author of the SmartArt template and is arbitrary. And indeed, a name textNode exists only twice in the over hundred predefined SmartArt templates. So remove this test, it prevents to find the shape. After removing the above mentioned test, an error in WriteText() in the export becomes visible. The export of a SmartArt diagram calls WriteText() with bBodyPr=false. With that no a:bodyPr element is written at all. But for the CT_TextBody it is specified in OOXML, that the bodyPr child element is mandatory. Thus we need to write an empty element in this case. Without it, the file markup is invalid and MS Office requests to repair the document. Change-Id: I9cdf5e882b415ca1d13718d6c1e47ebb1d2c7018 Signed-off-by: Regina Henschel Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4396 Reviewed-by: Tomaž Vajngerl Tested-by: Jenkins CPCI (cherry picked from commit 533dccff298edc397a9c0fc564ba4d31b8c27432) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206994 Reviewed-by: Xisco Fauli Tested-by: Jenkins --- oox/source/export/drawingml.cxx | 4 ++++ svx/source/diagram/datamodel_svx.cxx | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 5b85e5f41448..ca4ce6ec6b06 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -4614,6 +4614,10 @@ void DrawingML::WriteText(const Reference& rXIface, bool bBodyPr, bo if (bBodyPr) { WriteBodyProps(rXIface, nXmlNamespace, bIsFontworkShape, nTop, nBottom, nLeft, nRight); + } + else + { + mpFS->singleElementNS(XML_a, XML_bodyPr); } // end of bodyPr Reference< XEnumerationAccess > access( xXText, UNO_QUERY ); diff --git a/svx/source/diagram/datamodel_svx.cxx b/svx/source/diagram/datamodel_svx.cxx index 44371d4e2948..2e423ce76544 100644 --- a/svx/source/diagram/datamodel_svx.cxx +++ b/svx/source/diagram/datamodel_svx.cxx @@ -671,7 +671,6 @@ uno::Reference DiagramData_svx::getMasterXShapeForPoint(const P for (auto& rCandidate : getPoints()) { if (!rCandidate.msPresentationAssociationId.isEmpty() - && "textNode" == rCandidate.msPresentationLayoutName && rCandidate.msPresentationAssociationId == rPoint.msModelId) { const uno::Reference xMasterText = getXShapeByModelID(rCandidate.msModelId);