diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-10 14:54:44 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-10 15:28:25 +0100 |
commit | 9dfbc0af502087f62fc0cdd2278d557614aa3bc4 (patch) | |
tree | ab029b4932ef4f9f825200dc31695963a9d7382e /sw | |
parent | eebd963d6d5df8b7637093addfe1b4052eed1f8a (diff) |
DOCX export: add a method to write an XShape as drawingml
Change-Id: Ibe6bee0d8fc251c47a362e71dcfd4543da28f3c4
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/docxexport.cxx | 9 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxexport.hxx | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index b6d91c917d8a..3aa457f5130a 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/XDocumentProperties.hpp> +#include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/i18n/ScriptType.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/xml/dom/XDocument.hpp> @@ -33,6 +34,7 @@ #include <oox/export/drawingml.hxx> #include <oox/export/vmlexport.hxx> #include <oox/export/chartexport.hxx> +#include <oox/export/shapes.hxx> #include <map> #include <algorithm> @@ -327,6 +329,12 @@ OString DocxExport::OutputChart( uno::Reference< frame::XModel >& xModel, sal_In return OUStringToOString( sId, RTL_TEXTENCODING_UTF8 ); } +void DocxExport::OutputDML(uno::Reference<drawing::XShape>& xShape) +{ + oox::drawingml::ShapeExport aExport(XML_wps, m_pDocumentFS, 0, m_pFilter, oox::drawingml::DrawingML::DOCUMENT_DOCX); + aExport.WriteShape(xShape); +} + void DocxExport::ExportDocument_Impl() { // Set the 'Track Revisions' flag in the settings structure @@ -1014,6 +1022,7 @@ XFastAttributeListRef DocxExport::MainXmlNamespaces( FSHelperPtr serializer ) pAttr->add( FSNS( XML_xmlns, XML_w ), "http://schemas.openxmlformats.org/wordprocessingml/2006/main" ); pAttr->add( FSNS( XML_xmlns, XML_w10 ), "urn:schemas-microsoft-com:office:word" ); pAttr->add( FSNS( XML_xmlns, XML_wp ), "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" ); + pAttr->add( FSNS( XML_xmlns, XML_wps ), "http://schemas.microsoft.com/office/word/2010/wordprocessingShape" ); return XFastAttributeListRef( pAttr ); } diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 080c507b18ee..1eb75c24ea2c 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -46,6 +46,7 @@ namespace oox { namespace com { namespace sun { namespace star { namespace frame { class XModel; } + namespace drawing { class XShape; } } } } /// Data to be written in the document settings part of the document @@ -145,6 +146,8 @@ public: /// Returns the relationd id OString OutputChart( com::sun::star::uno::Reference< com::sun::star::frame::XModel >& xModel, sal_Int32 nCount ); + /// Writes the shape using drawingML syntax. + void OutputDML( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape ); void WriteOutliner(const OutlinerParaObject& rOutliner, sal_uInt8 nTyp); |