From 70973680f05c587c866d2de2a16bff9ebf8007ca Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 27 Sep 2022 16:32:51 +0200 Subject: sw: fix inserting fields between 2 adjacent input fields Primarily this is achieved by using GetTextAttrMode PARENT in SwCursorShell::CursorInsideInputField() and SwCursorShell::PosInsideInputField(). But this requires some refactoring to make this parameter available. Change-Id: I1a0ef4e3d93a6733d972544abfe07ddf929eb62c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140661 Tested-by: Jenkins Reviewed-by: Michael Stahl --- sw/source/filter/basflt/fltshell.cxx | 2 +- sw/source/filter/ww8/docxattributeoutput.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sw/source/filter') diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index 75ef5d5c36b4..fbfec5eaeccf 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -590,7 +590,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwTextNode const*const pTextNode( aRegion.End()->GetNode().GetTextNode()); SwTextField const*const pField = pTextNode ? pTextNode->GetFieldTextAttrAt( - aRegion.End()->GetContentIndex() - 1, true) : nullptr; + aRegion.End()->GetContentIndex() - 1, ::sw::GetTextAttrMode::Default) : nullptr; if (pField) { SwPostItField const*const pPostIt( diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 501d347dc932..16af1afc910a 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1769,7 +1769,7 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, sal_Int32 nPos, sal_In if (nLen != -1) { - SwTextAttr* pAttr = pNode->GetTextAttrAt(nPos, RES_TXTATR_CONTENTCONTROL, SwTextNode::DEFAULT); + SwTextAttr* pAttr = pNode->GetTextAttrAt(nPos, RES_TXTATR_CONTENTCONTROL, ::sw::GetTextAttrMode::Default); if (pAttr && pAttr->GetStart() == nPos) { auto pTextContentControl = static_txtattr_cast(pAttr); @@ -1799,7 +1799,7 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, sal_Int32 nPos, sal_In if (nLen != -1) { sal_Int32 nEnd = nPos + nLen; - SwTextAttr* pAttr = pNode->GetTextAttrAt(nPos, RES_TXTATR_CONTENTCONTROL, SwTextNode::DEFAULT); + SwTextAttr* pAttr = pNode->GetTextAttrAt(nPos, RES_TXTATR_CONTENTCONTROL, ::sw::GetTextAttrMode::Default); if (pAttr && *pAttr->GetEnd() == nEnd) { WriteContentControlEnd(); -- cgit