summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorsushil_shinde <sushil.shinde@synerzip.com>2013-10-21 21:34:55 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-11-12 09:54:08 +0100
commit965d29d00eb14250a994393f5d6b437e49760830 (patch)
treee6d7bea8361e352b708a1face3d8e4866c9234a2 /oox/source
parent439b518b1a96b8cffd96da6fd060e7be074a2035 (diff)
#65836- Fix for exporting image inside vml data was corrupting file.
- Handled exporting of image for all type of format in vmlexport. - fixed issue - .rels file was not getting exported for vmlexport. - Not handled for .wmf image (will work on it) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/6369 Change-Id: I9ccf7a36ae316a658f06d1074caa4e4b2f5d271f
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/export/vmlexport.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 6274e19b0b5e..8eeb9dc2183b 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -555,6 +555,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect
if ( rProps.GetOpt( ESCHER_Prop_fillBackColor, nValue ) )
impl_AddColor( pAttrList, XML_color2, nValue );
+ bool imageData = false;
EscherPropSortStruct aStruct;
if ( rProps.GetOpt( ESCHER_Prop_fillBlip, aStruct ) && m_pTextExport)
{
@@ -563,9 +564,10 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect
aStream.Write(aStruct.pBuf + nHeaderSize, aStruct.nPropSize - nHeaderSize);
aStream.Seek(0);
Graphic aGraphic;
- GraphicConverter::Import(aStream, aGraphic, CVT_PNG);
+ GraphicConverter::Import(aStream, aGraphic);
OUString aImageId = m_pTextExport->GetDrawingML().WriteImage( aGraphic );
pAttrList->add(FSNS(XML_r, XML_id), OUStringToOString(aImageId, RTL_TEXTENCODING_UTF8));
+ imageData = true;
}
if ( rProps.GetOpt( ESCHER_Prop_fNoFillHitTest, nValue ) )
@@ -575,7 +577,10 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect
// Partly undo the transformation at the end of EscherPropertyContainer::CreateFillProperties(): VML opacity is 0..1.
pAttrList->add(XML_opacity, OString::number(double((nValue * 100) >> 16) / 100));
- m_pSerializer->singleElementNS( XML_v, XML_fill, XFastAttributeListRef( pAttrList ) );
+ if (imageData)
+ m_pSerializer->singleElementNS( XML_v, XML_imagedata, XFastAttributeListRef( pAttrList ) );
+ else
+ m_pSerializer->singleElementNS( XML_v, XML_fill, XFastAttributeListRef( pAttrList ) );
}
bAlreadyWritten[ ESCHER_Prop_fillType ] = true;
bAlreadyWritten[ ESCHER_Prop_fillColor ] = true;