diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-11-05 16:35:59 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-11-06 13:52:14 +0000 |
commit | 2bccaecfb4f9b31964bc8789c3bd5d7080bfc4d9 (patch) | |
tree | 80d118d9f1085884485470f7ffcf3bd7e3d37af2 | |
parent | 99324a9dc5b2963be31ebb7a78679c2f3ed3d7a9 (diff) |
fdo#52989 ignore provided size of JPEG files during RTF import
See commit 66fa759b for rationale, this fix just does the same for JPEG
files as well.
(cherry picked from commit ebc61e11cdb02f5cc33aeabead3d191eaf0d23d3)
Conflicts:
sw/qa/extras/rtfimport/rtfimport.cxx
Change-Id: I6a9ead5f4b4b9c4661cae99501bd7c14a2a79409
Reviewed-on: https://gerrit.libreoffice.org/991
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 7 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index dbaa6e5fc0ca..b84e303dacbc 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -640,9 +640,9 @@ int RTFDocumentImpl::resolvePict(bool bInline) aExtHeader.yExt = m_aStates.top().aPicture.nHeight; OUString aGraphicUrl = m_pGraphicHelper->importGraphicObject(xInputStream, &aExtHeader); - if (m_aStates.top().aPicture.nStyle == BMPSTYLE_PNG) + if (m_aStates.top().aPicture.nStyle != BMPSTYLE_NONE) { - // In case of PNG, the real size is known, don't use the values + // In case of PNG/JPEG, the real size is known, don't use the values // provided by picw and pich. OString aURLBS(OUStringToOString(aGraphicUrl, RTL_TEXTENCODING_UTF8)); const char aURLBegin[] = "vnd.sun.star.GraphicObject:"; @@ -2140,6 +2140,9 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) case RTF_PNGBLIP: m_aStates.top().aPicture.nStyle = BMPSTYLE_PNG; break; + case RTF_JPEGBLIP: + m_aStates.top().aPicture.nStyle = BMPSTYLE_JPEG; + break; case RTF_POSYT: m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_yAlign, NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_top); break; case RTF_POSYB: m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_yAlign, NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_bottom); break; case RTF_POSYC: m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_yAlign, NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_center); break; diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 6d34e8ba2904..6c0608fb7ca7 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -163,7 +163,8 @@ namespace writerfilter { enum RTFBmpStyles { BMPSTYLE_NONE, - BMPSTYLE_PNG + BMPSTYLE_PNG, + BMPSTYLE_JPEG }; enum RTFFieldStatus |