sd/source/filter/eppt/pptx-epptooxml.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 7c92bd105adff1297d632b5f27b4a690e430356c
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed Dec 3 14:00:08 2025 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Thu Dec 4 15:06:17 2025 +0100

    mso-test: clamp page size to supported range
    
    found by converting ooo127565-1.odp to pptx and running officeotron on the 
output
    
    INFO - Validating part "/ppt/presentation.xml" using schema 
"29500T/pml.xsd" ...
    ERROR      - (ppt/presentation.xml:2 col:610) cvc-minInclusive-valid:
    Value '360363' is not facet-valid with respect to minInclusive '914400'
       for type 'ST_SlideSizeCoordinate'.
    ERROR      - (ppt/presentation.xml:2 col:610) cvc-attribute.3:
       The value '360363' of attribute 'cy' on element 'p:sldSz' is not valid
       with respect to its type, 'ST_SlideSizeCoordinate'.
    
    Change-Id: I461b9d07af7f3cda85d57c871a0d88fce977bf9f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194957
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index c7f329472d1e..194a6906e07a 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -499,9 +499,12 @@ bool PowerPointExport::exportDocument()
 
     exportPPT(aProperties);
 
+    // clamp to minimum values supported by PPTX
+    sal_Int64 nDestPageWidth = std::max(sal_Int64(914400), 
PPTtoEMU(maDestPageSize.Width));
+    sal_Int64 nDestPageHeight = std::max(sal_Int64(914400), 
PPTtoEMU(maDestPageSize.Height));
     mPresentationFS->singleElementNS(XML_p, XML_sldSz,
-                                     XML_cx, 
OString::number(PPTtoEMU(maDestPageSize.Width)),
-                                     XML_cy, 
OString::number(PPTtoEMU(maDestPageSize.Height)));
+                                     XML_cx, OString::number(nDestPageWidth),
+                                     XML_cy, OString::number(nDestPageHeight));
     // for some reason if added before slides list it will not load the slides 
(alas with error reports) in mso
     mPresentationFS->singleElementNS(XML_p, XML_notesSz,
                                      XML_cx, 
OString::number(PPTtoEMU(maNotesPageSize.Width)),

Reply via email to