summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-08-14 16:27:28 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-08-14 16:31:45 +0200
commit05d86fcdd9eafac6e337e2117502662688118ea0 (patch)
treef76b8009c128a931f7437be5f0612a5f5243e724 /oox
parent3c23dfb5d06bce5ebdd6886c1f879eadce1b0f6f (diff)
fdo#53113 DOCX: export fillBlip shape property
Change-Id: Id23518d0f72d7650f3d875028f83caf9b6581ccd
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/oox/export/vmlexport.hxx2
-rw-r--r--oox/source/export/vmlexport.cxx20
2 files changed, 20 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;