diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-08-14 16:27:28 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-08-14 16:31:45 +0200 |
commit | 05d86fcdd9eafac6e337e2117502662688118ea0 (patch) | |
tree | f76b8009c128a931f7437be5f0612a5f5243e724 | |
parent | 3c23dfb5d06bce5ebdd6886c1f879eadce1b0f6f (diff) |
fdo#53113 DOCX: export fillBlip shape property
Change-Id: Id23518d0f72d7650f3d875028f83caf9b6581ccd
-rw-r--r-- | oox/inc/oox/export/vmlexport.hxx | 2 | ||||
-rw-r--r-- | oox/source/export/vmlexport.cxx | 20 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.hxx | 1 |
4 files changed, 26 insertions, 2 deletions
diff --git a/oox/inc/oox/export/vmlexport.hxx b/oox/inc/oox/export/vmlexport.hxx index ec5a4d9baef9..54296a04d8fe 100644 --- a/oox/inc/oox/export/vmlexport.hxx +++ b/oox/inc/oox/export/vmlexport.hxx @@ -21,6 +21,7 @@ #define _OOX_EXPORT_VMLEXPORT_HXX_ #include <oox/dllapi.h> +#include <oox/export/drawingml.hxx> #include <sax/fshelper.hxx> #include <filter/msfilter/escherex.hxx> #include <editeng/outlobj.hxx> @@ -39,6 +40,7 @@ class OOX_DLLPUBLIC VMLTextExport { public: virtual void WriteOutliner(const OutlinerParaObject& rParaObj) = 0; + virtual oox::drawingml::DrawingML& GetDrawingML() = 0; protected: VMLTextExport() {} virtual ~VMLTextExport() {} diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index e764d879c32c..254bee09e47a 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -26,6 +26,7 @@ #include <tools/stream.hxx> #include <svx/svdotext.hxx> +#include <vcl/cvtgrf.hxx> #include <cstdio> @@ -492,6 +493,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect case ESCHER_Prop_fillType: // 384 case ESCHER_Prop_fillColor: // 385 case ESCHER_Prop_fillBackColor: // 387 + case ESCHER_Prop_fillBlip: // 390 case ESCHER_Prop_fNoFillHitTest: // 447 { sal_uInt32 nValue; @@ -504,7 +506,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect { case ESCHER_FillSolid: pFillType = "solid"; break; // TODO case ESCHER_FillPattern: pFillType = ""; break; - // TODO case ESCHER_FillTexture: pFillType = ""; break; + case ESCHER_FillTexture: pFillType = "tile"; break; // TODO case ESCHER_FillPicture: pFillType = ""; break; // TODO case ESCHER_FillShade: pFillType = ""; break; // TODO case ESCHER_FillShadeCenter: pFillType = ""; break; @@ -528,6 +530,19 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect if ( rProps.GetOpt( ESCHER_Prop_fillBackColor, nValue ) ) impl_AddColor( pAttrList, XML_color2, nValue ); + EscherPropSortStruct aStruct; + if ( rProps.GetOpt( ESCHER_Prop_fillBlip, aStruct ) && m_pTextExport) + { + SvMemoryStream aStream; + int nHeaderSize = 25; // The first bytes are WW8-specific, we're only interested in the PNG + aStream.Write(aStruct.pBuf + nHeaderSize, aStruct.nPropSize - nHeaderSize); + aStream.Seek(0); + Graphic aGraphic; + GraphicConverter::Import(aStream, aGraphic, CVT_PNG); + OUString aImageId = m_pTextExport->GetDrawingML().WriteImage( aGraphic ); + pAttrList->add(FSNS(XML_r, XML_id), OUStringToOString(aImageId, RTL_TEXTENCODING_UTF8)); + } + if ( rProps.GetOpt( ESCHER_Prop_fNoFillHitTest, nValue ) ) impl_AddBool( pAttrList, XML_detectmouseclick, nValue ); @@ -536,6 +551,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect bAlreadyWritten[ ESCHER_Prop_fillType ] = true; bAlreadyWritten[ ESCHER_Prop_fillColor ] = true; bAlreadyWritten[ ESCHER_Prop_fillBackColor ] = true; + bAlreadyWritten[ ESCHER_Prop_fillBlip ] = true; bAlreadyWritten[ ESCHER_Prop_fNoFillHitTest ] = true; break; @@ -673,7 +689,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect default: #if OSL_DEBUG_LEVEL > 0 fprintf( stderr, "TODO VMLExport::Commit(), unimplemented id: %d, value: %" SAL_PRIuUINT32 ", data: [%" SAL_PRIuUINT32 ", %p]\n", - it->nPropId, it->nPropValue, it->nPropSize, it->pBuf ); + nId, it->nPropValue, it->nPropSize, it->pBuf ); if ( it->nPropSize ) { const sal_uInt8 *pIt = it->pBuf; diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index da3c926f9ade..cbca1b64a400 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2412,6 +2412,11 @@ void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj) m_pSerializer->endElementNS( XML_w, XML_textbox ); } +oox::drawingml::DrawingML& DocxAttributeOutput::GetDrawingML() +{ + return m_rDrawingML; +} + void DocxAttributeOutput::StartStyle( const String& rName, bool bPapFmt, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 /*nWwId*/, sal_uInt16 nId, bool bAutoUpdate ) { diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index f549784e7ae4..24b68368ed9e 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -637,6 +637,7 @@ public: /// VMLTextExport virtual void WriteOutliner(const OutlinerParaObject& rParaObj); + virtual oox::drawingml::DrawingML& GetDrawingML(); }; #endif // _DOCXATTRIBUTEOUTPUT_HXX_ |