diff options
author | Armin Le Grand <alg@apache.org> | 2014-02-27 13:46:24 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-27 19:30:40 +0000 |
commit | af63727b9fdd48258f692d1ccf6d15daccc18681 (patch) | |
tree | b23adba5c31315383e05ee9bc2310a93fa1e575f /filter | |
parent | c3bdaca0e6c26775fae7f682732251a8e72cff30 (diff) |
Resolves: #i15508# Added support for BMP file type
(cherry picked from commit 9956ed1303545cd61901e33b110698c4e5e224c4)
Conflicts:
filter/source/msfilter/escherex.cxx
include/vcl/gfxlink.hxx
svx/source/xml/xmlgrhlp.cxx
sw/source/ui/docvw/romenu.cxx
vcl/source/filter/graphicfilter.cxx
Change-Id: Ibcbb69b9c57cd8a438788e9a9c95744e99b6fcdd
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/escherex.cxx | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index a50b72a3766f..06652f15f741 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -4359,6 +4359,15 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin { case GFX_LINK_TYPE_NATIVE_JPG : p_EscherBlibEntry->meBlibType = PEG; break; case GFX_LINK_TYPE_NATIVE_PNG : p_EscherBlibEntry->meBlibType = PNG; break; + + // #i15508# added BMP type for better exports; need to check this + // checked - does not work that way, so keep out for now. It may + // work somehow with direct DIB data, but that would need to be checked + // carefully + // for more comments please check RtfAttributeOutput::FlyFrameGraphic + // + // case GFX_LINK_TYPE_NATIVE_BMP : p_EscherBlibEntry->meBlibType = DIB; break; + case GFX_LINK_TYPE_NATIVE_WMF : { if ( pGraphicAry && ( p_EscherBlibEntry->mnSize > 0x2c ) ) @@ -4456,13 +4465,34 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin else if ( eBlibType == PEG ) rPicOutStrm.WriteUInt16( (sal_uInt16)0x0505 ); } + // fdo#69607 do not compress WMF files if we are in OOXML export - if ( ( eBlibType == PEG ) || ( eBlibType == PNG ) || - ( ( ( eBlibType == WMF ) || ( eBlibType == EMF ) ) && bOOxmlExport ) ) + if ( ( eBlibType == PEG ) || ( eBlibType == PNG ) // || ( eBlibType == DIB )) // #i15508# + || ( ( ( eBlibType == WMF ) || ( eBlibType == EMF ) ) && bOOxmlExport ) ) { nExtra = 17; p_EscherBlibEntry->mnSizeExtra = nExtra + 8; - nInstance = ( eBlibType == PNG ) ? 0xf01e6e00 : 0xf01d46a0; + + // #i15508# type see SvxMSDffManager::GetBLIPDirect (checked, does not work this way) + // see RtfAttributeOutput::FlyFrameGraphic for more comments + // maybe it would work with direct DIB data, but that would need thorough testing + if( eBlibType == PNG ) + { + nInstance = 0xf01e6e00; + } + else // if( eBlibType == PEG ) + { + nInstance = 0xf01d46a0; + } + //else // eBlibType == DIB + //{ + // nInstance = 0xf01d7A80; + //} + + // #i15508# + //nInstance = ( eBlibType == PNG ) ? 0xf01e6e00 : 0xf01d46a0; + + rPicOutStrm.WriteUInt32( nInstance ).WriteUInt32( (sal_uInt32)( p_EscherBlibEntry->mnSize + nExtra ) ); rPicOutStrm.Write( p_EscherBlibEntry->mnIdentifier, 16 ); rPicOutStrm.WriteUChar( (sal_uInt8)0xff ); |