summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/docxsdrexport.cxx
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-07-06 16:57:08 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-07-06 20:28:40 +0200
commite751d59264c369cfc342dab5f0759be12341d306 (patch)
treedf91e2ddc4dfbc3e23ac61970640776f87e5229a /sw/source/filter/ww8/docxsdrexport.cxx
parent13d71843510964a98d3c480d1e42533bdd34deab (diff)
tdf#141058 oox,sw: OOXML import/export of decorative on shapes
Also add a test for PPTX (using the oox filters), and add a SdrObject to the testTdf143311 for DOCX (using the writerfilter/docxsdrexport). Change-Id: Iccee46c0d30316c33c0947b117e2604c96fa0182 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154137 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/source/filter/ww8/docxsdrexport.cxx')
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 4b3e53196a29..0c42d28fc6ad 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1383,6 +1383,26 @@ static bool lcl_isLockedCanvas(const uno::Reference<drawing::XShape>& xShape)
});
}
+void AddExtLst(sax_fastparser::FSHelperPtr const& pFS, DocxExport const& rExport,
+ uno::Reference<beans::XPropertySet> const& xShape)
+{
+ if (xShape->getPropertyValue("Decorative").get<bool>())
+ {
+ pFS->startElementNS(XML_a, XML_extLst,
+ // apparently for DOCX the namespace isn't declared on the root
+ FSNS(XML_xmlns, XML_a),
+ rExport.GetFilter().getNamespaceURL(OOX_NS(dml)));
+ pFS->startElementNS(XML_a, XML_ext,
+ // Word uses this "URI" which is obviously not a URI
+ XML_uri, "{C183D7F6-B498-43B3-948B-1728B52AA6E4}");
+ pFS->singleElementNS(XML_adec, XML_decorative, FSNS(XML_xmlns, XML_adec),
+ "http://schemas.microsoft.com/office/drawing/2017/decorative", XML_val,
+ "1");
+ pFS->endElementNS(XML_a, XML_ext);
+ pFS->endElementNS(XML_a, XML_extLst);
+ }
+}
+
void DocxSdrExport::writeDMLDrawing(const SdrObject* pSdrObject, const SwFrameFormat* pFrameFormat,
int nAnchorId)
{
@@ -1422,6 +1442,9 @@ void DocxSdrExport::writeDMLDrawing(const SdrObject* pSdrObject, const SwFrameFo
FSNS(XML_xmlns, XML_a),
m_pImpl->getExport().GetFilter().getNamespaceURL(OOX_NS(dml)));
}
+ uno::Reference<beans::XPropertySet> const xShapeProps(xShape, uno::UNO_QUERY_THROW);
+ AddExtLst(pFS, m_pImpl->getExport(), xShapeProps);
+
pFS->endElementNS(XML_wp, XML_docPr);
uno::Reference<lang::XServiceInfo> xServiceInfo(xShape, uno::UNO_QUERY_THROW);