sw/source/filter/ww8/docxattributeoutput.cxx | 21 +++++++++++++++++++-- sw/source/filter/ww8/docxattributeoutput.hxx | 3 +++ sw/source/filter/ww8/docxexport.cxx | 1 + 3 files changed, 23 insertions(+), 2 deletions(-)
New commits: commit 0cdba4ca17942b5a4f9f8ac3b91a7d0b096bad57 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Wed Dec 11 11:24:44 2013 +0100 DOCX export: write mc:AlternateContent around drawingml shapes Change-Id: Ie4cacea61f84aa1e24df9fc39b9467d08f9ca4f0 diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 8150e1c..1209e43 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3321,7 +3321,7 @@ void DocxAttributeOutput::WritePostponedDMLDrawing() it != m_postponedDMLDrawing->end(); ++it ) { - WriteDMLDrawing(it->object, it->frame); + WriteDMLAndVMLDrawing(it->object, *(it->frame), *(it->point)); } delete m_postponedDMLDrawing; m_postponedDMLDrawing = NULL; @@ -3354,6 +3354,23 @@ void DocxAttributeOutput::WriteDMLDrawing( const SdrObject* pSdrObject, const Sw lcl_endDMLAnchorInline(m_pSerializer, pFrmFmt); } +void DocxAttributeOutput::WriteDMLAndVMLDrawing(const SdrObject* sdrObj, const SwFrmFmt& rFrmFmt,const Point& rNdTopLeft) +{ + m_pSerializer->startElementNS(XML_mc, XML_AlternateContent, FSEND); + + m_pSerializer->startElementNS(XML_mc, XML_Choice, + XML_Requires, "wps", + FSEND); + WriteDMLDrawing(sdrObj, &rFrmFmt); + m_pSerializer->endElementNS(XML_mc, XML_Choice); + + m_pSerializer->startElementNS(XML_mc, XML_Fallback, FSEND); + WriteVMLDrawing(sdrObj, rFrmFmt, rNdTopLeft); + m_pSerializer->endElementNS(XML_mc, XML_Fallback); + + m_pSerializer->endElementNS(XML_mc, XML_AlternateContent); +} + void DocxAttributeOutput::WriteVMLDrawing( const SdrObject* sdrObj, const SwFrmFmt& rFrmFmt,const Point& rNdTopLeft ) { bool bSwapInPage = false; @@ -3427,7 +3444,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po if (aMiscOptions.IsExperimentalMode()) { if ( m_postponedDMLDrawing == NULL ) - WriteDMLDrawing( pSdrObj, &rFrame.GetFrmFmt()); + WriteDMLAndVMLDrawing( pSdrObj, rFrame.GetFrmFmt(), rNdTopLeft); else // we are writing out attributes, but w:drawing should not be inside w:rPr, so write it out later m_postponedDMLDrawing->push_back(PostponedDrawing(pSdrObj, &(rFrame.GetFrmFmt()), &rNdTopLeft)); diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index bac7c8a..90c7701 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -376,6 +376,9 @@ private: void WriteVMLDrawing( const SdrObject* sdrObj, const SwFrmFmt& rFrmFmt,const Point& rNdTopLeft ); /// Writes wp wrapper code around an SdrObject, which itself is written using drawingML syntax. void WriteDMLDrawing( const SdrObject* pSdrObj, const SwFrmFmt* pFrmFmt ); + /// Writes shape in both DML and VML format. + void WriteDMLAndVMLDrawing( const SdrObject* sdrObj, const SwFrmFmt& rFrmFmt,const Point& rNdTopLeft ); + void InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); void StartTable( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); void StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 3aa457f..bbc3673 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -1023,6 +1023,7 @@ XFastAttributeListRef DocxExport::MainXmlNamespaces( FSHelperPtr serializer ) 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" ); + pAttr->add( FSNS( XML_xmlns, XML_mc ), "http://schemas.openxmlformats.org/markup-compatibility/2006" ); return XFastAttributeListRef( pAttr ); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits