diff options
author | László Németh <nemeth@numbertext.org> | 2018-06-18 16:48:02 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2018-06-19 09:09:44 +0200 |
commit | 4cb1e86e5217f09e1d98e51e46803a06fb72f5ce (patch) | |
tree | 4c72d5d4081878ba83b9ba650f345e43e554e609 /sw | |
parent | 853350787df9a8d92c269ef1b6e764863e74ec2a (diff) |
tdf#103913 keep ".emf" file extension and mime type
in documents, don't change them to wmf and image/x-wmf
silently, resulting for example, dropping or rejecting
modified documents by firewall packet filtering.
Change-Id: I3b8634ae022c7c026b0ed4ebc345c1c3b3f96337
Reviewed-on: https://gerrit.libreoffice.org/56045
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 84cd1067c534..f5459efe4062 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -3682,21 +3682,6 @@ void RtfAttributeOutput::FontPitchType(FontPitch ePitch) const m_rExport.OutULong(nVal); } -static bool IsEMF(const sal_uInt8* pGraphicAry, unsigned long nSize) -{ - if (pGraphicAry && (nSize > 0x2c)) - { - // check the magic number - if ((pGraphicAry[0x28] == 0x20) && (pGraphicAry[0x29] == 0x45) - && (pGraphicAry[0x2a] == 0x4d) && (pGraphicAry[0x2b] == 0x46)) - { - //emf detected - return true; - } - } - return false; -} - static bool StripMetafileHeader(const sal_uInt8*& rpGraphicAry, unsigned long& rSize) { if (rpGraphicAry && (rSize > 0x22)) @@ -3938,8 +3923,8 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat pBLIPType = OOO_STRING_SVTOOLS_RTF_PNGBLIP; break; case GfxLinkType::NativeWmf: - pBLIPType = IsEMF(pGraphicAry, nSize) ? OOO_STRING_SVTOOLS_RTF_EMFBLIP - : OOO_STRING_SVTOOLS_RTF_WMETAFILE; + pBLIPType = aGraphicLink.IsEMF() ? OOO_STRING_SVTOOLS_RTF_EMFBLIP + : OOO_STRING_SVTOOLS_RTF_WMETAFILE; break; case GfxLinkType::NativeGif: // GIF is not supported by RTF, but we override default conversion to WMF, PNG seems fits better here. |