diff options
Diffstat (limited to 'vcl/source/gdi/gfxlink.cxx')
-rw-r--r-- | vcl/source/gdi/gfxlink.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx index 885385cb51b0..d37938dba8a0 100644 --- a/vcl/source/gdi/gfxlink.cxx +++ b/vcl/source/gdi/gfxlink.cxx @@ -286,4 +286,20 @@ std::shared_ptr<sal_uInt8> GfxLink::GetSwapInData() const return pData; } +bool GfxLink::IsEMF() const +{ + const sal_uInt8* pGraphicAry = GetData(); + if ((GetType() == GfxLinkType::NativeWmf) && pGraphicAry && (GetDataSize() > 0x2c)) + { + // check the magic number + if ((pGraphicAry[0x28] == 0x20) && (pGraphicAry[0x29] == 0x45) + && (pGraphicAry[0x2a] == 0x4d) && (pGraphicAry[0x2b] == 0x46)) + { + //emf detected + return true; + } + } + return false; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |