diff options
author | Tünde Tóth <toth.tunde@nisz.hu> | 2022-10-18 16:20:43 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2022-11-02 08:03:40 +0100 |
commit | ea62cacd129f03813d7d3d214bf9aa2ae60bbef4 (patch) | |
tree | 47b04e541524edcaa2a27f0fd4d019ceeecd0718 /oox | |
parent | 71081a2a79a7b5a1eefec60fc687c533a95d190d (diff) |
tdf#151622 PPTX: fix export of show as icon option
Embedded OLE object wasn't look like an icon after its opening
because of missing showAsIcon="1" of p:oleObj.
Change-Id: I21dbd1e31f7e1de78d8bf548ca6f3619eb3e4a10
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141505
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/shapes.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index d102880af7bd..541f54a0fdb8 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -46,6 +46,7 @@ #include <com/sun/star/drawing/ConnectorType.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp> +#include <com/sun/star/embed/Aspects.hpp> #include <com/sun/star/embed/EmbedStates.hpp> #include <com/sun/star/embed/XEmbeddedObject.hpp> #include <com/sun/star/embed/XEmbedPersist.hpp> @@ -2591,6 +2592,10 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape ) TOOLS_WARN_EXCEPTION("oox.shape", "ShapeExport::WriteOLEObject"); } + sal_Int64 nAspect; + bool bShowAsIcon = (xPropSet->getPropertyValue("Aspect") >>= nAspect) + && nAspect == embed::Aspects::MSOLE_ICON; + OUString const sRelId = mpFB->addRelation( mpFS->getOutputStream(), sRelationType, Concat2View(OUString::createFromAscii(GetRelationCompPrefix()) + sFileName)); @@ -2617,6 +2622,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape ) if (pProgID) { mpFS->startElementNS( mnXmlNamespace, XML_oleObj, + XML_showAsIcon, sax_fastparser::UseIf("1", bShowAsIcon), XML_progId, pProgID, FSNS(XML_r, XML_id), sRelId, XML_spid, "" ); @@ -2625,6 +2631,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape ) { mpFS->startElementNS( mnXmlNamespace, XML_oleObj, //? XML_name, "Document", + XML_showAsIcon, sax_fastparser::UseIf("1", bShowAsIcon), FSNS(XML_r, XML_id), sRelId, // The spec says that this is a required attribute, but PowerPoint can only handle an empty value. XML_spid, "" ); |