oox/source/export/drawingml.cxx | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-)
New commits: commit 458bfaed1b660f75da8d9a31cd2eb100710730d6 Author: Karthik Godha <[email protected]> AuthorDate: Thu Dec 18 16:45:21 2025 +0530 Commit: Michael Stahl <[email protected]> CommitDate: Thu Dec 18 17:16:44 2025 +0100 tdf#170035:PPTX->PPTX invalid values in guide-list During PPTX export internal equation names are exported as guide values in guide-list. Change-Id: I179b47b57057fabf76e85b1c1d4aa62e0e3154d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195837 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Michael Stahl <[email protected]> diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 0ca14190fe50..f12ca0a97751 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -4932,6 +4932,10 @@ void prepareTextArea(const EnhancedCustomShape2d& rEnhancedCustomShape2d, OUString GetFormula(const OUString& sEquation, const OUString& sReplace, const OUString& sNewStr) { + // 'logheight' and `logwidth` are only used for calculating shape's rectangle + if (sEquation == "logheight" || sEquation == "logwidth") + return OUString(); + OUString sFormula = sEquation; size_t nPos = sFormula.indexOf(sReplace); if (nPos != std::string::npos) @@ -4962,18 +4966,24 @@ void prepareGluePoints(std::vector<Guide>& rGuideList, { Guide aGuideX; aGuideX.sName = "GluePoint"_ostr + OString::number(nIndex) + "X"; - aGuideX.sFormula - = (bIsOOXML && nIdx1 >= 0 && nIdx1 < aEquations.getLength()) - ? GetFormula(aEquations[nIdx1], "*logwidth/", " w ").toUtf8() - : "*/ " + OString::number(nIdx1) + " w " + OString::number(nWidth); + + if (bIsOOXML && nIdx1 >= 0 && nIdx1 < aEquations.getLength()) + aGuideX.sFormula = GetFormula(aEquations[nIdx1], "*logwidth/", " w ").toUtf8(); + if (aGuideX.sFormula.isEmpty()) + aGuideX.sFormula + = "*/ " + OString::number(nIdx1) + " w " + OString::number(nWidth); + rGuideList.push_back(aGuideX); Guide aGuideY; aGuideY.sName = "GluePoint"_ostr + OString::number(nIndex) + "Y"; - aGuideY.sFormula - = (bIsOOXML && nIdx2 >= 0 && nIdx2 < aEquations.getLength()) - ? GetFormula(aEquations[nIdx2], "*logheight/", " h ").toUtf8() - : "*/ " + OString::number(nIdx2) + " h " + OString::number(nHeight); + + if (bIsOOXML && nIdx2 >= 0 && nIdx2 < aEquations.getLength()) + aGuideY.sFormula = GetFormula(aEquations[nIdx2], "*logheight/", " h ").toUtf8(); + if (aGuideY.sFormula.isEmpty()) + aGuideY.sFormula + = "*/ " + OString::number(nIdx2) + " h " + OString::number(nHeight); + rGuideList.push_back(aGuideY); }
