summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-11-05 16:35:59 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-11-05 16:51:19 +0100
commitebc61e11cdb02f5cc33aeabead3d191eaf0d23d3 (patch)
treeb23e04213829cf60ab932586477fb0738db1f4cc /writerfilter
parentbbf0a6cf77bafb23c2fa20ac42713baf113e8c6f (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. Change-Id: I6a9ead5f4b4b9c4661cae99501bd7c14a2a79409
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx7
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx3
2 files changed, 7 insertions, 3 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index a5ee8f525674..4393aa0bfb3e 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -647,9 +647,9 @@ int RTFDocumentImpl::resolvePict(bool bInline)
pExtHeader = 0;
OUString aGraphicUrl = m_pGraphicHelper->importGraphicObject(xInputStream, pExtHeader);
- 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:";
@@ -2261,6 +2261,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 c0956f77b520..4942facc0d3e 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -222,7 +222,8 @@ namespace writerfilter {
enum RTFBmpStyles
{
BMPSTYLE_NONE,
- BMPSTYLE_PNG
+ BMPSTYLE_PNG,
+ BMPSTYLE_JPEG
};
enum RTFFieldStatus