sd/source/filter/eppt/pptx-animations.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit 06df3ad0b2fa771757c90f53dd1f33265a3912dc Author: Karthik <[email protected]> AuthorDate: Thu Oct 9 22:58:31 2025 +0530 Commit: Michael Stahl <[email protected]> CommitDate: Tue Oct 28 19:39:17 2025 +0100 impress: fix PPT->PPTX time animate value interoperability issue Saving a PPT file as PPTX could sometimes corrupt the output because of negative animation time(ST_TLTimeAnimateValueTime). ST_TLTimeAnimateValueTime can't be negative ([ISO/IEC 29500-1] 19.7.39). The patch ensures that animation times values are non-negative during PPTX export Change-Id: I366a9acfc59231545737d67859dfcfd0a4beb886 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192122 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> (cherry picked from commit 8dce45fde0f23f2f3083b313676889016775d2aa) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193078 Tested-by: Jenkins diff --git a/sd/source/filter/eppt/pptx-animations.cxx b/sd/source/filter/eppt/pptx-animations.cxx index 8f5389871dc7..56cbbbea030c 100644 --- a/sd/source/filter/eppt/pptx-animations.cxx +++ b/sd/source/filter/eppt/pptx-animations.cxx @@ -220,9 +220,12 @@ void WriteAnimateValues(const FSHelperPtr& pFS, const Reference<XAnimate>& rXAni SAL_INFO("sd.eppt", "animate value " << i << ": " << aKeyTimes[i]); if (aValues[i].hasValue()) { + // ST_TLTimeAnimateValueTime can't be negative ([ISO/IEC 29500-1] 19.7.39) + sal_uInt32 nTime = static_cast<sal_uInt32>(std::max(0.0, aKeyTimes[i] * 100000.0)); + pFS->startElementNS(XML_p, XML_tav, XML_fmla, sax_fastparser::UseIf(sFormula, !sFormula.isEmpty()), XML_tm, - OString::number(static_cast<sal_Int32>(aKeyTimes[i] * 100000.0))); + sax_fastparser::UseIf(OString::number(nTime), nTime != 0)); pFS->startElementNS(XML_p, XML_val); ValuePair aPair; if (aValues[i] >>= aPair)
