[Libreoffice-commits] core.git: oox/source sd/qa

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Fri Jan 22 10:03:05 UTC 2021


 oox/source/export/shapes.cxx       |    8 ++++++++
 sd/qa/unit/export-tests-ooxml1.cxx |    6 ++++++
 2 files changed, 14 insertions(+)

New commits:
commit a02ea004c35edeb4e93b1cdcaa087e8bdcf1ee47
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Fri Jan 22 09:19:00 2021 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Jan 22 11:02:27 2021 +0100

    PPTX export: fix size of shape for slide narrations
    
    This was invisible in PowerPoint without explicit stretching.
    
    Change-Id: I29b9f23eba6d59436cb1b6d15c9840794f932e69
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109778
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 9033e1d40d88..13c52d22c56e 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1238,6 +1238,14 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape
     if ( pGraphic || bStretch )
         pFS->singleElementNS(XML_a, XML_stretch);
 
+    if (bHasMediaURL)
+    {
+        // Graphic of media shapes is always stretched.
+        pFS->startElementNS(XML_a, XML_stretch);
+        pFS->singleElementNS(XML_a, XML_fillRect);
+        pFS->endElementNS(XML_a, XML_stretch);
+    }
+
     pFS->endElementNS( mnXmlNamespace, XML_blipFill );
 
     // visual shape properties
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx
index 91ce68e20a50..e6b32ff357ca 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -1336,6 +1336,12 @@ void SdOOXMLExportTest1::testNarrationMimeType()
     // i.e. the bitmap of the narration was lost, some default placeholder was exported instead.
     CPPUNIT_ASSERT_EQUAL(static_cast<tools::Long>(256), aBitmapEx.GetSizePixel().Height());
 
+    // Without the accompanying fix in place, this test would have failed with:
+    // - Expected: 1
+    // - Actual  : 0
+    // i.e. p:blipFill was missing its a:stretch child element, so the shape was invisible.
+    assertXPath(pSlideDoc, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:stretch/a:fillRect", 1);
+
     xDocShRef->DoClose();
 }
 


More information about the Libreoffice-commits mailing list