[Libreoffice-commits] core.git: sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Dec 10 06:29:00 PST 2013
sw/source/filter/ww8/docxexport.cxx | 9 +++++++++
sw/source/filter/ww8/docxexport.hxx | 3 +++
2 files changed, 12 insertions(+)
New commits:
commit 9dfbc0af502087f62fc0cdd2278d557614aa3bc4
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Dec 10 14:54:44 2013 +0100
DOCX export: add a method to write an XShape as drawingml
Change-Id: Ibe6bee0d8fc251c47a362e71dcfd4543da28f3c4
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index b6d91c9..3aa457f 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 080c507..1eb75c2 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);
More information about the Libreoffice-commits
mailing list