oox/source/export/drawingml.cxx | 17 +++++++++-------- sd/source/filter/eppt/pptx-animations.cxx | 14 ++++++++++++-- 2 files changed, 21 insertions(+), 10 deletions(-)
New commits: commit d764cc96dc155acb64a991770f24c139516fc0e0 Author: Noel Grandin <[email protected]> AuthorDate: Tue Nov 18 16:35:48 2025 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Wed Nov 19 12:57:24 2025 +0100 mso-test: cannot have empty childTnLst element found by converting tdf136301-1.odp to pptx and running officeotron on the output we do not currently support exporting ANIMATIONPHYSICS node types, so don't export a childTnLst element if we see one of those. Change-Id: I159fd4fe677198529782ad0b4890a1c0af3b1658 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194165 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sd/source/filter/eppt/pptx-animations.cxx b/sd/source/filter/eppt/pptx-animations.cxx index 4a3af6a43bb2..c897645491e9 100644 --- a/sd/source/filter/eppt/pptx-animations.cxx +++ b/sd/source/filter/eppt/pptx-animations.cxx @@ -951,18 +951,28 @@ void PPTXAnimationExport::WriteAnimationNodeCommonPropsStart() if (!aChildNodes.empty()) { bool bSubTnLst = false; - mpFS->startElementNS(XML_p, XML_childTnLst); + bool bWroteChildTnList = false; for (const NodeContextPtr& pChildContext : aChildNodes) { if (pChildContext->isValid()) { if (pChildContext->isOnSubTnLst()) bSubTnLst = true; + else if (pChildContext->getNode()->getType() == AnimationNodeType::ANIMATEPHYSICS) + ; // ignore we don't support exporting this node type else + { + if (!bWroteChildTnList) + { + bWroteChildTnList = true; + mpFS->startElementNS(XML_p, XML_childTnLst); + } WriteAnimationNode(pChildContext); + } } } - mpFS->endElementNS(XML_p, XML_childTnLst); + if (bWroteChildTnList) + mpFS->endElementNS(XML_p, XML_childTnLst); if (bSubTnLst) { commit bf8db30c20f4c599a53879c0564042b6c4dcb4b6 Author: Noel Grandin <[email protected]> AuthorDate: Tue Nov 18 10:49:50 2025 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Wed Nov 19 12:57:17 2025 +0100 mso-test: invalid attribute values in srcRect found by converting tdf97212-1.odp to pptx and running officeotron on the output we end up with markup like: <a:srcRect l="INF" t="NaN" r="NaN" b="INF"/> Change-Id: I1780cd7b668351b6ced3cd52d557b4a57f959b60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194153 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 812c994c7616..eb501bb9daf8 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -2013,14 +2013,15 @@ void DrawingML::WriteGraphicCropProperties(uno::Reference<beans::XPropertySet> c if (rMapMode.GetMapUnit() == MapUnit::MapPixel) aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aOriginalSize, MapMode(MapUnit::Map100thMM)); - if ( (0 != aGraphicCropStruct.Left) || (0 != aGraphicCropStruct.Top) || (0 != aGraphicCropStruct.Right) || (0 != aGraphicCropStruct.Bottom) ) - { - mpFS->singleElementNS( XML_a, XML_srcRect, - XML_l, OString::number(rtl::math::round(aGraphicCropStruct.Left * 100000.0 / aOriginalSize.Width())), - XML_t, OString::number(rtl::math::round(aGraphicCropStruct.Top * 100000.0 / aOriginalSize.Height())), - XML_r, OString::number(rtl::math::round(aGraphicCropStruct.Right * 100000.0 / aOriginalSize.Width())), - XML_b, OString::number(rtl::math::round(aGraphicCropStruct.Bottom * 100000.0 / aOriginalSize.Height())) ); - } + if (aOriginalSize.Width() != 0 && aOriginalSize.Height() != 0) + if ( (0 != aGraphicCropStruct.Left) || (0 != aGraphicCropStruct.Top) || (0 != aGraphicCropStruct.Right) || (0 != aGraphicCropStruct.Bottom) ) + { + mpFS->singleElementNS( XML_a, XML_srcRect, + XML_l, OString::number(rtl::math::round(aGraphicCropStruct.Left * 100000.0 / aOriginalSize.Width())), + XML_t, OString::number(rtl::math::round(aGraphicCropStruct.Top * 100000.0 / aOriginalSize.Height())), + XML_r, OString::number(rtl::math::round(aGraphicCropStruct.Right * 100000.0 / aOriginalSize.Width())), + XML_b, OString::number(rtl::math::round(aGraphicCropStruct.Bottom * 100000.0 / aOriginalSize.Height())) ); + } } }
