diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-04-12 18:39:36 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-05-23 10:19:57 +0200 |
commit | 3790b16318f687b11a1a6453e96e86a48b0e2eb1 (patch) | |
tree | 72a8c3e967a5be8cbbdd92c155cddc7c776b356e /writerfilter | |
parent | 281fba83860c9635ac7b9b00286b68270abf3c27 (diff) |
tdf#116976 DOCX import: fix rel size of shape after bitmap
We have a queue of these odd relative sizes (which are not XML
attributes but text inside the XML element), if the bitmap doesn't pop
the queue, the following shape won't get its size.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
Change-Id: I1602208c9509d8889bf0be254f3b25fb25fafca2
Reviewed-on: https://gerrit.libreoffice.org/54669
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Tested-by: Aron Budea <aron.budea@collabora.com>
(cherry picked from commit e6f39221b5ce652c78cc675c8dd0a662332ecacc)
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 5044454ddaef..5ae59defc618 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -1087,10 +1087,12 @@ void GraphicImport::lcl_sprm(Sprm& rSprm) break; case NS_ooxml::LN_CT_SizeRelH_pctWidth: case NS_ooxml::LN_CT_SizeRelV_pctHeight: - if (m_xShape.is() && !m_pImpl->m_rPositivePercentages.empty()) + if (m_pImpl->m_rPositivePercentages.empty()) + break; + + if (m_xShape.is()) { sal_Int16 nPositivePercentage = rtl::math::round(m_pImpl->m_rPositivePercentages.front().toDouble() / oox::drawingml::PER_PERCENT); - m_pImpl->m_rPositivePercentages.pop(); if (nPositivePercentage) { @@ -1099,6 +1101,10 @@ void GraphicImport::lcl_sprm(Sprm& rSprm) xPropertySet->setPropertyValue(aProperty, uno::makeAny(nPositivePercentage)); } } + + // Make sure the token is consumed even if xShape is an empty + // reference. + m_pImpl->m_rPositivePercentages.pop(); break; case NS_ooxml::LN_EG_WrapType_wrapNone: // 90944; - doesn't contain attributes //depending on the behindDoc attribute text wraps through behind or in fron of the object |