summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2020-11-09 18:54:18 +0300
committerMiklos Vajna <vmiklos@collabora.com>2020-11-12 10:57:04 +0100
commitaaf931335b39cc788a544994fb0712286c4d998e (patch)
tree11f8a3d8456dc924a0f46ffd03b917e80364fb0b /writerfilter
parenta5389cb5ddcd72e494040e7a976c4f290e2da4cc (diff)
tdf#137850 writerfilter compatibilityMode15: ignore behindDoc if wrapped
This patch is based on testing results, since I couldn't find anything in the documentation that indicated a change between Word 2010 and Word 2013. But the evidence is fairly clear I think. To quote from MS documentation on relativeHeight: > This attribute shall only indicate the Z-order with respect to other objects > in the document which have an identical behindDoc attribute value. > _All_ objects with a behindDoc value of false shall be displayed > above elements with a value of true. But only wrapNone makes mention of being affected by behindDoc, so apparently MS decided to ignore it for some reason starting in Word 2013. By simply changing the compatibiltyMode value to one lower, Word 2013 again starts to honour the behindDoc setting. Change-Id: I7ef40387707ab5376cf8fa4d8a208c5b6a8b37ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105486 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index ac62a161fe2a..59c972ec8429 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -1136,6 +1136,20 @@ void GraphicImport::lcl_sprm(Sprm& rSprm)
m_pImpl->m_aInteropGrabBag["EG_WrapType"] <<= OUString("wrapTight");
else if (nSprmId == NS_ooxml::LN_EG_WrapType_wrapThrough)
m_pImpl->m_aInteropGrabBag["EG_WrapType"] <<= OUString("wrapThrough");
+
+ switch (nSprmId)
+ {
+ case NS_ooxml::LN_EG_WrapType_wrapSquare:
+ case NS_ooxml::LN_EG_WrapType_wrapThrough:
+ case NS_ooxml::LN_EG_WrapType_wrapTight:
+ {
+ // tdf#137850: Word >= 2013 seems to ignore bBehindDoc except for wrapNone, but older versions honour it.
+ if (m_pImpl->bBehindDoc && m_pImpl->rDomainMapper.GetSettingsTable()->GetWordCompatibilityMode() > 14)
+ m_pImpl->bOpaque = true;
+ }
+ break;
+ }
+
}
break;
case NS_ooxml::LN_CT_WrapTight_wrapPolygon:
@@ -1247,6 +1261,9 @@ void GraphicImport::lcl_sprm(Sprm& rSprm)
m_pImpl->nBottomMargin = 0;
break;
case NS_ooxml::LN_EG_WrapType_wrapTopAndBottom: // 90948;
+ // tdf#137850: Word >= 2013 seems to ignore bBehindDoc except for wrapNone, but older versions honour it.
+ if (m_pImpl->bBehindDoc && m_pImpl->rDomainMapper.GetSettingsTable()->GetWordCompatibilityMode() > 14)
+ m_pImpl->bOpaque = true;
m_pImpl->nWrap = text::WrapTextMode_NONE;
break;
case NS_ooxml::LN_CT_GraphicalObject_graphicData:// 90660;