summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-04-12 18:39:36 +0200
committerAndras Timar <andras.timar@collabora.com>2018-04-26 11:48:54 +0200
commitbc72562aa8807d352124bd687ff078e7c5bedf4f (patch)
tree064f9f421b48b547df7e11d6cf846b3f39bc8a3a /writerfilter
parent4878a8bc1e5081dd5dfa68682021d7e77bd6b10c (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/52970 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 65f4c7b8725e8fe086889fca8c7c9b7e32fdd4d5)
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index b6c11b58c603..6830e9db71b1 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -1065,10 +1065,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)
{
@@ -1077,6 +1079,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 front of the object