oox/source/export/drawingml.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit d220d1f7e791cce9032021051cbd9f89bb8b51ce Author: [email protected] <[email protected]> AuthorDate: Mon Jan 19 20:20:43 2026 -0500 Commit: Miklos Vajna <[email protected]> CommitDate: Wed Jan 21 09:52:28 2026 +0100 tdf#170394 oox export: arcTo wH and wR must be integer, not decimal MS Office reports files as corrupt if these values contain a floating point number. This started in LO 7.2 with commit 7337e7e74d8bde77a56552bcb7b40bf1668c87b7. Since then, 3 more instances of export XML_arcTo have appeared, but all of them used std:lround. The nice thing about std:lround is that it will not return 0, but rather 1 for a small floating point value. That was also recommended by what I found on the Internet, so I gratefully copied that usage. Change-Id: I4712cb516ed6220a079d2b8dfee0013e8f0c9c59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197665 Tested-by: Jenkins Reviewed-by: Justin Luth <[email protected]> (cherry picked from commit 8ad8d27a61fad5af785eb15c58a31c9d82cd23ee) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197689 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index c7670292756d..f14bd9fd3c21 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -5662,8 +5662,8 @@ bool DrawingML::WriteCustomGeometrySegment( double fSwingAng = 0.0; rCustomShape2d.GetParameter(fSwingAng, rPairs[rnPairIndex + 1].Second, false, false); sal_Int32 nSwingAng(std::lround(fSwingAng * 60000)); - mpFS->singleElement(FSNS(XML_a, XML_arcTo), XML_wR, OString::number(fWR), XML_hR, - OString::number(fHR), XML_stAng, OString::number(nStartAng), + mpFS->singleElement(FSNS(XML_a, XML_arcTo), XML_wR, OString::number(std::lround(fWR)), + XML_hR, OString::number(std::lround(fHR)), XML_stAng, OString::number(nStartAng), XML_swAng, OString::number(nSwingAng)); double fPx = 0.0; double fPy = 0.0;
