diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-08-14 08:25:41 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-08-14 10:49:45 +0200 |
commit | d44af60677740b151305799a4325d0f0699fce66 (patch) | |
tree | f6fb7a96718e6ae7087bbcfe47b136f875027c93 /sw/source | |
parent | 4403b4e6bac19d89afded080d80de049aaa294ca (diff) |
sw floattable: handle AllowOverlap==false in the DOC filter
Map sprmTFNoAllowOverlap to
SwFormatWrapInfluenceOnObjPos::mbAllowOverlap on import, and do the
opposite on export.
Change-Id: Id61be49adb39862e30ffb2da9ff9aabae11f7d83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155650
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 17 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8struc.hxx | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index c51b1c3f7777..fc2beabe9bef 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -117,6 +117,7 @@ #include <rdfhelper.hxx> #include <fmtclbl.hxx> #include <iodetect.hxx> +#include <fmtwrapinfluenceonobjpos.hxx> using namespace css; using namespace sw::util; @@ -2407,6 +2408,13 @@ void WW8AttributeOutput::TablePositioning(SwFrameFormat* pFlyFormat) sal_uInt16 nDxaFromTextRight = pFlyFormat->GetLRSpace().GetRight(); m_rWW8Export.InsUInt16(NS_sprm::TDxaFromTextRight::val); m_rWW8Export.InsUInt16(nDxaFromTextRight); + + if (!pFlyFormat->GetWrapInfluenceOnObjPos().GetAllowOverlap()) + { + // Allowing overlap is the default in both Writer and in WW8. + m_rWW8Export.InsUInt16(NS_sprm::TFNoAllowOverlap::val); + m_rWW8Export.m_pO->push_back(1); + } } void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 2376692d4892..982e3ba5dc17 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2536,6 +2536,15 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, const WW8_TablePos *p // Map a positioned table to a split fly. aFlySet.Put(SwFormatFlySplit(true)); + + if (pTabPos->nTFNoAllowOverlap) + { + // text::WrapInfluenceOnPosition::ONCE_SUCCESSIVE is not the default and is set in + // the WW8FlySet ctor already, keep that unchanged. + SwFormatWrapInfluenceOnObjPos aInfluence(aFlySet.Get(RES_WRAP_INFLUENCE_ON_OBJPOS)); + aInfluence.SetAllowOverlap(false); + aFlySet.Put(aInfluence); + } } m_xSFlyPara->SetFlyFormat(m_rDoc.MakeFlySection(WW8SwFlyPara::eAnchor, @@ -5404,6 +5413,14 @@ bool SwWW8ImplReader::ParseTabPos(WW8_TablePos *pTabPos, WW8PLCFx_Cp_FKP* pPap) aRes = pPap->HasSprm(NS_sprm::TDyaFromTextBottom::val); if (aRes.pSprm && aRes.nRemainingData >= 2) pTabPos->nLowerMargin = SVBT16ToUInt16(aRes.pSprm); + + aRes = pPap->HasSprm(NS_sprm::TFNoAllowOverlap::val); + if (aRes.pSprm) + { + // Remember the no-overlap request, to be consumed in SwWW8ImplReader::StartApo(). + pTabPos->nTFNoAllowOverlap = *aRes.pSprm; + } + bRet = true; } return bRet; diff --git a/sw/source/filter/ww8/ww8struc.hxx b/sw/source/filter/ww8/ww8struc.hxx index cdd1fed1da8f..2802c383056d 100644 --- a/sw/source/filter/ww8/ww8struc.hxx +++ b/sw/source/filter/ww8/ww8struc.hxx @@ -897,6 +897,7 @@ struct WW8_TablePos sal_Int16 nLowerMargin; sal_uInt8 nTPc; sal_uInt8 nPWr; + sal_uInt8 nTFNoAllowOverlap; }; struct WW8_FSPA |