oox/source/export/chartexport.cxx | 21 ++++++++++++++------- sc/source/filter/excel/xeescher.cxx | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-)
New commits: commit e0eacd988e7a1c28db0aa41f8384290f4ada3b15 Author: Noel Grandin <[email protected]> AuthorDate: Wed Nov 5 13:35:49 2025 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Thu Nov 6 15:45:24 2025 +0100 mso-test: fix export of rotX This is using the test document from ooo72994-7.xls. Fix the export of the rotX value for 3D charts. We cannot easily map the value here, all we can do is clamp it. Change-Id: I1beba485c66babfbe03830c79b8b8c72a7560bfd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193456 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit 8758fa5ab4b8c99ab15334653c58651c6edd2e35) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193511 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins (cherry picked from commit 50ab8446cb17acc36922e794169574824f7b3387) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193534 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index f7e9cb75b5b4..eba248197c22 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -5506,17 +5506,24 @@ void ChartExport::exportView3D() { sal_Int32 nRotationX = 0; mAny >>= nRotationX; - if( nRotationX < 0 ) + if(eChartType == chart::TYPEID_PIE) { - if(eChartType == chart::TYPEID_PIE) - { /* In OOXML we get value in 0..90 range for pie chart X rotation , whereas we expect it to be in -90..90 range, so we convert that during import. It is modified in View3DConverter::convertFromModel() here we convert it back to 0..90 as we received in import */ - nRotationX += 90; // X rotation (map Chart2 [-179,180] to OOXML [0..90]) - } - else - nRotationX += 360; // X rotation (map Chart2 [-179,180] to OOXML [-90..90]) + if( nRotationX < 0 ) + nRotationX += 90; // X rotation (map Chart2 [-179,180] to OOXML [0..90]) + } + else + { + assert(nRotationX >= -180 && nRotationX <= 180); + // X rotation (map Chart2 [-179,180] to OOXML [-90..90]) + // This is not ideal, we are losing information, but that is unavoidable since OOXML does not + // allow upside down 3d charts. + if( nRotationX < -90 ) + nRotationX = -90; + else if( nRotationX > 90 ) + nRotationX = 90; } pFS->singleElement(FSNS(XML_c, XML_rotX), XML_val, OString::number(nRotationX)); } commit 97d4a305ece4a6e7d4933e0e456e071dfe04fba3 Author: Noel Grandin <[email protected]> AuthorDate: Wed Nov 5 12:31:29 2025 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Thu Nov 6 15:45:16 2025 +0100 mso-test: escape text of vml element This is using the test document from ooo91342-1.xls. When importing and exporting to XLSX, we end up with an unescaped "&" character. Change-Id: Ieb578c42adf1eed2b29ef96af973c15d22b40e3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193454 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit 8df99b53bdf1d21076d008a2e4915b80cd6e2a61) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193510 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> (cherry picked from commit 39869d2a038aae60a90c432c6243d342f7d02863) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193533 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 7ea8f6a685f5..cea62fbcd8a6 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -1147,7 +1147,7 @@ void VmlFormControlExporter::EndShape(sal_Int32 nShapeElement) pVmlDrawing->startElement(FSNS(XML_v, XML_textbox)); pVmlDrawing->startElement(XML_div); pVmlDrawing->startElement(XML_font); - pVmlDrawing->write(m_aLabel); + pVmlDrawing->writeEscaped(m_aLabel); pVmlDrawing->endElement(XML_font); pVmlDrawing->endElement(XML_div); pVmlDrawing->endElement(FSNS(XML_v, XML_textbox));
