diff options
author | László Németh <nemeth@numbertext.org> | 2018-06-18 17:29:11 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-09-12 09:43:31 +0200 |
commit | 6685a3b6fb1e4e3c6e109904d0d20fcd00c3e470 (patch) | |
tree | 1a05abc41c267a2587becd6cb3c052faf8594831 /filter | |
parent | 083a7eb44be5a2603a21ce61a294cf02cf1a0368 (diff) |
filter clean-up: remove duplicate of checking EMF magic header
Change-Id: I63fd380be974c1d15beef0d2cfec42350119ae2f
Reviewed-on: https://gerrit.libreoffice.org/56050
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit 4188a037fbaf3618df26e1661a4586483036f055)
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/escherex.cxx | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 98a961f63836..6256032ff665 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -4208,22 +4208,18 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin case GfxLinkType::NativeWmf : { - if ( pGraphicAry && ( p_EscherBlibEntry->mnSize > 0x2c ) ) + if ( aGraphicLink.IsEMF() ) { - if ( ( pGraphicAry[ 0x28 ] == 0x20 ) && ( pGraphicAry[ 0x29 ] == 0x45 ) // check the magic - && ( pGraphicAry[ 0x2a ] == 0x4d ) && ( pGraphicAry[ 0x2b ] == 0x46 ) ) // number ( emf detection ) - { - p_EscherBlibEntry->meBlibType = EMF; - } - else - { - p_EscherBlibEntry->meBlibType = WMF; - if ( ( pGraphicAry[ 0 ] == 0xd7 ) && ( pGraphicAry[ 1 ] == 0xcd ) - && ( pGraphicAry[ 2 ] == 0xc6 ) && ( pGraphicAry[ 3 ] == 0x9a ) ) - { // we have to get rid of the metafileheader - pGraphicAry += 22; - p_EscherBlibEntry->mnSize -= 22; - } + p_EscherBlibEntry->meBlibType = EMF; + } + else if ( pGraphicAry && ( p_EscherBlibEntry->mnSize > 0x2c ) ) + { + p_EscherBlibEntry->meBlibType = WMF; + if ( ( pGraphicAry[ 0 ] == 0xd7 ) && ( pGraphicAry[ 1 ] == 0xcd ) + && ( pGraphicAry[ 2 ] == 0xc6 ) && ( pGraphicAry[ 3 ] == 0x9a ) ) + { // we have to get rid of the metafileheader + pGraphicAry += 22; + p_EscherBlibEntry->mnSize -= 22; } } } |