sw/inc/reffld.hxx | 8 sw/source/core/bastyp/index.cxx | 38 +- sw/source/core/crsr/crsrsh.cxx | 12 sw/source/core/crsr/trvltbl.cxx | 14 sw/source/core/doc/DocumentContentOperationsManager.cxx | 232 ++++++++-------- sw/source/core/doc/DocumentRedlineManager.cxx | 204 +++++++------- sw/source/core/doc/doccomp.cxx | 6 sw/source/core/doc/docedt.cxx | 24 - sw/source/core/doc/docfmt.cxx | 28 - sw/source/core/doc/docftn.cxx | 8 sw/source/core/doc/docnum.cxx | 22 - sw/source/core/doc/docredln.cxx | 50 +-- sw/source/core/doc/docruby.cxx | 18 - sw/source/core/doc/swserv.cxx | 12 sw/source/core/docnode/ndsect.cxx | 22 - sw/source/core/docnode/ndtbl.cxx | 34 +- sw/source/core/docnode/nodes.cxx | 34 +- sw/source/core/edit/edattr.cxx | 24 - sw/source/core/edit/edlingu.cxx | 6 sw/source/core/edit/ednumber.cxx | 8 sw/source/core/edit/edsect.cxx | 12 sw/source/core/edit/edtox.cxx | 6 sw/source/core/fields/cellfml.cxx | 12 sw/source/core/fields/reffld.cxx | 48 +-- sw/source/core/frmedt/fetab.cxx | 4 sw/source/core/inc/DocumentContentOperationsManager.hxx | 4 sw/source/core/inc/UndoDelete.hxx | 2 sw/source/core/undo/undel.cxx | 42 +- sw/source/core/undo/undobj.cxx | 86 ++--- sw/source/core/undo/unins.cxx | 10 sw/source/filter/ascii/parasc.cxx | 68 ++-- sw/source/filter/basflt/fltshell.cxx | 8 sw/source/filter/ww8/wrtw8nds.cxx | 22 - 33 files changed, 564 insertions(+), 564 deletions(-)
New commits: commit 844ef4fc67e37bd1db9e9895cf9805eaab57074f Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Dec 17 10:12:41 2024 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Dec 17 11:27:25 2024 +0100 sw: pStt -> pStart Change-Id: If2d8574e732581b5726734e2ac24196242a52d8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178642 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx index 2adc2f3a3244..f50219df9885 100644 --- a/sw/inc/reffld.hxx +++ b/sw/inc/reffld.hxx @@ -96,7 +96,7 @@ public: static SwTextNode* FindAnchor( SwDoc* pDoc, const OUString& rRefMark, sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uInt16 nFlags, - sal_Int32* pStt, sal_Int32* pEnd = nullptr, + sal_Int32* pStart, sal_Int32* pEnd = nullptr, SwRootFrame const* pLayout = nullptr, SwTextNode* pSelf = nullptr, SwFrame* pFrame = nullptr); void UpdateGetReferences(); @@ -105,16 +105,16 @@ public: private: static SwTextNode* FindAnchorRefStyle( SwDoc* pDoc, const OUString& rRefMark, sal_uInt16 nFlags, - sal_Int32* pStt, sal_Int32* pEnd, + sal_Int32* pStart, sal_Int32* pEnd, SwRootFrame const* pLayout, SwTextNode* pSelf, SwFrame* pFrame); static SwTextNode* FindAnchorRefStyleMarginal( SwDoc* pDoc, sal_uInt16 nFlags, - sal_Int32* pStt, sal_Int32* pEnd, + sal_Int32* pStart, sal_Int32* pEnd, SwTextNode* pSelf, SwFrame* pFrame, const SwTextNode* pReference, std::u16string_view styleName); static SwTextNode* FindAnchorRefStyleOther( SwDoc* pDoc, - sal_Int32* pStt, sal_Int32* pEnd, + sal_Int32* pStart, sal_Int32* pEnd, SwTextNode* pSelf, const SwTextNode* pReference, std::u16string_view styleName); }; diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx index 39eebfcd713e..ac331a20d09b 100644 --- a/sw/source/core/bastyp/index.cxx +++ b/sw/source/core/bastyp/index.cxx @@ -233,43 +233,43 @@ void SwContentIndexReg::Update( const sal_Int32 nDiff, UpdateMode const eMode) { - SwContentIndex* pStt = const_cast<SwContentIndex*>(&rIdx); + SwContentIndex* pStart = const_cast<SwContentIndex*>(&rIdx); const sal_Int32 nNewVal = rIdx.m_nIndex; if (eMode & UpdateMode::Negative) { const sal_Int32 nLast = rIdx.m_nIndex + nDiff; - pStt = rIdx.m_pNext; + pStart = rIdx.m_pNext; // skip over the ones that already have the right value - while (pStt && pStt->m_nIndex == nNewVal) - pStt = pStt->m_pNext; - while (pStt && pStt->m_nIndex <= nLast) + while (pStart && pStart->m_nIndex == nNewVal) + pStart = pStart->m_pNext; + while (pStart && pStart->m_nIndex <= nLast) { - pStt->m_nIndex = nNewVal; - pStt = pStt->m_pNext; + pStart->m_nIndex = nNewVal; + pStart = pStart->m_pNext; } - while( pStt ) + while( pStart ) { - pStt->m_nIndex = pStt->m_nIndex - nDiff; - pStt = pStt->m_pNext; + pStart->m_nIndex = pStart->m_nIndex - nDiff; + pStart = pStart->m_pNext; } } else { - while (pStt && pStt->m_nIndex == nNewVal) + while (pStart && pStart->m_nIndex == nNewVal) { - pStt->m_nIndex = pStt->m_nIndex + nDiff; - pStt = pStt->m_pPrev; + pStart->m_nIndex = pStart->m_nIndex + nDiff; + pStart = pStart->m_pPrev; } - pStt = rIdx.m_pNext; - while( pStt ) + pStart = rIdx.m_pNext; + while( pStart ) { // HACK: avoid updating position of cross-ref bookmarks - if (pStt->m_pOwner && pStt->m_pOwner->GetOwnerType() == SwContentIndexOwnerType::Mark - && dynamic_cast< ::sw::mark::CrossRefBookmark const*>(pStt->m_pOwner)) + if (pStart->m_pOwner && pStart->m_pOwner->GetOwnerType() == SwContentIndexOwnerType::Mark + && dynamic_cast< ::sw::mark::CrossRefBookmark const*>(pStart->m_pOwner)) ; // do nothing else - pStt->m_nIndex = pStt->m_nIndex + nDiff; - pStt = pStt->m_pNext; + pStart->m_nIndex = pStart->m_nIndex + nDiff; + pStart = pStart->m_pNext; } } } diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 6386b8673856..67935972349a 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -88,7 +88,7 @@ using namespace com::sun::star; */ static void CheckRange( SwCursor* pCurrentCursor ) { - auto [pStt, pEnd] = pCurrentCursor->StartEnd(); // SwPosition* + auto [pStart, pEnd] = pCurrentCursor->StartEnd(); // SwPosition* SwPaM *pTmpDel = nullptr, *pTmp = pCurrentCursor->GetNext(); @@ -97,14 +97,14 @@ static void CheckRange( SwCursor* pCurrentCursor ) while( pTmp != pCurrentCursor ) { auto [pTmpStt, pTmpEnd] = pTmp->StartEnd(); // SwPosition* - if( *pStt <= *pTmpStt ) + if( *pStart <= *pTmpStt ) { if( *pEnd > *pTmpStt || ( *pEnd == *pTmpStt && *pEnd == *pTmpEnd )) pTmpDel = pTmp; } else - if( *pStt < *pTmpEnd ) + if( *pStart < *pTmpEnd ) pTmpDel = pTmp; // If Point or Mark is within the Cursor range, we need to remove the old @@ -3237,7 +3237,7 @@ bool SwCursorShell::ParkTableCursor() void SwCursorShell::ParkPams( SwPaM* pDelRg, SwShellCursor** ppDelRing ) { - auto [pStt, pEnd] = pDelRg->StartEnd(); // SwPosition* + auto [pStart, pEnd] = pDelRg->StartEnd(); // SwPosition* SwPaM *pTmpDel = nullptr, *pTmp = *ppDelRing; @@ -3251,14 +3251,14 @@ void SwCursorShell::ParkPams( SwPaM* pDelRg, SwShellCursor** ppDelRing ) auto [pTmpStt, pTmpEnd] = pTmp->StartEnd(); // SwPosition* // If a SPoint or GetMark are in a cursor area then cancel the old area. // During comparison keep in mind that End() is outside the area. - if( *pStt <= *pTmpStt ) + if( *pStart <= *pTmpStt ) { if( *pEnd > *pTmpStt || ( *pEnd == *pTmpStt && *pEnd == *pTmpEnd )) pTmpDel = pTmp; } else - if( *pStt < *pTmpEnd ) + if( *pStart < *pTmpEnd ) pTmpDel = pTmp; bGoNext = true; diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index b16b40122a26..898024771dba 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -137,7 +137,7 @@ bool SwCursorShell::SelTableRowOrCol( bool bRow, bool bRowSimple ) CurrShell aCurr( this ); - const SwTableBox* pStt = nullptr; + const SwTableBox* pStart = nullptr; const SwTableBox* pEnd = nullptr; // search box based on layout @@ -155,7 +155,7 @@ bool SwCursorShell::SelTableRowOrCol( bool bRow, bool bRowSimple ) if( aBoxes.empty() ) return false; - pStt = aBoxes[0]; + pStart = aBoxes[0]; pEnd = aBoxes.back(); } // #i32329# Enhanced table selection @@ -167,7 +167,7 @@ bool SwCursorShell::SelTableRowOrCol( bool bRow, bool bRowSimple ) if( aBoxes.empty() ) return false; - pStt = aBoxes[0]; + pStart = aBoxes[0]; pEnd = aBoxes.back(); m_eEnhancedTableSel = eSearchType; @@ -193,7 +193,7 @@ bool SwCursorShell::SelTableRowOrCol( bool bRow, bool bRowSimple ) const bool bVert = pFrame->ImplFindTabFrame()->IsVertical(); - // If we select upwards it is sufficient to set pStt and pEnd + // If we select upwards it is sufficient to set pStart and pEnd // to the first resp. last box of the selection obtained from // GetTableSel. However, selecting downwards requires the frames // located at the corners of the selection. This does not work @@ -210,13 +210,13 @@ bool SwCursorShell::SelTableRowOrCol( bool bRow, bool bRowSimple ) if ( bSelectUp ) { - pStt = aBoxes[0]; + pStart = aBoxes[0]; pEnd = aBoxes.back(); } else { // will become point of table cursor - pStt = aCells[bVert ? 0 : (bRow ? 2 : 1)]->GetTabBox(); + pStart = aCells[bVert ? 0 : (bRow ? 2 : 1)]->GetTabBox(); // will become mark of table cursor pEnd = aCells[bVert ? 3 : (bRow ? 1 : 2)]->GetTabBox(); } @@ -236,7 +236,7 @@ bool SwCursorShell::SelTableRowOrCol( bool bRow, bool bRowSimple ) m_pTableCursor->GetPoint()->Assign( *pEnd->GetSttNd()->EndOfSectionNode() ); m_pTableCursor->Move( fnMoveBackward, GoInContent ); m_pTableCursor->SetMark(); - m_pTableCursor->GetPoint()->Assign( *pStt->GetSttNd()->EndOfSectionNode() ); + m_pTableCursor->GetPoint()->Assign( *pStart->GetSttNd()->EndOfSectionNode() ); m_pTableCursor->Move( fnMoveBackward, GoInContent ); // set PtPos 'close' to the reference table, otherwise we might get problems diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 7df477784ba7..22d52654e612 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -374,13 +374,13 @@ namespace SwDoc& rDestDoc = rCpyPam.GetDoc(); SwPosition* pCpyStt = rCpyPam.Start(), *pCpyEnd = rCpyPam.End(); std::unique_ptr<SwPaM> pDelPam; - auto [pStt, pEnd] = rPam.StartEnd(); // SwPosition* + auto [pStart, pEnd] = rPam.StartEnd(); // SwPosition* // We have to count the "non-copied" nodes SwNodeOffset nDelCount; SwNodeIndex aCorrIdx(InitDelCount(rPam, nDelCount)); SwRedlineTable::size_type n = 0; - rSrcDoc.getIDocumentRedlineAccess().GetRedline( *pStt, &n ); + rSrcDoc.getIDocumentRedlineAccess().GetRedline( *pStart, &n ); for( ; n < rTable.size(); ++n ) { const SwRangeRedline* pRedl = rTable[ n ]; @@ -388,7 +388,7 @@ namespace { auto [pRStt, pREnd] = pRedl->StartEnd(); // SwPosition* - SwComparePosition eCmpPos = ComparePosition( *pStt, *pEnd, *pRStt, *pREnd ); + SwComparePosition eCmpPos = ComparePosition( *pStart, *pEnd, *pRStt, *pREnd ); switch( eCmpPos ) { case SwComparePosition::CollideEnd: @@ -405,10 +405,10 @@ namespace default: { pDelPam.reset(new SwPaM( *pCpyStt, pDelPam.release() )); - if( *pStt < *pRStt ) + if( *pStart < *pRStt ) { lcl_NonCopyCount( rPam, aCorrIdx, pRStt->GetNodeIndex(), nDelCount ); - lcl_SetCpyPos( *pRStt, *pStt, *pCpyStt, + lcl_SetCpyPos( *pRStt, *pStart, *pCpyStt, *pDelPam->GetPoint(), nDelCount ); } pDelPam->SetMark(); @@ -418,7 +418,7 @@ namespace else { lcl_NonCopyCount( rPam, aCorrIdx, pREnd->GetNodeIndex(), nDelCount ); - lcl_SetCpyPos( *pREnd, *pStt, *pCpyStt, + lcl_SetCpyPos( *pREnd, *pStart, *pCpyStt, *pDelPam->GetPoint(), nDelCount ); } @@ -517,15 +517,15 @@ namespace bool lcl_MarksWholeNode(const SwPaM & rPam) { bool bResult = false; - auto [pStt, pEnd] = rPam.StartEnd(); // SwPosition* + auto [pStart, pEnd] = rPam.StartEnd(); // SwPosition* - if (nullptr != pStt && nullptr != pEnd) + if (nullptr != pStart && nullptr != pEnd) { - const SwTextNode* pSttNd = pStt->GetNode().GetTextNode(); + const SwTextNode* pSttNd = pStart->GetNode().GetTextNode(); const SwTextNode* pEndNd = pEnd->GetNode().GetTextNode(); if (nullptr != pSttNd && nullptr != pEndNd && - pStt->GetContentIndex() == 0 && + pStart->GetContentIndex() == 0 && pEnd->GetContentIndex() == pEndNd->Len()) { bResult = true; @@ -727,11 +727,11 @@ namespace // the string doesn't exceed the allowed string length if( rPam.GetPoint()->GetNode() != rPam.GetMark()->GetNode() ) { - auto [pStt, pEnd] = rPam.StartEnd(); // SwPosition* + auto [pStart, pEnd] = rPam.StartEnd(); // SwPosition* const SwTextNode* pEndNd = pEnd->GetNode().GetTextNode(); - if( (nullptr != pEndNd) && pStt->GetNode().IsTextNode() ) + if( (nullptr != pEndNd) && pStart->GetNode().IsTextNode() ) { - const sal_uInt64 nSum = pStt->GetContentIndex() + + const sal_uInt64 nSum = pStart->GetContentIndex() + pEndNd->GetText().getLength() - pEnd->GetContentIndex(); return nSum > o3tl::make_unsigned(SAL_MAX_INT32); } @@ -751,10 +751,10 @@ namespace , nEnd(0) , nEndCnt(0) { - auto [pStt, pEnd] = pR->StartEnd(); // SwPosition* + auto [pStart, pEnd] = pR->StartEnd(); // SwPosition* SwNodeOffset nSttIdx = rSttIdx.GetIndex(); - nStt = pStt->GetNodeIndex() - nSttIdx; - nSttCnt = pStt->GetContentIndex(); + nStt = pStart->GetNodeIndex() - nSttIdx; + nSttCnt = pStart->GetContentIndex(); if( pR->HasMark() ) { nEnd = pEnd->GetNodeIndex() - nSttIdx; @@ -770,10 +770,10 @@ namespace , nEnd(0) , nEndCnt(0) { - auto [pStt, pEnd] = pR->StartEnd(); // SwPosition* + auto [pStart, pEnd] = pR->StartEnd(); // SwPosition* SwNodeOffset nSttIdx = rPos.GetNodeIndex(); - nStt = pStt->GetNodeIndex() - nSttIdx; - nSttCnt = pStt->GetContentIndex(); + nStt = pStart->GetNodeIndex() - nSttIdx; + nSttCnt = pStart->GetContentIndex(); if( nStt == SwNodeOffset(0) ) nSttCnt = nSttCnt - rPos.GetContentIndex(); if( pR->HasMark() ) @@ -1471,8 +1471,8 @@ namespace //local functions originally from docfmt.cxx SwHistory* pHistory = pUndo ? &pUndo->GetHistory() : nullptr; bool bRet = false; - const SwPosition *pStt = rRg.Start(), *pEnd = rRg.End(); - SwContentNode* pNode = pStt->GetNode().GetContentNode(); + const SwPosition *pStart = rRg.Start(), *pEnd = rRg.End(); + SwContentNode* pNode = pStart->GetNode().GetContentNode(); if( pNode && pNode->IsTextNode() ) { @@ -1489,7 +1489,7 @@ namespace //local functions originally from docfmt.cxx { if (pCurrentNode->GetSwAttrSet().HasItem(RES_PARATR_LIST_AUTOFMT) && // remove character formatting only on wholly selected paragraphs - (nStartIndex < pCurrentNode->GetIndex() || pStt->GetContentIndex() == 0) && + (nStartIndex < pCurrentNode->GetIndex() || pStart->GetContentIndex() == 0) && (pCurrentNode->GetIndex() < nEndIndex || pEnd->GetContentIndex() == pEndNode->Len())) { pCurrentNode->ResetAttr(RES_PARATR_LIST_AUTOFMT); @@ -1551,13 +1551,13 @@ namespace //local functions originally from docfmt.cxx { SwRegHistory history( pNode, *pNode, pHistory ); bRet = history.InsertItems( - aTextSet, pStt->GetContentIndex(), pStt->GetContentIndex(), nFlags, /*ppNewTextAttr*/nullptr ) || bRet; + aTextSet, pStart->GetContentIndex(), pStart->GetContentIndex(), nFlags, /*ppNewTextAttr*/nullptr ) || bRet; if (bRet && (rDoc.getIDocumentRedlineAccess().IsRedlineOn() || (!rDoc.getIDocumentRedlineAccess().IsIgnoreRedline() && !rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty()))) { - SwPaM aPam( pStt->GetNode(), pStt->GetContentIndex()-1, - pStt->GetNode(), pStt->GetContentIndex() ); + SwPaM aPam( pStart->GetNode(), pStart->GetContentIndex()-1, + pStart->GetNode(), pStart->GetContentIndex() ); if( pUndo ) pUndo->SaveRedlineData( aPam, true ); @@ -1584,8 +1584,8 @@ namespace //local functions originally from docfmt.cxx aTextSet.Put( rChgSet ); if( aTextSet.Count() ) { - const sal_Int32 nInsCnt = pStt->GetContentIndex(); - const sal_Int32 nEnd = pStt->GetNode() == pEnd->GetNode() + const sal_Int32 nInsCnt = pStart->GetContentIndex(); + const sal_Int32 nEnd = pStart->GetNode() == pEnd->GetNode() ? pEnd->GetContentIndex() : pNode->Len(); SwRegHistory history( pNode, *pNode, pHistory ); @@ -1596,10 +1596,10 @@ namespace //local functions originally from docfmt.cxx && !rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty()))) { // Was text content inserted? (RefMark/TOXMarks without an end) - bool bTextIns = nInsCnt != pStt->GetContentIndex(); + bool bTextIns = nInsCnt != pStart->GetContentIndex(); // Was content inserted or set over the selection? - SwPaM aPam( pStt->GetNode(), bTextIns ? nInsCnt + 1 : nEnd, - pStt->GetNode(), nInsCnt ); + SwPaM aPam( pStart->GetNode(), bTextIns ? nInsCnt + 1 : nEnd, + pStart->GetNode(), nInsCnt ); if( pUndo ) pUndo->SaveRedlineData( aPam, bTextIns ); @@ -1646,7 +1646,7 @@ namespace //local functions originally from docfmt.cxx SwContentNode * pFirstNode(pNode); if (pLayout && pLayout->HasMergedParas()) { - pFirstNode = sw::GetFirstAndLastNode(*pLayout, pStt->GetNode()).first; + pFirstNode = sw::GetFirstAndLastNode(*pLayout, pStart->GetNode()).first; } SwRegHistory aRegH( pFirstNode, *pFirstNode, pHistory ); bRet = pFirstNode->SetAttr( aNew ) || bRet; @@ -1734,12 +1734,12 @@ namespace //local functions originally from docfmt.cxx if( pNode->IsTextNode() && pCharSet && pCharSet->Count() ) { SwTextNode* pTextNd = pNode->GetTextNode(); - sal_Int32 nMkPos, nPtPos = pStt->GetContentIndex(); + sal_Int32 nMkPos, nPtPos = pStart->GetContentIndex(); const OUString& rStr = pTextNd->GetText(); // Special case: if the Cursor is located within a URL attribute, we take over it's area SwTextAttr const*const pURLAttr( - pTextNd->GetTextAttrAt(pStt->GetContentIndex(), RES_TXTATR_INETFMT)); + pTextNd->GetTextAttrAt(pStart->GetContentIndex(), RES_TXTATR_INETFMT)); if (pURLAttr && !pURLAttr->GetINetFormat().GetValue().isEmpty()) { nMkPos = pURLAttr->GetStart(); @@ -1760,7 +1760,7 @@ namespace //local functions originally from docfmt.cxx nPtPos = aBndry.endPos; } else - nPtPos = nMkPos = pStt->GetContentIndex(); + nPtPos = nMkPos = pStart->GetContentIndex(); } // Remove the overriding attributes from the SwpHintsArray, @@ -1833,17 +1833,17 @@ namespace //local functions originally from docfmt.cxx if( pNode ) { const sal_Int32 nLen = pNode->Len(); - if( pStt->GetNode() != pEnd->GetNode() ) + if( pStart->GetNode() != pEnd->GetNode() ) aCntEnd.Assign( pNode, nLen ); - if( pStt->GetContentIndex() != 0 || aCntEnd.GetIndex() != nLen ) + if( pStart->GetContentIndex() != 0 || aCntEnd.GetIndex() != nLen ) { // the SwRegHistory inserts the attribute into the TextNode! if( pNode->IsTextNode() && pCharSet && pCharSet->Count() ) { SwRegHistory history( pNode, *pNode, pHistory ); bRet = history.InsertItems(*pCharSet, - pStt->GetContentIndex(), aCntEnd.GetIndex(), nFlags, /*ppNewTextAttr*/nullptr) + pStart->GetContentIndex(), aCntEnd.GetIndex(), nFlags, /*ppNewTextAttr*/nullptr) || bRet; } @@ -1853,27 +1853,27 @@ namespace //local functions originally from docfmt.cxx } // Only selection in a Node. - if( pStt->GetNode() == pEnd->GetNode() ) + if( pStart->GetNode() == pEnd->GetNode() ) { DELETECHARSETS return bRet; } ++nNodes; - aSt.Assign( pStt->GetNode(), +1 ); + aSt.Assign( pStart->GetNode(), +1 ); } else - aSt = pStt->GetNode(); + aSt = pStart->GetNode(); aCntEnd.Assign(pEnd->GetContentNode(), pEnd->GetContentIndex()); // aEnd was changed! } else - aSt.Assign( pStt->GetNode(), +1 ); + aSt.Assign( pStart->GetNode(), +1 ); // aSt points to the first full Node now /* * The selection spans more than one Node. */ - if( pStt->GetNode() < pEnd->GetNode() ) + if( pStart->GetNode() < pEnd->GetNode() ) { pNode = pEnd->GetNode().GetContentNode(); if(pNode) @@ -1912,7 +1912,7 @@ namespace //local functions originally from docfmt.cxx if( pCharSet && pCharSet->Count() && !( SetAttrMode::DONTREPLACE & nFlags ) ) { ::sw::DocumentContentOperationsManager::ParaRstFormat aPara( - pStt, pEnd, pHistory, pCharSet, pLayout); + pStart, pEnd, pHistory, pCharSet, pLayout); rDoc.GetNodes().ForEach( aSt, aEnd, ::sw::DocumentContentOperationsManager::lcl_RstTextAttr, &aPara ); } @@ -2021,24 +2021,24 @@ bool DocumentContentOperationsManager::CopyRange(SwPaM& rPam, SwPosition& rPos, SwCopyFlags const flags, sal_uInt32 nMovedID) const { - const SwPosition *pStt = rPam.Start(), *pEnd = rPam.End(); + const SwPosition *pStart = rPam.Start(), *pEnd = rPam.End(); SwDoc& rDoc = rPos.GetNode().GetDoc(); bool bColumnSel = rDoc.IsClipBoard() && rDoc.IsColumnSelection(); // Catch if there's no copy to do - if (!rPam.HasMark() || (IsEmptyRange(*pStt, *pEnd, flags) && !bColumnSel)) + if (!rPam.HasMark() || (IsEmptyRange(*pStart, *pEnd, flags) && !bColumnSel)) return false; // Prevent copying into Flys that are anchored in the source range if (&rDoc == &m_rDoc && (flags & SwCopyFlags::CheckPosInFly)) { // Correct the Start-/EndNode - SwNodeOffset nStt = pStt->GetNodeIndex(), + SwNodeOffset nStt = pStart->GetNodeIndex(), nEnd = pEnd->GetNodeIndex(), nDiff = nEnd - nStt +1; SwNode* pNd = m_rDoc.GetNodes()[ nStt ]; - if( pNd->IsContentNode() && pStt->GetContentIndex() ) + if( pNd->IsContentNode() && pStart->GetContentIndex() ) { ++nStt; --nDiff; @@ -2069,9 +2069,9 @@ bool DocumentContentOperationsManager::CopyRange(SwPaM& rPam, SwPosition& rPos, { // ordinary copy bRet = CopyImpl(rPam, rPos, flags & ~SwCopyFlags::CheckPosInFly, pRedlineRange ? &*pRedlineRange : nullptr); } - else if( ! ( *pStt <= rPos && rPos < *pEnd && - ( pStt->GetNode() != pEnd->GetNode() || - !pStt->GetNode().IsTextNode() )) ) + else if( ! ( *pStart <= rPos && rPos < *pEnd && + ( pStart->GetNode() != pEnd->GetNode() || + !pStart->GetNode().IsTextNode() )) ) { // Copy to a position outside of the area, or copy a single TextNode // Do an ordinary copy @@ -2385,8 +2385,8 @@ bool DocumentContentOperationsManager::DeleteAndJoin(SwPaM & rPam, SwDeleteFlags bool DocumentContentOperationsManager::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags ) { // nothing moved: return - const SwPosition *pStt = rPaM.Start(), *pEnd = rPaM.End(); - if( !rPaM.HasMark() || *pStt >= *pEnd || (*pStt <= rPos && rPos < *pEnd)) + const SwPosition *pStart = rPaM.Start(), *pEnd = rPaM.End(); + if( !rPaM.HasMark() || *pStart >= *pEnd || (*pStart <= rPos && rPos < *pEnd)) return false; assert(!sw::mark::IsFieldmarkOverlap(rPaM)); // probably an invalid redline was created? @@ -2407,10 +2407,10 @@ bool DocumentContentOperationsManager::MoveRange( SwPaM& rPaM, SwPosition& rPos, // here without undo. ::sw::UndoGuard const undoGuard(m_rDoc.GetIDocumentUndoRedo()); DelBookmarks( - pStt->GetNode(), + pStart->GetNode(), pEnd->GetNode(), nullptr, - pStt->GetContentIndex(), + pStart->GetContentIndex(), pEnd->GetContentIndex()); } @@ -2426,9 +2426,9 @@ bool DocumentContentOperationsManager::MoveRange( SwPaM& rPaM, SwPosition& rPos, } else { - bUpdateFootnote = lcl_SaveFootnote( pStt->GetNode(), pEnd->GetNode(), rPos.GetNode(), + bUpdateFootnote = lcl_SaveFootnote( pStart->GetNode(), pEnd->GetNode(), rPos.GetNode(), m_rDoc.GetFootnoteIdxs(), aTmpFntIdx, - pStt->GetContentIndex(), pEnd->GetContentIndex() ); + pStart->GetContentIndex(), pEnd->GetContentIndex() ); } bool bSplit = false; @@ -2440,7 +2440,7 @@ bool DocumentContentOperationsManager::MoveRange( SwPaM& rPaM, SwPosition& rPos, // If there is a TextNode before and after the Move, create a JoinNext in the EditShell. SwTextNode* pSrcNd = rPaM.GetPoint()->GetNode().GetTextNode(); - bool bCorrSavePam = pSrcNd && pStt->GetNode() != pEnd->GetNode(); + bool bCorrSavePam = pSrcNd && pStart->GetNode() != pEnd->GetNode(); // If one or more TextNodes are moved, SwNodes::Move will do a SplitNode. // However, this does not update the cursor. So we create a TextNode to keep @@ -2519,10 +2519,10 @@ bool DocumentContentOperationsManager::MoveRange( SwPaM& rPaM, SwPosition& rPos, // that saves the position as an offset. std::vector< ::sw::mark::SaveBookmark> aSaveBkmks; DelBookmarks( - pStt->GetNode(), + pStart->GetNode(), pEnd->GetNode(), &aSaveBkmks, - pStt->GetContentIndex(), + pStart->GetContentIndex(), pEnd->GetContentIndex()); // If there is no range anymore due to the above deletions (e.g. the @@ -2990,14 +2990,14 @@ void DocumentContentOperationsManager::TransliterateText( if (m_rDoc.GetIDocumentUndoRedo().DoesUndo()) pUndo.reset(new SwUndoTransliterate( rPaM, rTrans )); - auto [pStt, pEnd] = rPaM.StartEnd(); // SwPosition* - SwNodeOffset nSttNd = pStt->GetNodeIndex(), + auto [pStart, pEnd] = rPaM.StartEnd(); // SwPosition* + SwNodeOffset nSttNd = pStart->GetNodeIndex(), nEndNd = pEnd->GetNodeIndex(); - sal_Int32 nSttCnt = pStt->GetContentIndex(); + sal_Int32 nSttCnt = pStart->GetContentIndex(); sal_Int32 nEndCnt = pEnd->GetContentIndex(); - SwTextNode* pTNd = pStt->GetNode().GetTextNode(); - bool bNoSelection = (pStt == pEnd) && pTNd; // no selection? + SwTextNode* pTNd = pStart->GetNode().GetTextNode(); + bool bNoSelection = (pStart == pEnd) && pTNd; // no selection? if ( bNoSelection ) { /* Check if cursor is inside of a word */ @@ -3030,9 +3030,9 @@ void DocumentContentOperationsManager::TransliterateText( /* Recognize and reject the previous deleted and inserted words to allow to cycle */ IDocumentRedlineAccess& rIDRA = m_rDoc.getIDocumentRedlineAccess(); if ( IDocumentRedlineAccess::IsShowChanges( rIDRA.GetRedlineFlags() ) && - pStt->GetContentIndex() > 0 ) + pStart->GetContentIndex() > 0 ) { - SwPosition aPos(*pStt->GetContentNode(), pStt->GetContentIndex() - 1); + SwPosition aPos(*pStart->GetContentNode(), pStart->GetContentIndex() - 1); SwRedlineTable::size_type n = 0; const SwRangeRedline* pFnd = @@ -3078,7 +3078,7 @@ void DocumentContentOperationsManager::TransliterateText( if ( *pRedline->Start() > *pEnd ) break; - if ( *pRedline->Start() >= *pStt ) + if ( *pRedline->Start() >= *pStart ) n = m; } @@ -3100,8 +3100,8 @@ void DocumentContentOperationsManager::TransliterateText( // not only the changes from the same author within the (sometimes // incomplete) selection ( pFnd2->GetTimeStamp() == pFnd->GetTimeStamp() || - ( pStt->GetContentNode() < pFnd2->Start()->GetContentNode() || - ( pStt->GetContentNode() == pFnd2->Start()->GetContentNode() && + ( pStart->GetContentNode() < pFnd2->Start()->GetContentNode() || + ( pStart->GetContentNode() == pFnd2->Start()->GetContentNode() && nSttCnt <= pFnd2->Start()->GetContentIndex() ) ) ) && pFnd->GetAuthor() == pFnd2->GetAuthor() ) { @@ -3148,7 +3148,7 @@ void DocumentContentOperationsManager::TransliterateText( const bool bIsTitleCase = rTrans.getType() == TransliterationFlags::TITLE_CASE; sal_uLong nAffectedNodes = 0; sal_uLong nAffectedChars = nEndCnt; - SwNodeIndex aIdx( pStt->GetNode() ); + SwNodeIndex aIdx( pStart->GetNode() ); for( ; aIdx.GetIndex() <= nEndNd; ++aIdx ) { SwTextNode* pAffectedNode = aIdx.GetNode().GetTextNode(); @@ -3182,7 +3182,7 @@ void DocumentContentOperationsManager::TransliterateText( // iterate over all affected text nodes, the first and the last one // may be incomplete because the selection starts and/or ends there - SwNodeIndex aIdx( pStt->GetNode() ); + SwNodeIndex aIdx( pStart->GetNode() ); if( nSttCnt ) { ++aIdx; @@ -3224,7 +3224,7 @@ void DocumentContentOperationsManager::TransliterateText( m_rDoc.getIDocumentLayoutAccess().GetCurrentViewShell()) ) { *pWrtShell->GetCursor()->GetMark() = *pWrtShell->GetCursor()->End(); - pWrtShell->GetCursor()->GetPoint()->Assign(*pStt->GetContentNode(), nSttCnt); + pWrtShell->GetCursor()->GetPoint()->Assign(*pStart->GetContentNode(), nSttCnt); } } @@ -4506,10 +4506,10 @@ bool DocumentContentOperationsManager::DeleteRangeImpl(SwPaM & rPam, SwDeleteFla bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam, SwDeleteFlags const flags) { - auto [pStt, pEnd] = rPam.StartEnd(); // SwPosition* + auto [pStart, pEnd] = rPam.StartEnd(); // SwPosition* if (!rPam.HasMark() - || (*pStt == *pEnd && !IsFlySelectedByCursor(m_rDoc, *pStt, *pEnd))) + || (*pStart == *pEnd && !IsFlySelectedByCursor(m_rDoc, *pStart, *pEnd))) { return false; } @@ -4517,9 +4517,9 @@ bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam, SwDelet if( m_rDoc.GetAutoCorrExceptWord() ) { // if necessary the saved Word for the exception - if( m_rDoc.GetAutoCorrExceptWord()->IsDeleted() || pStt->GetNode() != pEnd->GetNode() || - pStt->GetContentIndex() + 1 != pEnd->GetContentIndex() || - !m_rDoc.GetAutoCorrExceptWord()->CheckDelChar( *pStt )) + if( m_rDoc.GetAutoCorrExceptWord()->IsDeleted() || pStart->GetNode() != pEnd->GetNode() || + pStart->GetContentIndex() + 1 != pEnd->GetContentIndex() || + !m_rDoc.GetAutoCorrExceptWord()->CheckDelChar( *pStart )) { m_rDoc.DeleteAutoCorrExceptWord(); } } @@ -4587,14 +4587,14 @@ bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam, SwDelet rPam.GetMark()->GetContentIndex(), rPam.GetPoint()->GetContentIndex()); } DelBookmarks( - pStt->GetNode(), + pStart->GetNode(), pEnd->GetNode(), nullptr, - pStt->GetContentIndex(), + pStart->GetContentIndex(), pEnd->GetContentIndex(), bool(flags & SwDeleteFlags::ArtificialSelection)); - SwNodeIndex aSttIdx( pStt->GetNode() ); + SwNodeIndex aSttIdx( pStart->GetNode() ); SwContentNode * pCNd = aSttIdx.GetNode().GetContentNode(); do { // middle checked loop! @@ -4604,15 +4604,15 @@ bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam, SwDelet if ( pStartTextNode ) { // now move the Content to the new Node - bool bOneNd = pStt->GetNode() == pEnd->GetNode(); + bool bOneNd = pStart->GetNode() == pEnd->GetNode(); const sal_Int32 nLen = ( bOneNd ? pEnd->GetContentIndex() : pCNd->Len() ) - - pStt->GetContentIndex(); + - pStart->GetContentIndex(); // Don't call again, if already empty if( nLen ) { - pStartTextNode->EraseText( *pStt, nLen ); + pStartTextNode->EraseText( *pStart, nLen ); if( !pStartTextNode->Len() ) { @@ -4630,7 +4630,7 @@ bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam, SwDelet { // So that there are no indices left registered when deleted, // we remove a SwPaM from the Content here. - pStt->nContent.Assign( nullptr, 0 ); + pStart->nContent.Assign( nullptr, 0 ); } } @@ -4687,13 +4687,13 @@ bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam, SwDelet // If the Node that contained the Cursor has been deleted, // the Content has to be assigned to the current Content. - if (pStt->GetNode().GetContentNode()) - pStt->SetContent( pStt->GetContentIndex() ); + if (pStart->GetNode().GetContentNode()) + pStart->SetContent( pStart->GetContentIndex() ); // If we deleted across Node boundaries we have to correct the PaM, // because they are in different Nodes now. // Also, the Selection is revoked. - *pEnd = *pStt; + *pEnd = *pStart; rPam.DeleteMark(); } while( false ); @@ -4721,13 +4721,13 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt SwPaM aDelPam( *rPam.GetMark(), *rPam.GetPoint() ); ::PaMCorrAbs( aDelPam, *aDelPam.End() ); - auto [pStt, pEnd] = aDelPam.StartEnd(); // SwPosition* - bool bOneNode = pStt->GetNode() == pEnd->GetNode(); + auto [pStart, pEnd] = aDelPam.StartEnd(); // SwPosition* + bool bOneNode = pStart->GetNode() == pEnd->GetNode(); // Own Undo? OUString sRepl( rStr ); - SwTextNode* pTextNd = pStt->GetNode().GetTextNode(); - sal_Int32 nStt = pStt->GetContentIndex(); + SwTextNode* pTextNd = pStart->GetNode().GetTextNode(); + sal_Int32 nStt = pStart->GetContentIndex(); sal_Int32 nEnd; SwDataChanged aTmp( aDelPam ); @@ -4756,9 +4756,9 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt if(pBkmk->IsExpanded()) *aDelPam.GetMark() = pBkmk->GetOtherMarkPos(); m_rDoc.getIDocumentMarkAccess()->deleteMark(pBkmk); - pStt = aDelPam.Start(); - pTextNd = pStt->GetNode().GetTextNode(); - nStt = pStt->GetContentIndex(); + pStart = aDelPam.Start(); + pTextNd = pStart->GetNode().GetTextNode(); + nStt = pStart->GetContentIndex(); } if( !sRepl.isEmpty() ) @@ -4866,8 +4866,8 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt } else { - assert((pStt->GetNode() == pEnd->GetNode() || - ( pStt->GetNodeIndex() + 1 == pEnd->GetNodeIndex() && + assert((pStart->GetNode() == pEnd->GetNode() || + ( pStart->GetNodeIndex() + 1 == pEnd->GetNodeIndex() && !pEnd->GetContentIndex() )) && "invalid range: Point and Mark on different nodes" ); @@ -4883,11 +4883,11 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt } ::sw::UndoGuard const undoGuard(m_rDoc.GetIDocumentUndoRedo()); - if( aDelPam.GetPoint() != pStt ) + if( aDelPam.GetPoint() != pStart ) aDelPam.Exchange(); - SwNodeIndex aPtNd( pStt->GetNode(), -1 ); - const sal_Int32 nPtCnt = pStt->GetContentIndex(); + SwNodeIndex aPtNd( pStart->GetNode(), -1 ); + const sal_Int32 nPtCnt = pStart->GetContentIndex(); // Set the values again, if Frames or footnotes on the Text have been removed. nStt = nPtCnt; @@ -4904,9 +4904,9 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt } else if( nStt < nEnd || !sIns.isEmpty() ) { - pTextNd->ReplaceText( *pStt, nEnd - nStt, sIns ); + pTextNd->ReplaceText( *pStart, nEnd - nStt, sIns ); } - SplitNode( *pStt, false); + SplitNode( *pStart, false); bFirst = false; } @@ -4918,7 +4918,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt } else if( nStt < nEnd || !sIns.isEmpty() ) { - pTextNd->ReplaceText( *pStt, nEnd - nStt, sIns ); + pTextNd->ReplaceText( *pStart, nEnd - nStt, sIns ); } } @@ -4932,7 +4932,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt // move so that SetEnd remembers position after sw_JoinText rPam.Move(fnMoveBackward); } - else if (aDelPam.GetPoint() == pStt) // backward selection? + else if (aDelPam.GetPoint() == pStart) // backward selection? { assert(*rPam.GetMark() <= *rPam.GetPoint()); rPam.Exchange(); // swap so that rPam is backwards @@ -5106,13 +5106,13 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo SwDoc& rDoc = rPos.GetNode().GetDoc(); const bool bColumnSel = rDoc.IsClipBoard() && rDoc.IsColumnSelection(); - auto [pStt, pEnd] = rPam.StartEnd(); // SwPosition* + auto [pStart, pEnd] = rPam.StartEnd(); // SwPosition* // Catch when there's no copy to do. - if (!rPam.HasMark() || (IsEmptyRange(*pStt, *pEnd, flags) && !bColumnSel) || + if (!rPam.HasMark() || (IsEmptyRange(*pStart, *pEnd, flags) && !bColumnSel) || //JP 29.6.2001: 88963 - don't copy if inspos is in region of start to end //JP 15.11.2001: don't test inclusive the end, ever exclusive - ( &rDoc == &m_rDoc && *pStt <= rPos && rPos < *pEnd )) + ( &rDoc == &m_rDoc && *pStart <= rPos && rPos < *pEnd )) { return false; } @@ -5151,7 +5151,7 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo // Note this doesn't just check IsStartNode() because SwDoc::AppendDoc() // intentionally sets it to the body start node, perhaps it should just // call SplitNode instead? - if (!pStt->GetNode().IsSectionNode() && !pStt->GetNode().IsTableNode()) + if (!pStart->GetNode().IsSectionNode() && !pStart->GetNode().IsTableNode()) { bCanMoveBack = pCopyPam->Move(fnMoveBackward, GoInContent); } @@ -5161,11 +5161,11 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo assert(pCopyPam->GetPoint()->GetContentIndex() == 0); } - SwNodeRange aRg( pStt->GetNode(), pEnd->GetNode() ); + SwNodeRange aRg( pStart->GetNode(), pEnd->GetNode() ); SwNodeIndex aInsPos( rPos.GetNode() ); ::std::optional<SwContentIndex> oInsContentIndex; - const bool bOneNode = pStt->GetNode() == pEnd->GetNode(); - SwTextNode* pSttTextNd = pStt->GetNode().GetTextNode(); + const bool bOneNode = pStart->GetNode() == pEnd->GetNode(); + SwTextNode* pSttTextNd = pStart->GetNode().GetTextNode(); SwTextNode* pEndTextNd = pEnd->GetNode().GetTextNode(); SwTextNode* pDestTextNd = aInsPos.GetNode().GetTextNode(); bool bCopyCollFormat = !rDoc.IsInsOnlyTextGlossary() && @@ -5221,13 +5221,13 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo { ++nDeleteTextNodes; // must be joined in Undo // Don't copy the beginning completely? - if( !bCopyCollFormat || bColumnSel || pStt->GetContentIndex() ) + if( !bCopyCollFormat || bColumnSel || pStart->GetContentIndex() ) { SwContentIndex aDestIdx( rPos.GetContentNode(), rPos.GetContentIndex() ); bool bCopyOk = false; if( !pDestTextNd ) { - if( pStt->GetContentIndex() || bOneNode ) + if( pStart->GetContentIndex() || bOneNode ) pDestTextNd = rDoc.GetNodes().MakeTextNode( aInsPos.GetNode(), rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD)); else @@ -5284,8 +5284,8 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo const sal_Int32 nCpyLen = ( bOneNode ? pEnd->GetContentIndex() : pSttTextNd->GetText().getLength()) - - pStt->GetContentIndex(); - pSttTextNd->CopyText( pDestTextNd, aDestIdx, *pStt, nCpyLen ); + - pStart->GetContentIndex(); + pSttTextNd->CopyText( pDestTextNd, aDestIdx, *pStart, nCpyLen ); if( bEndEqualIns ) pEnd->AdjustContent( -nCpyLen ); } @@ -5415,7 +5415,7 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo if( aInsPos == pEnd->GetNode() ) { SwNodeIndex aSaveIdx( aInsPos, -1 ); - assert(pStt->GetNode() != pEnd->GetNode()); + assert(pStart->GetNode() != pEnd->GetNode()); pEnd->SetContent(0); // TODO why this? CopyWithFlyInFly(aRg, aInsPos.GetNode(), &tmp, /*bMakeNewFrames*/true, false, /*bCopyFlyAtFly=*/false, flags); ++aSaveIdx; @@ -5510,7 +5510,7 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo // tdf#39400 and tdf#97526 // when copy from document to ClipBoard, and it is from the first page // and not the source has the page break - if (rDoc.IsClipBoard() && (rPam.GetPageNum(pStt == rPam.GetPoint()) == 1) && !bCopyPageSource) + if (rDoc.IsClipBoard() && (rPam.GetPageNum(pStart == rPam.GetPoint()) == 1) && !bCopyPageSource) { if (pDestTextNd) { diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 7a15b19c47c1..90c11ed7f9a9 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -957,8 +957,8 @@ namespace { // handle paragraph formatting changes // (range is only a full paragraph or a part of it) - const SwPosition* pStt = pRedl->Start(); - SwTextNode* pTNd = pStt->GetNode().GetTextNode(); + const SwPosition* pStart = pRedl->Start(); + SwTextNode* pTNd = pStart->GetNode().GetTextNode(); if( pTNd ) { // expand range to the whole paragraph @@ -1023,14 +1023,14 @@ namespace SwRedlineTable::size_type n = 0; int nCount = 0; - const SwPosition* pStt = rPam.Start(), + const SwPosition* pStart = rPam.Start(), * pEnd = rPam.End(); - const SwRangeRedline* pFnd = rArr.FindAtPosition( *pStt, n ); + const SwRangeRedline* pFnd = rArr.FindAtPosition( *pStart, n ); if( pFnd && // Is new a part of it? - ( *pFnd->Start() != *pStt || *pFnd->End() > *pEnd )) + ( *pFnd->Start() != *pStart || *pFnd->End() > *pEnd )) { // Only revoke the partial selection - if( (*fn_AcceptReject)( rArr, n, bCallDelete, pStt, pEnd )) + if( (*fn_AcceptReject)( rArr, n, bCallDelete, pStart, pEnd )) nCount++; ++n; } @@ -1060,7 +1060,7 @@ namespace { // Only revoke the partial selection if( (m > 0 || RedlineType::ParagraphFormat == pTmp->GetType()) && - (*fn_AcceptReject)( rArr, o, bCallDelete, pStt, pEnd )) + (*fn_AcceptReject)( rArr, o, bCallDelete, pStart, pEnd )) { bHasParagraphFormatChange = true; nCount++; @@ -1079,18 +1079,18 @@ namespace // The Selection is only in the ContentSection. If there are Redlines // to Non-ContentNodes before or after that, then the Selections // expand to them. - auto [pStt, pEnd] = rPam.StartEnd(); // SwPosition* + auto [pStart, pEnd] = rPam.StartEnd(); // SwPosition* SwDoc& rDoc = rPam.GetDoc(); - if( !pStt->GetContentIndex() && - !rDoc.GetNodes()[ pStt->GetNodeIndex() - 1 ]->IsContentNode() ) + if( !pStart->GetContentIndex() && + !rDoc.GetNodes()[ pStart->GetNodeIndex() - 1 ]->IsContentNode() ) { - const SwRangeRedline* pRedl = rDoc.getIDocumentRedlineAccess().GetRedline( *pStt, nullptr ); + const SwRangeRedline* pRedl = rDoc.getIDocumentRedlineAccess().GetRedline( *pStart, nullptr ); if( pRedl ) { const SwPosition* pRStt = pRedl->Start(); if( !pRStt->GetContentIndex() && pRStt->GetNodeIndex() == - pStt->GetNodeIndex() - 1 ) - *pStt = *pRStt; + pStart->GetNodeIndex() - 1 ) + *pStart = *pRStt; } } if( pEnd->GetNode().IsContentNode() && @@ -1353,23 +1353,23 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } } - auto [pStt, pEnd] = pNewRedl->StartEnd(); // SwPosition* + auto [pStart, pEnd] = pNewRedl->StartEnd(); // SwPosition* { - SwTextNode* pTextNode = pStt->GetNode().GetTextNode(); + SwTextNode* pTextNode = pStart->GetNode().GetTextNode(); if( pTextNode == nullptr ) { - if( pStt->GetContentIndex() > 0 ) + if( pStart->GetContentIndex() > 0 ) { OSL_ENSURE( false, "Redline start: non-text-node with content" ); - pStt->SetContent( 0 ); + pStart->SetContent( 0 ); } } else { - if( pStt->GetContentIndex() > pTextNode->Len() ) + if( pStart->GetContentIndex() > pTextNode->Len() ) { OSL_ENSURE( false, "Redline start: index after text" ); - pStt->SetContent( pTextNode->Len() ); + pStart->SetContent( pTextNode->Len() ); } } pTextNode = pEnd->GetNode().GetTextNode(); @@ -1390,7 +1390,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } } } - if( ( *pStt == *pEnd ) && + if( ( *pStart == *pEnd ) && ( pNewRedl->GetContentIdx() == nullptr ) ) { // Do not insert empty redlines delete pNewRedl; @@ -1399,7 +1399,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall bool bCompress = false; SwRedlineTable::size_type n = 0; // look up the first Redline for the starting position - if( !GetRedline( *pStt, &n ) && n > 0 ) + if( !GetRedline( *pStart, &n ) && n > 0 ) --n; const SwRedlineTable::size_type nStartPos = n; bool bDec = false; @@ -1419,7 +1419,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall continue; } - SwComparePosition eCmpPos = ComparePosition( *pStt, *pEnd, *pRStt, *pREnd ); + SwComparePosition eCmpPos = ComparePosition( *pStart, *pEnd, *pRStt, *pREnd ); if ( SwComparePosition::Before == eCmpPos && !IsPrevPos( *pEnd, *pRStt )) break; @@ -1439,7 +1439,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall // Merge if applicable? if( (( SwComparePosition::Behind == eCmpPos && - IsPrevPos( *pREnd, *pStt ) ) || + IsPrevPos( *pREnd, *pStart ) ) || ( SwComparePosition::CollideStart == eCmpPos ) || ( SwComparePosition::OverlapBehind == eCmpPos ) ) && pRedl->CanCombine( *pNewRedl ) && @@ -1466,7 +1466,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall ( !n || *maRedlineTable[ n-1 ]->End() != *pRStt )) { - pRedl->SetStart( *pStt, pRStt ); + pRedl->SetStart( *pStart, pRStt ); // re-insert maRedlineTable.Remove( n ); maRedlineTable.Insert( pRedl ); @@ -1483,15 +1483,15 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } else if( SwComparePosition::OverlapBehind == eCmpPos ) { - *pStt = *pREnd; - if( ( *pStt == *pEnd ) && + *pStart = *pREnd; + if( ( *pStart == *pEnd ) && ( pNewRedl->GetContentIdx() == nullptr ) ) bDelete = bMaybeNotify = true; } else if( SwComparePosition::OverlapBefore == eCmpPos ) { *pEnd = *pRStt; - if( ( *pStt == *pEnd ) && + if( ( *pStart == *pEnd ) && ( pNewRedl->GetContentIdx() == nullptr ) ) bDelete = bMaybeNotify = true; } @@ -1526,8 +1526,8 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall pCpy->SetStart( *pEnd ); maRedlineTable.Insert( pCpy ); } - pRedl->SetEnd( *pStt, pREnd ); - if( ( *pStt == *pRStt ) && + pRedl->SetEnd( *pStart, pREnd ); + if( ( *pStart == *pRStt ) && ( pRedl->GetContentIdx() == nullptr ) ) { maRedlineTable.DeleteAndDestroy( n ); @@ -1551,7 +1551,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall pSplit->SetEnd( *pRStt ); pNewRedl->SetStart( *pREnd ); maRedlineTable.Insert( pSplit ); - if( *pStt == *pEnd && pNewRedl->GetContentIdx() == nullptr ) + if( *pStart == *pEnd && pNewRedl->GetContentIdx() == nullptr ) { delete pNewRedl; pNewRedl = nullptr; @@ -1567,7 +1567,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall { // handle overlapping redlines in broken documents *pEnd = *pRStt; - if( ( *pStt == *pEnd ) && + if( ( *pStart == *pEnd ) && ( pNewRedl->GetContentIdx() == nullptr ) ) { delete pNewRedl; @@ -1588,8 +1588,8 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall pCpy->SetStart( *pEnd ); maRedlineTable.Insert( pCpy ); } - pRedl->SetEnd( *pStt, pREnd ); - if( ( *pStt == *pRStt ) && + pRedl->SetEnd( *pStart, pREnd ); + if( ( *pStart == *pRStt ) && ( pRedl->GetContentIdx() == nullptr ) ) { maRedlineTable.DeleteAndDestroy( n ); @@ -1613,7 +1613,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall pSplit->SetEnd( *pRStt ); pNewRedl->SetStart( *pREnd ); maRedlineTable.Insert( pSplit ); - if( *pStt == *pEnd && pNewRedl->GetContentIdx() == nullptr ) + if( *pStart == *pEnd && pNewRedl->GetContentIdx() == nullptr ) { delete pNewRedl; pNewRedl = nullptr; @@ -1644,8 +1644,8 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall break; case SwComparePosition::OverlapBehind: - pRedl->SetEnd( *pStt, pREnd ); - if( *pStt == *pRStt && pRedl->GetContentIdx() == nullptr ) + pRedl->SetEnd( *pStart, pREnd ); + if( *pStart == *pRStt && pRedl->GetContentIdx() == nullptr ) { maRedlineTable.DeleteAndDestroy( n ); bDec = true; @@ -1669,8 +1669,8 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall { SwRangeRedline* pNew = new SwRangeRedline( *pRedl ); pNew->SetStart( *pEnd ); - pRedl->SetEnd( *pStt, pREnd ); - if( *pStt == *pRStt && pRedl->GetContentIdx() == nullptr ) + pRedl->SetEnd( *pStart, pREnd ); + if( *pStart == *pRStt && pRedl->GetContentIdx() == nullptr ) maRedlineTable.DeleteAndDestroy( n ); AppendRedline( pNew, bCallDelete ); n = 0; // re-initialize @@ -1678,7 +1678,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } } else - pRedl->SetEnd( *pStt, pREnd ); + pRedl->SetEnd( *pStart, pREnd ); break; default: break; @@ -1703,9 +1703,9 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall { pNewRedl->SetEnd(*pRStt, pEnd); } - else if (*pStt == *pRStt) + else if (*pStart == *pRStt) { - pNewRedl->SetStart(*pREnd, pStt); + pNewRedl->SetStart(*pREnd, pStart); } else { @@ -1736,14 +1736,14 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall // If that's the case we can merge it, meaning // the new one covers this well if( SwComparePosition::OverlapBehind == eCmpPos ) - pNewRedl->SetStart( *pRStt, pStt ); + pNewRedl->SetStart( *pRStt, pStart ); else pNewRedl->SetEnd( *pREnd, pEnd ); maRedlineTable.DeleteAndDestroy( n ); bDec = true; } else if( SwComparePosition::OverlapBehind == eCmpPos ) - pNewRedl->SetStart( *pREnd, pStt ); + pNewRedl->SetStart( *pREnd, pStart ); else pNewRedl->SetEnd( *pRStt, pEnd ); break; @@ -1774,7 +1774,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall // If that's the case we can merge it, meaning // the new one covers this well if( SwComparePosition::CollideStart == eCmpPos ) - pNewRedl->SetStart( *pRStt, pStt ); + pNewRedl->SetStart( *pRStt, pStart ); else pNewRedl->SetEnd( *pREnd, pEnd ); @@ -1845,7 +1845,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall // For this case, we completely delete the // paragraphs (if, of course, we also start on // a paragraph boundary). - if( (pStt->GetContentIndex() == 0) && + if( (pStart->GetContentIndex() == 0) && pEnd->GetNode().IsEndNode() ) { pEnd->Adjust(SwNodeOffset(-1)); @@ -1903,15 +1903,15 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall case SwComparePosition::OverlapBehind: { - SwPaM aPam( *pStt, *pREnd ); + SwPaM aPam( *pStart, *pREnd ); - if( *pStt == *pRStt ) + if( *pStart == *pRStt ) { maRedlineTable.DeleteAndDestroy( n ); bDec = true; } else - pRedl->SetEnd( *pStt, pREnd ); + pRedl->SetEnd( *pStart, pREnd ); if( bCallDelete ) { @@ -1959,11 +1959,11 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall case SwComparePosition::Inside: { - if( *pRStt == *pStt ) + if( *pRStt == *pStart ) { // #i97421# // redline w/out extent loops - if (*pStt != *pEnd) + if (*pStart != *pEnd) { pNewRedl->PushData( *pRedl, false ); pRedl->SetStart( *pEnd, pRStt ); @@ -1981,7 +1981,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall pNew = new SwRangeRedline( *pRedl ); pNew->SetStart( *pEnd ); } - pRedl->SetEnd( *pStt, pREnd ); + pRedl->SetEnd( *pStart, pREnd ); if( !pRedl->HasValidRange() ) { // re-insert @@ -1999,15 +1999,15 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall { pNewRedl->SetEnd( *pRStt, pEnd ); } - else if (*pStt == *pRStt) + else if (*pStart == *pRStt) { - pNewRedl->SetStart(*pREnd, pStt); + pNewRedl->SetStart(*pREnd, pStart); } else { pNew = new SwRangeRedline( *pNewRedl ); pNew->SetEnd( *pRStt ); - pNewRedl->SetStart( *pREnd, pStt ); + pNewRedl->SetStart( *pREnd, pStart ); } bCompress = true; } @@ -2043,10 +2043,10 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall case SwComparePosition::OverlapBehind: { - if( *pStt == *pRStt ) + if( *pStart == *pRStt ) { pRedl->PushData( *pNewRedl ); - pNewRedl->SetStart( *pREnd, pStt ); + pNewRedl->SetStart( *pREnd, pStart ); if( IsHideChanges( meRedlineFlags )) { maRedlineTable.Insert( pNewRedl ); @@ -2058,8 +2058,8 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall { pNew = new SwRangeRedline( *pRedl ); pNew->PushData( *pNewRedl ); - pNew->SetStart( *pStt ); - pNewRedl->SetStart( *pREnd, pStt ); + pNew->SetStart( *pStart ); + pNewRedl->SetStart( *pREnd, pStart ); pRedl->SetEnd( *pNew->Start(), pREnd ); if( !pRedl->HasValidRange() ) { @@ -2104,7 +2104,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall break; case SwComparePosition::OverlapBehind: - pRedl->SetEnd( *pStt, pREnd ); + pRedl->SetEnd( *pStart, pREnd ); break; case SwComparePosition::Equal: @@ -2124,8 +2124,8 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall { SwRangeRedline* pNew = new SwRangeRedline( *pRedl ); pNew->SetStart( *pEnd ); - pRedl->SetEnd( *pStt, pREnd ); - if( ( *pStt == *pRStt ) && + pRedl->SetEnd( *pStart, pREnd ); + if( ( *pStart == *pRStt ) && ( pRedl->GetContentIdx() == nullptr ) ) maRedlineTable.DeleteAndDestroy( n ); AppendRedline( pNew, bCallDelete ); @@ -2134,7 +2134,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } } else - pRedl->SetEnd( *pStt, pREnd ); + pRedl->SetEnd( *pStart, pREnd ); break; default: break; @@ -2157,7 +2157,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall break; case SwComparePosition::OverlapBehind: - pNewRedl->SetStart( *pREnd, pStt ); + pNewRedl->SetStart( *pREnd, pStart ); break; case SwComparePosition::Equal: @@ -2175,9 +2175,9 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall { pNewRedl->SetEnd(*pRStt, pEnd); } - else if (*pStt == *pRStt) + else if (*pStart == *pRStt) { - pNewRedl->SetStart(*pREnd, pStt); + pNewRedl->SetStart(*pREnd, pStart); } else { @@ -2218,8 +2218,8 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } else if( *pREnd == *pEnd ) // or else only shorten the current one - pRedl->SetEnd( *pStt, pREnd ); - else if( *pRStt == *pStt ) + pRedl->SetEnd( *pStart, pREnd ); + else if( *pRStt == *pStart ) { // or else only shorten the current one pRedl->SetStart( *pEnd, pRStt ); @@ -2234,7 +2234,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall // we need to split it SwRangeRedline* pNew = new SwRangeRedline( *pRedl ); pNew->SetStart( *pEnd ); - pRedl->SetEnd( *pStt, pREnd ); + pRedl->SetEnd( *pStart, pREnd ); AppendRedline( pNew, bCallDelete ); n = 0; // re-initialize bDec = true; @@ -2249,14 +2249,14 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall // If that's the case we can merge it, meaning // the new one covers this well if( SwComparePosition::OverlapBehind == eCmpPos ) - pNewRedl->SetStart( *pRStt, pStt ); + pNewRedl->SetStart( *pRStt, pStart ); else pNewRedl->SetEnd( *pREnd, pEnd ); maRedlineTable.DeleteAndDestroy( n ); bDec = false; } else if( SwComparePosition::OverlapBehind == eCmpPos ) - pNewRedl->SetStart( *pREnd, pStt ); + pNewRedl->SetStart( *pREnd, pStart ); else pNewRedl->SetEnd( *pRStt, pEnd ); break; @@ -2264,7 +2264,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall case SwComparePosition::CollideEnd: if( pRedl->IsOwnRedline( *pNewRedl ) && pRedl->CanCombine( *pNewRedl ) && - (n == 0 || *maRedlineTable[ n-1 ]->End() < *pStt)) + (n == 0 || *maRedlineTable[ n-1 ]->End() < *pStart)) { // If that's the case we can merge it, meaning // the new one covers this well @@ -2282,7 +2282,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall { // If that's the case we can merge it, meaning // the new one covers this well - pNewRedl->SetStart( *pRStt, pStt ); + pNewRedl->SetStart( *pRStt, pStart ); maRedlineTable.DeleteAndDestroy( n ); bDec = true; } @@ -2307,7 +2307,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall if( pNewRedl ) { - if( ( *pStt == *pEnd ) && + if( ( *pStart == *pEnd ) && ( pNewRedl->GetContentIdx() == nullptr ) ) { // Do not insert empty redlines delete pNewRedl; @@ -2317,7 +2317,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall { if ( bCallDelete && RedlineType::Delete == pNewRedl->GetType() ) { - if ( pStt->GetContentIndex() != 0 ) + if ( pStart->GetContentIndex() != 0 ) { // tdf#119571 update the style of the joined paragraph // after a partially deleted paragraph to show its correct style @@ -2326,7 +2326,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall // to avoid text insertion with bad style in the deleted // area later (except paragraphs of the removed tables). - SwContentNode* pDelNd = pStt->GetNode().GetContentNode(); + SwContentNode* pDelNd = pStart->GetNode().GetContentNode(); // start copying the style of the first paragraph from the end of the range SwContentNode* pTextNd = pEnd->GetNode().GetContentNode(); SwNodeIndex aIdx( pEnd->GetNode() ); @@ -2348,7 +2348,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall pNewRedl->SetEnd( aPos ); // get extradata for reset formatting of the modified paragraph - std::unique_ptr<SwRedlineExtraData_FormatColl> pExtraData = lcl_CopyStyle(aPos, *pStt, false); + std::unique_ptr<SwRedlineExtraData_FormatColl> pExtraData = lcl_CopyStyle(aPos, *pStart, false); if (pExtraData) { if (!bFirst) @@ -2365,7 +2365,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } // modify paragraph formatting - lcl_CopyStyle(*pStt, aPos); + lcl_CopyStyle(*pStart, aPos); } if (bFirst) @@ -2413,7 +2413,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall // this doesn't work for selections with multiple tables if ( m_rDoc.GetIDocumentUndoRedo().DoesUndo() ) { - SwNodeIndex aSttIdx( pStt->GetNode() ); + SwNodeIndex aSttIdx( pStart->GetNode() ); SwNodeIndex aEndIdx( pEnd->GetNode() ); while ( aSttIdx < aEndIdx ) { @@ -2594,22 +2594,22 @@ bool DocumentRedlineManager::SplitRedline( const SwPaM& rRange ) { if (maRedlineTable.empty()) return false; - auto [pStt, pEnd] = rRange.StartEnd(); // SwPosition* + auto [pStart, pEnd] = rRange.StartEnd(); // SwPosition* // tdf#144208 this happens a lot during load of some DOCX files. if (*pEnd > maRedlineTable.GetMaxEndPos()) return false; bool bChg = false; SwRedlineTable::size_type n = 0; - //FIXME overlapping problem GetRedline( *pStt, &n ); + //FIXME overlapping problem GetRedline( *pStart, &n ); while (n < maRedlineTable.size()) { SwRangeRedline * pRedline = maRedlineTable[ n ]; auto [pRedlineStart, pRedlineEnd] = pRedline->StartEnd(); - if (*pRedlineStart <= *pStt && *pEnd <= *pRedlineEnd) + if (*pRedlineStart <= *pStart && *pEnd <= *pRedlineEnd) { bChg = true; int nn = 0; - if (*pStt == *pRedlineStart) + if (*pStart == *pRedlineStart) nn += 1; if (*pEnd == *pRedlineEnd) nn += 2; @@ -2619,7 +2619,7 @@ bool DocumentRedlineManager::SplitRedline( const SwPaM& rRange ) { case 0: pNew = new SwRangeRedline( *pRedline ); - pRedline->SetEnd( *pStt, pRedlineEnd ); + pRedline->SetEnd( *pStart, pRedlineEnd ); pNew->SetStart( *pEnd ); break; @@ -2628,7 +2628,7 @@ bool DocumentRedlineManager::SplitRedline( const SwPaM& rRange ) break; case 2: - *pRedlineEnd = *pStt; + *pRedlineEnd = *pStart; break; case 3: @@ -2679,9 +2679,9 @@ bool DocumentRedlineManager::DeleteRedline( const SwPaM& rRange, bool bSaveInUnd } } - auto [pStt, pEnd] = rRange.StartEnd(); // SwPosition* + auto [pStart, pEnd] = rRange.StartEnd(); // SwPosition* SwRedlineTable::size_type n = 0; - GetRedline( *pStt, &n ); + GetRedline( *pStart, &n ); while (n < maRedlineTable.size()) { SwRangeRedline* pRedl = maRedlineTable[ n ]; @@ -2692,7 +2692,7 @@ bool DocumentRedlineManager::DeleteRedline( const SwPaM& rRange, bool bSaveInUnd } auto [pRStt, pREnd] = pRedl->StartEnd(); // SwPosition* - switch( ComparePosition( *pStt, *pEnd, *pRStt, *pREnd ) ) + switch( ComparePosition( *pStart, *pEnd, *pRStt, *pREnd ) ) { case SwComparePosition::Equal: case SwComparePosition::Outside: @@ -2712,7 +2712,7 @@ bool DocumentRedlineManager::DeleteRedline( const SwPaM& rRange, bool bSaveInUnd case SwComparePosition::OverlapBehind: pRedl->InvalidateRange(SwRangeRedline::Invalidation::Remove); - pRedl->SetEnd( *pStt, pREnd ); + pRedl->SetEnd( *pStart, pREnd ); pRedl->InvalidateRange(SwRangeRedline::Invalidation::Add); if( !pRedl->HasValidRange() ) { @@ -2728,7 +2728,7 @@ bool DocumentRedlineManager::DeleteRedline( const SwPaM& rRange, bool bSaveInUnd { // this one needs to be split pRedl->InvalidateRange(SwRangeRedline::Invalidation::Remove); - if( *pRStt == *pStt ) + if( *pRStt == *pStart ) { pRedl->SetStart( *pEnd, pRStt ); pRedl->InvalidateRange(SwRangeRedline::Invalidation::Add); @@ -2747,7 +2747,7 @@ bool DocumentRedlineManager::DeleteRedline( const SwPaM& rRange, bool bSaveInUnd } else pCpy = nullptr; - pRedl->SetEnd( *pStt, pREnd ); + pRedl->SetEnd( *pStart, pREnd ); pRedl->InvalidateRange(SwRangeRedline::Invalidation::Add); if( !pRedl->HasValidRange() ) { @@ -2937,10 +2937,10 @@ const SwRangeRedline* DocumentRedlineManager::GetRedline( const SwPosition& rPos { nM = nU + ( nO - nU ) / 2; const SwRangeRedline* pRedl = maRedlineTable[ nM ]; - auto [pStt, pEnd] = pRedl->StartEnd(); - if( pEnd == pStt - ? *pStt == rPos - : ( *pStt <= rPos && rPos < *pEnd ) ) + auto [pStart, pEnd] = pRedl->StartEnd(); + if( pEnd == pStart + ? *pStart == rPos + : ( *pStart <= rPos && rPos < *pEnd ) ) { while( nM && rPos == *maRedlineTable[ nM - 1 ]->End() && rPos == *maRedlineTable[ nM - 1 ]->Start() ) @@ -3247,9 +3247,9 @@ bool DocumentRedlineManager::AcceptRedline( const SwPaM& rPam, bool bCallDelete, void DocumentRedlineManager::AcceptRedlineParagraphFormatting( const SwPaM &rPam ) { - auto [pStt, pEnd] = rPam.StartEnd(); // SwPosition* + auto [pStart, pEnd] = rPam.StartEnd(); // SwPosition* - const SwNodeOffset nSttIdx = pStt->GetNodeIndex(); + const SwNodeOffset nSttIdx = pStart->GetNodeIndex(); const SwNodeOffset nEndIdx = pEnd->GetNodeIndex(); for( SwRedlineTable::size_type n = 0; n < maRedlineTable.size() ; ++n ) @@ -3705,10 +3705,10 @@ const SwRangeRedline* DocumentRedlineManager::SelPrevRedline( SwPaM& rPam ) cons const SwRangeRedline* pFnd = GetRedlineTable().FindAtPosition( rSttPos, n, false ); if( pFnd ) { - const SwPosition* pStt = pFnd->Start(); - if( !pStt->GetNode().IsContentNode() ) + const SwPosition* pStart = pFnd->Start(); + if( !pStart->GetNode().IsContentNode() ) { - SwNodeIndex aTmp( pStt->GetNode() ); + SwNodeIndex aTmp( pStart->GetNode() ); SwContentNode* pCNd = SwNodes::GoNextSection(&aTmp); if( !pCNd || ( aTmp == rSttPos.GetNode() && !rSttPos.GetContentIndex() )) @@ -3821,15 +3821,15 @@ const SwRangeRedline* DocumentRedlineManager::SelPrevRedline( SwPaM& rPam ) cons bool DocumentRedlineManager::SetRedlineComment( const SwPaM& rPaM, const OUString& rS ) { bool bRet = false; - auto [pStt, pEnd] = rPaM.StartEnd(); // SwPosition* + auto [pStart, pEnd] = rPaM.StartEnd(); // SwPosition* SwRedlineTable::size_type n = 0; - if( GetRedlineTable().FindAtPosition( *pStt, n ) ) + if( GetRedlineTable().FindAtPosition( *pStart, n ) ) { for( ; n < maRedlineTable.size(); ++n ) { bRet = true; SwRangeRedline* pTmp = maRedlineTable[ n ]; - if( pStt != pEnd && *pTmp->Start() > *pEnd ) + if( pStart != pEnd && *pTmp->Start() > *pEnd ) break; pTmp->SetComment( rS ); diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 50aea4a5a20e..e88d78b332d6 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -1920,9 +1920,9 @@ SaveMergeRedline::SaveMergeRedline( const SwNode& rDstNd, { SwPosition aPos( rDstNd ); - const SwPosition* pStt = rSrcRedl.Start(); + const SwPosition* pStart = rSrcRedl.Start(); if( rDstNd.IsContentNode() ) - aPos.SetContent( pStt->GetContentIndex() ); + aPos.SetContent( pStart->GetContentIndex() ); pDestRedl = new SwRangeRedline( rSrcRedl.GetRedlineData(), aPos ); if( RedlineType::Delete != pDestRedl->GetType() ) @@ -1933,7 +1933,7 @@ SaveMergeRedline::SaveMergeRedline( const SwNode& rDstNd, pDestRedl->SetMark(); pDestRedl->GetPoint()->Adjust( pEnd->GetNodeIndex() - - pStt->GetNodeIndex() ); + pStart->GetNodeIndex() ); if( pDestRedl->GetPointContentNode() ) pDestRedl->GetPoint()->SetContent( pEnd->GetContentIndex() ); } diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index bf1d9d3679e6..92acd2a45fb0 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -333,8 +333,8 @@ void sw_GetJoinFlags( SwPaM& rPam, bool& rJoinText, bool& rJoinPrev ) if( rPam.GetPoint()->GetNode() == rPam.GetMark()->GetNode() ) return; - auto [pStt, pEnd] = rPam.StartEnd(); // SwPosition* - SwTextNode *pSttNd = pStt->GetNode().GetTextNode(); + auto [pStart, pEnd] = rPam.StartEnd(); // SwPosition* + SwTextNode *pSttNd = pStart->GetNode().GetTextNode(); if( !pSttNd ) return; @@ -343,14 +343,14 @@ void sw_GetJoinFlags( SwPaM& rPam, bool& rJoinText, bool& rJoinPrev ) if( !rJoinText ) return; - bool bExchange = pStt == rPam.GetPoint(); - if( !pStt->GetContentIndex() && + bool bExchange = pStart == rPam.GetPoint(); + if( !pStart->GetContentIndex() && pEndNd->GetText().getLength() != pEnd->GetContentIndex()) bExchange = !bExchange; if( bExchange ) rPam.Exchange(); - rJoinPrev = rPam.GetPoint() == pStt; - OSL_ENSURE( !pStt->GetContentIndex() && + rJoinPrev = rPam.GetPoint() == pStart; + OSL_ENSURE( !pStart->GetContentIndex() && pEndNd->GetText().getLength() != pEnd->GetContentIndex() ? (rPam.GetPoint()->GetNode() < rPam.GetMark()->GetNode()) : (rPam.GetPoint()->GetNode() > rPam.GetMark()->GetNode()), @@ -832,16 +832,16 @@ void SwDoc::DeleteAutoCorrExceptWord() void SwDoc::CountWords( const SwPaM& rPaM, SwDocStat& rStat ) { // This is a modified version of SwDoc::TransliterateText - auto [pStt, pEnd] = rPaM.StartEnd(); // SwPosition* + auto [pStart, pEnd] = rPaM.StartEnd(); // SwPosition* - const SwNodeOffset nSttNd = pStt->GetNodeIndex(); + const SwNodeOffset nSttNd = pStart->GetNodeIndex(); const SwNodeOffset nEndNd = pEnd->GetNodeIndex(); - const sal_Int32 nSttCnt = pStt->GetContentIndex(); + const sal_Int32 nSttCnt = pStart->GetContentIndex(); const sal_Int32 nEndCnt = pEnd->GetContentIndex(); - const SwTextNode* pTNd = pStt->GetNode().GetTextNode(); - if( pStt == pEnd && pTNd ) // no region ? + const SwTextNode* pTNd = pStart->GetNode().GetTextNode(); + if( pStart == pEnd && pTNd ) // no region ? { // do nothing return; @@ -849,7 +849,7 @@ void SwDoc::CountWords( const SwPaM& rPaM, SwDocStat& rStat ) if( nSttNd != nEndNd ) { - SwNodeIndex aIdx( pStt->GetNode() ); + SwNodeIndex aIdx( pStart->GetNode() ); if( nSttCnt ) { ++aIdx; diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 34772d2fd1e1..83dae63978fa 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -237,12 +237,12 @@ void SwDoc::RstTextAttrs(const SwPaM &rRg, bool bInclRefToxMark, pHst = &pUndo->GetHistory(); GetIDocumentUndoRedo().AppendUndo(std::move(pUndo)); } - auto [pStt, pEnd] = rRg.StartEnd(); // SwPosition* + auto [pStart, pEnd] = rRg.StartEnd(); // SwPosition* sw::DocumentContentOperationsManager::ParaRstFormat aPara( - pStt, pEnd, pHst, nullptr, pLayout ); + pStart, pEnd, pHst, nullptr, pLayout ); aPara.bInclRefToxMark = bInclRefToxMark; aPara.bExactRange = bExactRange; - GetNodes().ForEach( pStt->GetNodeIndex(), pEnd->GetNodeIndex()+1, + GetNodes().ForEach( pStart->GetNodeIndex(), pEnd->GetNodeIndex()+1, sw::DocumentContentOperationsManager::lcl_RstTextAttr, &aPara ); getIDocumentState().SetModified(); } @@ -324,9 +324,9 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, GetIDocumentUndoRedo().AppendUndo(std::move(pUndo)); } - auto [pStt, pEnd] = pPam->StartEnd(); // SwPosition* + auto [pStart, pEnd] = pPam->StartEnd(); // SwPosition* sw::DocumentContentOperationsManager::ParaRstFormat aPara( - pStt, pEnd, pHst, nullptr, pLayout); + pStart, pEnd, pHst, nullptr, pLayout); // mst: not including META here; it seems attrs with CH_TXTATR are omitted SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END - 1, @@ -343,9 +343,9 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, aPara.pDelSet = &aDelSet; bool bAdd = true; - SwNodeIndex aTmpStt( pStt->GetNode() ); + SwNodeIndex aTmpStt( pStart->GetNode() ); SwNodeIndex aTmpEnd( pEnd->GetNode() ); - if( pStt->GetContentIndex() ) // just one part + if( pStart->GetContentIndex() ) // just one part { // set up a later, and all CharFormatAttr -> TextFormatAttr SwTextNode* pTNd = aTmpStt.GetNode().GetTextNode(); @@ -371,7 +371,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, ++aTmpEnd; bAdd = false; } - else if( pStt->GetNode() != pEnd->GetNode() || !pStt->GetContentIndex() ) + else if( pStart->GetNode() != pEnd->GetNode() || !pStart->GetContentIndex() ) { SwTextNode* pTNd = aTmpEnd.GetNode().GetTextNode(); if( pTNd && pTNd->HasSwAttrSet() && pTNd->GetpSwAttrSet()->Count() ) @@ -389,11 +389,11 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, } if( aTmpStt < aTmpEnd ) - GetNodes().ForEach( pStt->GetNode(), aTmpEnd.GetNode(), lcl_RstAttr, &aPara ); + GetNodes().ForEach( pStart->GetNode(), aTmpEnd.GetNode(), lcl_RstAttr, &aPara ); else if( !rRg.HasMark() ) { aPara.bResetAll = false ; - ::lcl_RstAttr( &pStt->GetNode(), &aPara ); + ::lcl_RstAttr( &pStart->GetNode(), &aPara ); aPara.bResetAll = true ; } @@ -401,7 +401,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, { if( bAdd ) ++aTmpEnd; - GetNodes().ForEach( pStt->GetNode(), aTmpEnd.GetNode(), sw::DocumentContentOperationsManager::lcl_RstTextAttr, &aPara ); + GetNodes().ForEach( pStart->GetNode(), aTmpEnd.GetNode(), sw::DocumentContentOperationsManager::lcl_RstTextAttr, &aPara ); } getIDocumentState().SetModified(); @@ -1086,7 +1086,7 @@ bool SwDoc::SetTextFormatColl(const SwPaM &rRg, SwRootFrame const*const pLayout) { SwDataChanged aTmp( rRg ); - auto [pStt, pEnd] = rRg.StartEnd(); // SwPosition* + auto [pStart, pEnd] = rRg.StartEnd(); // SwPosition* SwHistory* pHst = nullptr; bool bRet = true; @@ -1101,7 +1101,7 @@ bool SwDoc::SetTextFormatColl(const SwPaM &rRg, std::shared_ptr<SfxItemSet> pDelSet; sw::DocumentContentOperationsManager::ParaRstFormat aPara( - pStt, pEnd, pHst, nullptr, pLayout); + pStart, pEnd, pHst, nullptr, pLayout); aPara.pFormatColl = pFormat; aPara.bReset = bReset; // #i62675# @@ -1114,7 +1114,7 @@ bool SwDoc::SetTextFormatColl(const SwPaM &rRg, aPara.pDelSet = pDelSet.get(); } - GetNodes().ForEach( pStt->GetNodeIndex(), pEnd->GetNodeIndex()+1, + GetNodes().ForEach( pStart->GetNodeIndex(), pEnd->GetNodeIndex()+1, lcl_SetTextFormatColl, &aPara ); if( !aPara.nWhich ) bRet = false; // didn't find a valid Node diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index fc820daa6248..0031b1530ca7 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -457,14 +457,14 @@ bool SwDoc::SetCurFootnote( const SwPaM& rPam, const OUString& rNumStr, SwFootnoteIdxs& rFootnoteArr = GetFootnoteIdxs(); SwRootFrame* pTmpRoot = getIDocumentLayoutAccess().GetCurrentLayout(); - auto [pStt, pEnd] = rPam.StartEnd(); // SwPosition* - const SwNodeOffset nSttNd = pStt->GetNodeIndex(); - const sal_Int32 nSttCnt = pStt->GetContentIndex(); + auto [pStart, pEnd] = rPam.StartEnd(); // SwPosition* + const SwNodeOffset nSttNd = pStart->GetNodeIndex(); + const sal_Int32 nSttCnt = pStart->GetContentIndex(); const SwNodeOffset nEndNd = pEnd->GetNodeIndex(); const sal_Int32 nEndCnt = pEnd->GetContentIndex(); size_t nPos = 0; - rFootnoteArr.SeekEntry( pStt->GetNode(), &nPos ); + rFootnoteArr.SeekEntry( pStart->GetNode(), &nPos ); std::unique_ptr<SwUndoChangeFootNote> pUndo; if (GetIDocumentUndoRedo().DoesUndo()) diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 584417b5ed76..afbdfe7b63dc 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -2055,9 +2055,9 @@ bool SwDoc::MoveParagraph(SwPaM& rPam, SwNodeOffset nOffset, bool const bIsOutlM bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, bool const bIsOutlMv, SwRootFrame const*const pLayout) { - auto [pStt, pEnd] = rPam.StartEnd(); // SwPosition* + auto [pStart, pEnd] = rPam.StartEnd(); // SwPosition* - SwNodeOffset nStIdx = pStt->GetNodeIndex(); + SwNodeOffset nStIdx = pStart->GetNodeIndex(); SwNodeOffset nEndIdx = pEnd->GetNodeIndex(); // Here are some sophisticated checks whether the wished PaM will be moved or not. @@ -2155,11 +2155,11 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, // Test for Redlining - Can the Selection be moved at all, actually? if( !getIDocumentRedlineAccess().IsIgnoreRedline() ) { - SwRedlineTable::size_type nRedlPos = getIDocumentRedlineAccess().GetRedlinePos( pStt->GetNode(), RedlineType::Delete ); + SwRedlineTable::size_type nRedlPos = getIDocumentRedlineAccess().GetRedlinePos( pStart->GetNode(), RedlineType::Delete ); if( SwRedlineTable::npos != nRedlPos ) { SwContentNode* pCNd = pEnd->GetNode().GetContentNode(); - SwPosition aStPos( pStt->GetNode() ); + SwPosition aStPos( pStart->GetNode() ); SwPosition aEndPos( pEnd->GetNode(), pCNd, pCNd ? pCNd->Len() : 1 ); bool bCheckDel = true; @@ -2204,14 +2204,14 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, SwDataChanged aTmp( rPam ); } - SwNodeIndex aIdx( nOffset > SwNodeOffset(0) ? pEnd->GetNode() : pStt->GetNode(), nOffs ); - SwNodeRange aMvRg( pStt->GetNode(), SwNodeOffset(0), pEnd->GetNode(), SwNodeOffset(+1) ); + SwNodeIndex aIdx( nOffset > SwNodeOffset(0) ? pEnd->GetNode() : pStart->GetNode(), nOffs ); + SwNodeRange aMvRg( pStart->GetNode(), SwNodeOffset(0), pEnd->GetNode(), SwNodeOffset(+1) ); SwRangeRedline* pOwnRedl = nullptr; if( getIDocumentRedlineAccess().IsRedlineOn() ) { // If the range is completely in the own Redline, we can move it! - SwRedlineTable::size_type nRedlPos = getIDocumentRedlineAccess().GetRedlinePos( pStt->GetNode(), RedlineType::Insert ); + SwRedlineTable::size_type nRedlPos = getIDocumentRedlineAccess().GetRedlinePos( pStart->GetNode(), RedlineType::Insert ); if( SwRedlineTable::npos != nRedlPos ) { SwRangeRedline* pTmp = getIDocumentRedlineAccess().GetRedlineTable()[ nRedlPos ]; @@ -2220,8 +2220,8 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, const SwContentNode* pCEndNd = pEnd->GetNode().GetContentNode(); // Is completely in the range and is the own Redline too? if( aTmpRedl.IsOwnRedline( *pTmp ) && - (pRStt->GetNode() < pStt->GetNode() || - (pRStt->GetNode() == pStt->GetNode() && !pRStt->GetContentIndex()) ) && + (pRStt->GetNode() < pStart->GetNode() || + (pRStt->GetNode() == pStart->GetNode() && !pRStt->GetContentIndex()) ) && (pEnd->GetNode() < pREnd->GetNode() || (pEnd->GetNode() == pREnd->GetNode() && pCEndNd ? pREnd->GetContentIndex() == pCEndNd->Len() @@ -2255,7 +2255,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, // First the Insert, then the Delete SwPosition aInsPos( aIdx ); - std::optional<SwPaM> oPam( std::in_place, pStt->GetNode(), 0, aMvRg.aEnd.GetNode(), 0 ); + std::optional<SwPaM> oPam( std::in_place, pStart->GetNode(), 0, aMvRg.aEnd.GetNode(), 0 ); SwPaM& rOrigPam(rPam); rOrigPam.DeleteMark(); @@ -2410,7 +2410,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, { SwRedlineTable& rTable = getIDocumentRedlineAccess().GetRedlineTable(); SwRedlineTable::size_type nRedlPosWithEmpty = - getIDocumentRedlineAccess().GetRedlinePos( pStt->GetNode(), RedlineType::Insert ); + getIDocumentRedlineAccess().GetRedlinePos( pStart->GetNode(), RedlineType::Insert ); if ( SwRedlineTable::npos != nRedlPosWithEmpty ) { pOwnRedl = rTable[nRedlPosWithEmpty]; diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 988ec45884f0..2a49c24c6089 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -111,10 +111,10 @@ void SwExtraRedlineTable::dumpAsXml(xmlTextWriterPtr pWriter) const } #if OSL_DEBUG_LEVEL > 0 -static bool CheckPosition( const SwPosition* pStt, const SwPosition* pEnd ) +static bool CheckPosition( const SwPosition* pStart, const SwPosition* pEnd ) { int nError = 0; - SwNode* pSttNode = &pStt->GetNode(); + SwNode* pSttNode = &pStart->GetNode(); SwNode* pEndNode = &pEnd->GetNode(); SwNode* pSttTab = pSttNode->StartOfSectionNode()->FindTableNode(); SwNode* pEndTab = pEndNode->StartOfSectionNode()->FindTableNode(); @@ -503,8 +503,8 @@ std::vector<std::unique_ptr<SwRangeRedline>> GetAllValidRanges(std::unique_ptr<S { std::vector<std::unique_ptr<SwRangeRedline>> ret; // Create valid "sub-ranges" from the Selection - auto [pStt, pEnd] = p->StartEnd(); // SwPosition* - SwPosition aNewStt( *pStt ); + auto [pStart, pEnd] = p->StartEnd(); // SwPosition* + SwPosition aNewStt( *pStart ); SwNodes& rNds = aNewStt.GetNodes(); SwContentNode* pC; @@ -1786,26 +1786,26 @@ void SwRangeRedline::CalcStartEnd( SwNodeOffset nNdIdx, sal_Int32& rStart, sal_I } } -static void lcl_storeAnnotationMarks(SwDoc& rDoc, const SwPosition* pStt, const SwPosition* pEnd) +static void lcl_storeAnnotationMarks(SwDoc& rDoc, const SwPosition* pStart, const SwPosition* pEnd) { // tdf#115815 keep original start position of collapsed annotation ranges // as temporary bookmarks (removed after file saving and file loading) IDocumentMarkAccess& rDMA(*rDoc.getIDocumentMarkAccess()); - for (auto iter = rDMA.findFirstAnnotationMarkNotStartsBefore(*pStt); + for (auto iter = rDMA.findFirstAnnotationMarkNotStartsBefore(*pStart); iter != rDMA.getAnnotationMarksEnd(); ++iter) { SwPosition const& rStartPos((**iter).GetMarkStart()); // vector is sorted by start pos, so we can exit early if ( rStartPos > *pEnd ) break; - if ( *pStt <= rStartPos && rStartPos < *pEnd ) + if ( *pStart <= rStartPos && rStartPos < *pEnd ) { auto pOldMark = rDMA.findAnnotationBookmark((**iter).GetName()); if ( pOldMark == rDMA.getBookmarksEnd() ) { // at start of redlines use a 1-character length bookmark range // instead of a 0-character length bookmark position to avoid its losing - sal_Int32 nLen = (*pStt == rStartPos) ? 1 : 0; + sal_Int32 nLen = (*pStart == rStartPos) ? 1 : 0; SwPaM aPam( rStartPos.GetNode(), rStartPos.GetContentIndex(), rStartPos.GetNode(), rStartPos.GetContentIndex() + nLen); ::sw::mark::Bookmark* pBookmark = rDMA.makeAnnotationBookmark( @@ -1826,11 +1826,11 @@ void SwRangeRedline::MoveToSection() { if( !m_oContentSect ) { - auto [pStt, pEnd] = StartEnd(); // SwPosition* + auto [pStart, pEnd] = StartEnd(); // SwPosition* SwDoc& rDoc = GetDoc(); - SwPaM aPam( *pStt, *pEnd ); - SwContentNode* pCSttNd = pStt->GetNode().GetContentNode(); + SwPaM aPam( *pStart, *pEnd ); + SwContentNode* pCSttNd = pStart->GetNode().GetContentNode(); SwContentNode* pCEndNd = pEnd->GetNode().GetContentNode(); if( !pCSttNd ) @@ -1840,9 +1840,9 @@ void SwRangeRedline::MoveToSection() const SwRedlineTable& rTable = rDoc.getIDocumentRedlineAccess().GetRedlineTable(); for(SwRangeRedline* pRedl : rTable) { - if( pRedl->GetBound() == *pStt ) + if( pRedl->GetBound() == *pStart ) pRedl->GetBound() = *pEnd; - if( pRedl->GetBound(false) == *pStt ) + if( pRedl->GetBound(false) == *pStart ) pRedl->GetBound(false) = *pEnd; } } @@ -1865,7 +1865,7 @@ void SwRangeRedline::MoveToSection() if( pCSttNd && pCEndNd ) { // tdf#140982 keep annotation ranges in deletions in margin mode - lcl_storeAnnotationMarks( rDoc, pStt, pEnd ); + lcl_storeAnnotationMarks( rDoc, pStart, pEnd ); rDoc.getIDocumentContentOperations().MoveAndJoin( aPam, aPos ); } else @@ -1886,7 +1886,7 @@ void SwRangeRedline::MoveToSection() } m_oContentSect.emplace( *pSttNd ); - if( pStt == GetPoint() ) + if( pStart == GetPoint() ) Exchange(); DeleteMark(); @@ -1900,9 +1900,9 @@ void SwRangeRedline::CopyToSection() if( m_oContentSect ) return; - auto [pStt, pEnd] = StartEnd(); // SwPosition* -e ... etc. - the rest is truncated