diff options
Diffstat (limited to 'sw/source/core/doc')
-rw-r--r-- | sw/source/core/doc/CntntIdxStore.cxx | 24 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 164 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentFieldsManager.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentLayoutManager.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentRedlineManager.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/doc/dbgoutsw.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/doc.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/docbm.cxx | 30 | ||||
-rw-r--r-- | sw/source/core/doc/doccomp.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/doc/doccorr.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/doc/docedt.cxx | 30 | ||||
-rw-r--r-- | sw/source/core/doc/docfld.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/doc/docfly.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/doc/docftn.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/doclay.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/doc/docnum.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/doc/docredln.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/doc/docruby.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/doc/doctxm.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/extinput.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/doc/swserv.cxx | 4 |
22 files changed, 205 insertions, 205 deletions
diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx index 9e54fe4610ad..58de4967a42d 100644 --- a/sw/source/core/doc/CntntIdxStore.cxx +++ b/sw/source/core/doc/CntntIdxStore.cxx @@ -57,7 +57,7 @@ namespace int nReturn = BEFORE_NODE; if( nIndex == nNode ) { - const sal_Int32 nCntIdx = rPos.nContent.GetIndex(); + const sal_Int32 nCntIdx = rPos.GetContentIndex(); if( nCntIdx < nContent ) nReturn = BEFORE_SAME_NODE; else if( nCntIdx == nContent ) @@ -201,9 +201,9 @@ namespace void lcl_ChkPaM( std::vector<PaMEntry>& rPaMEntries, const SwNodeOffset nNode, const sal_Int32 nContent, SwPaM& rPaM, const bool bGetPoint, bool bSetMark) { const SwPosition* pPos = &rPaM.GetBound(bGetPoint); - if( pPos->GetNodeIndex() == nNode && pPos->nContent.GetIndex() < nContent ) + if( pPos->GetNodeIndex() == nNode && pPos->GetContentIndex() < nContent ) { - const PaMEntry aEntry = { &rPaM, bSetMark, pPos->nContent.GetIndex() }; + const PaMEntry aEntry = { &rPaM, bSetMark, pPos->GetContentIndex() }; rPaMEntries.push_back(aEntry); } } @@ -239,11 +239,11 @@ void ContentIdxStoreImpl::SaveBkmks(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 n const ::sw::mark::IMark* pBkmk = *ppBkmk; bool bMarkPosEqual = false; if(pBkmk->GetMarkPos().GetNodeIndex() == nNode - && pBkmk->GetMarkPos().nContent.GetIndex() <= nContent) + && pBkmk->GetMarkPos().GetContentIndex() <= nContent) { - if(pBkmk->GetMarkPos().nContent.GetIndex() < nContent) + if(pBkmk->GetMarkPos().GetContentIndex() < nContent) { - const MarkEntry aEntry = { static_cast<tools::Long>(ppBkmk - pMarkAccess->getAllMarksBegin()), false, pBkmk->GetMarkPos().nContent.GetIndex() }; + const MarkEntry aEntry = { static_cast<tools::Long>(ppBkmk - pMarkAccess->getAllMarksBegin()), false, pBkmk->GetMarkPos().GetContentIndex() }; m_aBkmkEntries.push_back(aEntry); } else // if a bookmark position is equal nContent, the other position @@ -251,14 +251,14 @@ void ContentIdxStoreImpl::SaveBkmks(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 n } if(pBkmk->IsExpanded() && pBkmk->GetOtherMarkPos().GetNodeIndex() == nNode - && pBkmk->GetOtherMarkPos().nContent.GetIndex() <= nContent) + && pBkmk->GetOtherMarkPos().GetContentIndex() <= nContent) { if(bMarkPosEqual) { // the other position is before, the (main) position is equal - const MarkEntry aEntry = { static_cast<tools::Long>(ppBkmk - pMarkAccess->getAllMarksBegin()), false, pBkmk->GetMarkPos().nContent.GetIndex() }; + const MarkEntry aEntry = { static_cast<tools::Long>(ppBkmk - pMarkAccess->getAllMarksBegin()), false, pBkmk->GetMarkPos().GetContentIndex() }; m_aBkmkEntries.push_back(aEntry); } - const MarkEntry aEntry = { static_cast<tools::Long>(ppBkmk - pMarkAccess->getAllMarksBegin()), true, pBkmk->GetOtherMarkPos().nContent.GetIndex() }; + const MarkEntry aEntry = { static_cast<tools::Long>(ppBkmk - pMarkAccess->getAllMarksBegin()), true, pBkmk->GetOtherMarkPos().GetContentIndex() }; m_aBkmkEntries.push_back(aEntry); } } @@ -298,13 +298,13 @@ void ContentIdxStoreImpl::SaveRedlines(SwDoc& rDoc, SwNodeOffset nNode, sal_Int3 if( nPointPos == BEFORE_SAME_NODE || ( nPointPos == SAME_POSITION && nMarkPos < SAME_POSITION ) ) { - const MarkEntry aEntry = { nIdx, false, pRdl->GetPoint()->nContent.GetIndex() }; + const MarkEntry aEntry = { nIdx, false, pRdl->GetPoint()->GetContentIndex() }; m_aRedlineEntries.push_back(aEntry); } if( pRdl->HasMark() && ( nMarkPos == BEFORE_SAME_NODE || ( nMarkPos == SAME_POSITION && nPointPos < SAME_POSITION ) ) ) { - const MarkEntry aEntry = { nIdx, true, pRdl->GetMark()->nContent.GetIndex() }; + const MarkEntry aEntry = { nIdx, true, pRdl->GetMark()->GetContentIndex() }; m_aRedlineEntries.push_back(aEntry); } ++nIdx; @@ -350,7 +350,7 @@ void ContentIdxStoreImpl::SaveFlys(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 nC { bool bSkip = false; aSave.m_bOther = false; - aSave.m_nContent = pAPos->nContent.GetIndex(); + aSave.m_nContent = pAPos->GetContentIndex(); if ( RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId() ) { if( nContent <= aSave.m_nContent ) diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 3eb119a177ec..19aa8c27accc 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -209,18 +209,18 @@ namespace SwNodeOffset nNdOff = rOrigPos.GetNodeIndex(); nNdOff -= rOrigStt.GetNodeIndex(); nNdOff -= nDelCount; - sal_Int32 nContentPos = rOrigPos.nContent.GetIndex(); + sal_Int32 nContentPos = rOrigPos.GetContentIndex(); // Always adjust <nNode> at to be changed <SwPosition> instance <rChgPos> rChgPos.nNode = nNdOff + rCpyStt.GetNodeIndex(); if( !nNdOff ) { // just adapt the content index - if( nContentPos > rOrigStt.nContent.GetIndex() ) - nContentPos -= rOrigStt.nContent.GetIndex(); + if( nContentPos > rOrigStt.GetContentIndex() ) + nContentPos -= rOrigStt.GetContentIndex(); else nContentPos = 0; - nContentPos += rCpyStt.nContent.GetIndex(); + nContentPos += rCpyStt.GetContentIndex(); } rChgPos.nContent.Assign( rChgPos.GetNode().GetContentNode(), nContentPos ); } @@ -252,15 +252,15 @@ namespace sw // only include marks that are in the range and not touching both start and end // - not for annotation or checkbox marks. bool const isIncludeStart( - (rStt.nContent.GetIndex() == 0 // paragraph start selected? + (rStt.GetContentIndex() == 0 // paragraph start selected? // also: only if inserting at the start - cross reference // marks require index to be 0, and there could be one // on the target node already - && rCpyPam.nContent.GetIndex() == 0) + && rCpyPam.GetContentIndex() == 0) || rMarkStart != rStt); bool const isIncludeEnd( (rEnd.GetNode().IsTextNode() // paragraph end selected? - && rEnd.nContent.GetIndex() == rEnd.GetNode().GetTextNode()->Len()) + && rEnd.GetContentIndex() == rEnd.GetNode().GetTextNode()->Len()) || rMarkEnd != rEnd); const bool bIsNotOnBoundary = pMark->IsExpanded() @@ -504,8 +504,8 @@ namespace const SwTextNode* pEndNd = pEnd->GetNode().GetTextNode(); if (nullptr != pSttNd && nullptr != pEndNd && - pStt->nContent.GetIndex() == 0 && - pEnd->nContent.GetIndex() == pEndNd->Len()) + pStt->GetContentIndex() == 0 && + pEnd->GetContentIndex() == pEndNd->Len()) { bResult = true; } @@ -535,10 +535,10 @@ namespace sw { SwTextNode & rTextNode(*pNode->GetTextNode()); sal_Int32 const nStart(n == nStartNode - ? rPam.Start()->nContent.GetIndex() + ? rPam.Start()->GetContentIndex() : 0); sal_Int32 const nEnd(n == nEndNode - ? rPam.End()->nContent.GetIndex() + ? rPam.End()->GetContentIndex() : rTextNode.Len()); for (sal_Int32 i = nStart; i < nEnd; ++i) { @@ -626,7 +626,7 @@ namespace sw { SwPosition const& rStart(std::get<0>(startedFields.top())->GetMarkStart()); std::pair<SwNodeOffset, sal_Int32> const pos( - rStart.GetNodeIndex(), rStart.nContent.GetIndex()); + rStart.GetNodeIndex(), rStart.GetContentIndex()); auto it = std::lower_bound(rBreaks.begin(), rBreaks.end(), pos); assert(it == rBreaks.end() || *it != pos); rBreaks.insert(it, pos); @@ -707,8 +707,8 @@ namespace const SwTextNode* pEndNd = pEnd->GetNode().GetTextNode(); if( (nullptr != pEndNd) && pStt->GetNode().IsTextNode() ) { - const sal_uInt64 nSum = pStt->nContent.GetIndex() + - pEndNd->GetText().getLength() - pEnd->nContent.GetIndex(); + const sal_uInt64 nSum = pStt->GetContentIndex() + + pEndNd->GetText().getLength() - pEnd->GetContentIndex(); return nSum > o3tl::make_unsigned(SAL_MAX_INT32); } } @@ -730,11 +730,11 @@ namespace auto [pStt, pEnd] = pR->StartEnd(); // SwPosition* SwNodeOffset nSttIdx = rSttIdx.GetIndex(); nStt = pStt->GetNodeIndex() - nSttIdx; - nSttCnt = pStt->nContent.GetIndex(); + nSttCnt = pStt->GetContentIndex(); if( pR->HasMark() ) { nEnd = pEnd->GetNodeIndex() - nSttIdx; - nEndCnt = pEnd->nContent.GetIndex(); + nEndCnt = pEnd->GetContentIndex(); } pRedl->GetPoint()->nNode = SwNodeOffset(0); @@ -751,15 +751,15 @@ namespace auto [pStt, pEnd] = pR->StartEnd(); // SwPosition* SwNodeOffset nSttIdx = rPos.GetNodeIndex(); nStt = pStt->GetNodeIndex() - nSttIdx; - nSttCnt = pStt->nContent.GetIndex(); + nSttCnt = pStt->GetContentIndex(); if( nStt == SwNodeOffset(0) ) - nSttCnt = nSttCnt - rPos.nContent.GetIndex(); + nSttCnt = nSttCnt - rPos.GetContentIndex(); if( pR->HasMark() ) { nEnd = pEnd->GetNodeIndex() - nSttIdx; - nEndCnt = pEnd->nContent.GetIndex(); + nEndCnt = pEnd->GetContentIndex(); if( nEnd == SwNodeOffset(0) ) - nEndCnt = nEndCnt - rPos.nContent.GetIndex(); + nEndCnt = nEndCnt - rPos.GetContentIndex(); } pRedl->GetPoint()->nNode = SwNodeOffset(0); @@ -782,11 +782,11 @@ namespace void SetPos( const SwPosition& aPos ) { pRedl->GetPoint()->nNode = aPos.GetNodeIndex() + nStt; - pRedl->GetPoint()->nContent.Assign( pRedl->GetContentNode(), nSttCnt + ( nStt == SwNodeOffset(0) ? aPos.nContent.GetIndex() : 0 ) ); + pRedl->GetPoint()->nContent.Assign( pRedl->GetContentNode(), nSttCnt + ( nStt == SwNodeOffset(0) ? aPos.GetContentIndex() : 0 ) ); if( pRedl->HasMark() ) { pRedl->GetMark()->nNode = aPos.GetNodeIndex() + nEnd; - pRedl->GetMark()->nContent.Assign( pRedl->GetContentNode(false), nEndCnt + ( nEnd == SwNodeOffset(0) ? aPos.nContent.GetIndex() : 0 ) ); + pRedl->GetMark()->nContent.Assign( pRedl->GetContentNode(false), nEndCnt + ( nEnd == SwNodeOffset(0) ? aPos.GetContentIndex() : 0 ) ); } } }; @@ -923,7 +923,7 @@ namespace { rRedlTable.Remove( nRedlPos-- ); if( pREnd->nNode < rRg.aEnd || - ( pREnd->nNode == rRg.aEnd && !pREnd->nContent.GetIndex()) ) + ( pREnd->nNode == rRg.aEnd && !pREnd->GetContentIndex()) ) { // move everything rArr.emplace_back( pTmp, rRg.aStart ); @@ -1286,7 +1286,7 @@ namespace //local functions originally from docfmt.cxx SfxItemSetFixed<RES_CHRATR_BEGIN, RES_TXTATR_WITHEND_END - 1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1> aSet( rDoc.GetAttrPool() ); SwTextNode * pNode = rRg.Start()->GetNode().GetTextNode(); - pNode->GetParaAttr( aSet, rRg.Start()->nContent.GetIndex() + 1, rRg.End()->nContent.GetIndex() ); + pNode->GetParaAttr( aSet, rRg.Start()->GetContentIndex() + 1, rRg.End()->GetContentIndex() ); aSet.ClearItem( RES_TXTATR_REFMARK ); aSet.ClearItem( RES_TXTATR_TOXMARK ); @@ -1325,11 +1325,11 @@ namespace //local functions originally from docfmt.cxx if( pNode ) { const sal_Int32 nStart = aIdx == rRg.Start()->nNode - ? rRg.Start()->nContent.GetIndex() + ? rRg.Start()->GetContentIndex() : 0; const sal_Int32 nEnd = aIdx < aEndNd ? pNode->GetText().getLength() - : rRg.End()->nContent.GetIndex(); + : rRg.End()->GetContentIndex(); if( SwpHints *pHints = pNode->GetpSwpHints() ) { @@ -1477,8 +1477,8 @@ 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->nContent.GetIndex() == 0) && - (pCurrentNode->GetIndex() < nEndIndex || pEnd->nContent.GetIndex() == pEndNode->Len())) + (nStartIndex < pCurrentNode->GetIndex() || pStt->GetContentIndex() == 0) && + (pCurrentNode->GetIndex() < nEndIndex || pEnd->GetContentIndex() == pEndNode->Len())) { pCurrentNode->ResetAttr(RES_PARATR_LIST_AUTOFMT); // reset also paragraph marker @@ -1547,8 +1547,8 @@ namespace //local functions originally from docfmt.cxx if (bRet && (rDoc.getIDocumentRedlineAccess().IsRedlineOn() || (!rDoc.getIDocumentRedlineAccess().IsIgnoreRedline() && !rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty()))) { - SwPaM aPam( pStt->nNode, pStt->nContent.GetIndex()-1, - pStt->nNode, pStt->nContent.GetIndex() ); + SwPaM aPam( pStt->nNode, pStt->GetContentIndex()-1, + pStt->nNode, pStt->GetContentIndex() ); if( pUndo ) pUndo->SaveRedlineData( aPam, true ); @@ -1577,7 +1577,7 @@ namespace //local functions originally from docfmt.cxx { const sal_Int32 nInsCnt = rSt.GetIndex(); const sal_Int32 nEnd = pStt->nNode == pEnd->nNode - ? pEnd->nContent.GetIndex() + ? pEnd->GetContentIndex() : pNode->Len(); SwRegHistory history( pNode, *pNode, pHistory ); bRet = history.InsertItems( aTextSet, nInsCnt, nEnd, nFlags, ppNewTextAttr ) @@ -1829,14 +1829,14 @@ namespace //local functions originally from docfmt.cxx if( pStt->nNode != pEnd->nNode ) aCntEnd.Assign( pNode, nLen ); - if( pStt->nContent.GetIndex() != 0 || aCntEnd.GetIndex() != nLen ) + if( pStt->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->nContent.GetIndex(), aCntEnd.GetIndex(), nFlags, /*ppNewTextAttr*/nullptr) + pStt->GetContentIndex(), aCntEnd.GetIndex(), nFlags, /*ppNewTextAttr*/nullptr) || bRet; } @@ -2031,13 +2031,13 @@ DocumentContentOperationsManager::CopyRange( SwPaM& rPam, SwPosition& rPos, nEnd = pEnd->GetNodeIndex(), nDiff = nEnd - nStt +1; SwNode* pNd = m_rDoc.GetNodes()[ nStt ]; - if( pNd->IsContentNode() && pStt->nContent.GetIndex() ) + if( pNd->IsContentNode() && pStt->GetContentIndex() ) { ++nStt; --nDiff; } if( (pNd = m_rDoc.GetNodes()[ nEnd ])->IsContentNode() && - static_cast<SwContentNode*>(pNd)->Len() != pEnd->nContent.GetIndex() ) + static_cast<SwContentNode*>(pNd)->Len() != pEnd->GetContentIndex() ) { --nEnd; --nDiff; @@ -2409,13 +2409,13 @@ bool DocumentContentOperationsManager::MoveRange( SwPaM& rPaM, SwPosition& rPos, // updating the indices. After the Move the Node is optionally deleted. SwTextNode * pTNd = rPos.GetNode().GetTextNode(); if( pTNd && rPaM.GetPoint()->nNode != rPaM.GetMark()->nNode && - ( rPos.nContent.GetIndex() || ( pTNd->Len() && bCorrSavePam )) ) + ( rPos.GetContentIndex() || ( pTNd->Len() && bCorrSavePam )) ) { bSplit = true; - const sal_Int32 nMkContent = rPaM.GetMark()->nContent.GetIndex(); + const sal_Int32 nMkContent = rPaM.GetMark()->GetContentIndex(); const std::shared_ptr<sw::mark::ContentIdxStore> pContentStore(sw::mark::ContentIdxStore::Create()); - pContentStore->Save( m_rDoc, rPos.GetNodeIndex(), rPos.nContent.GetIndex(), true ); + pContentStore->Save( m_rDoc, rPos.GetNodeIndex(), rPos.GetContentIndex(), true ); SwTextNode * pOrigNode = pTNd; assert(*aSavePam.GetPoint() == *aSavePam.GetMark() && @@ -2819,14 +2819,14 @@ bool DocumentContentOperationsManager::Overwrite( const SwPaM &rRg, const OUStri if (!m_rDoc.GetIDocumentUndoRedo().DoesUndo() && !m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline() && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty()) { - SwPaM aPam(rPt.nNode, nActualStart, rPt.nNode, rPt.nContent.GetIndex()); + SwPaM aPam(rPt.nNode, nActualStart, rPt.nNode, rPt.GetContentIndex()); m_rDoc.getIDocumentRedlineAccess().DeleteRedline( aPam, true, RedlineType::Any ); } else if( m_rDoc.getIDocumentRedlineAccess().IsRedlineOn() ) { // FIXME: this redline is WRONG: there is no DELETE, and the skipped // characters are also included in aPam - SwPaM aPam(rPt.nNode, nActualStart, rPt.nNode, rPt.nContent.GetIndex()); + SwPaM aPam(rPt.nNode, nActualStart, rPt.nNode, rPt.GetContentIndex()); m_rDoc.getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( RedlineType::Insert, aPam ), true); } @@ -2875,7 +2875,7 @@ bool DocumentContentOperationsManager::InsertString( const SwPaM &rRg, const OUS { m_rDoc.GetIDocumentUndoRedo().AppendUndo( std::make_unique<SwUndoInsert>(rPos.nNode, - rPos.nContent.GetIndex(), ins.getLength(), nInsertMode)); + rPos.GetContentIndex(), ins.getLength(), nInsertMode)); } } else @@ -2895,7 +2895,7 @@ bool DocumentContentOperationsManager::InsertString( const SwPaM &rRg, const OUS } CharClass const& rCC = GetAppCharClass(); - sal_Int32 nInsPos = rPos.nContent.GetIndex(); + sal_Int32 nInsPos = rPos.GetContentIndex(); if (!pUndo) { @@ -2923,7 +2923,7 @@ bool DocumentContentOperationsManager::InsertString( const SwPaM &rRg, const OUS if( m_rDoc.getIDocumentRedlineAccess().IsRedlineOn() || (!m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline() && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty() )) { SwPaM aPam( rPos.nNode, aTmp.GetContent(), - rPos.nNode, rPos.nContent.GetIndex()); + rPos.nNode, rPos.GetContentIndex()); if( m_rDoc.getIDocumentRedlineAccess().IsRedlineOn() ) { m_rDoc.getIDocumentRedlineAccess().AppendRedline( @@ -2960,8 +2960,8 @@ void DocumentContentOperationsManager::TransliterateText( auto [pStt, pEnd] = rPaM.StartEnd(); // SwPosition* SwNodeOffset nSttNd = pStt->GetNodeIndex(), nEndNd = pEnd->GetNodeIndex(); - sal_Int32 nSttCnt = pStt->nContent.GetIndex(); - sal_Int32 nEndCnt = pEnd->nContent.GetIndex(); + sal_Int32 nSttCnt = pStt->GetContentIndex(); + sal_Int32 nEndCnt = pEnd->GetContentIndex(); SwTextNode* pTNd = pStt->GetNode().GetTextNode(); if( (pStt == pEnd) && pTNd ) // no selection? @@ -3248,7 +3248,7 @@ SwDrawFrameFormat* DocumentContentOperationsManager::InsertDrawObj( rDrawObjAnchorFormat.GetContentAnchor()->GetNode().GetTextNode(); if ( pAnchorTextNode != nullptr ) { - const sal_Int32 nStt = rDrawObjAnchorFormat.GetContentAnchor()->nContent.GetIndex(); + const sal_Int32 nStt = rDrawObjAnchorFormat.GetContentAnchor()->GetContentIndex(); SwFormatFlyCnt aFormat( pFormat ); pAnchorTextNode->InsertItem( aFormat, nStt, nStt ); bAnchorAtPageAsFallback = false; @@ -3314,7 +3314,7 @@ bool DocumentContentOperationsManager::SplitNode( const SwPosition &rPos, bool b // Update the rsid of the old and the new node unless // the old node is split at the beginning or at the end SwTextNode *pTextNode = rPos.GetNode().GetTextNode(); - const sal_Int32 nPos = rPos.nContent.GetIndex(); + const sal_Int32 nPos = rPos.GetContentIndex(); if( pTextNode && nPos && nPos != pTextNode->Len() ) { m_rDoc.UpdateParRsid( pTextNode ); @@ -3323,7 +3323,7 @@ bool DocumentContentOperationsManager::SplitNode( const SwPosition &rPos, bool b //JP 28.01.97: Special case for SplitNode at table start: // If it is at the beginning of a Doc/Fly/Footer/... or right at after a table // then insert a paragraph before it. - if( bChkTableStart && !rPos.nContent.GetIndex() && pNode->IsTextNode() ) + if( bChkTableStart && !rPos.GetContentIndex() && pNode->IsTextNode() ) { SwNodeOffset nPrevPos = rPos.GetNodeIndex() - 1; const SwTableNode* pTableNd; @@ -3392,7 +3392,7 @@ bool DocumentContentOperationsManager::SplitNode( const SwPosition &rPos, bool b } const std::shared_ptr<sw::mark::ContentIdxStore> pContentStore(sw::mark::ContentIdxStore::Create()); - pContentStore->Save( m_rDoc, rPos.GetNodeIndex(), rPos.nContent.GetIndex(), true ); + pContentStore->Save( m_rDoc, rPos.GetNodeIndex(), rPos.GetContentIndex(), true ); assert(pNode->IsTextNode()); std::function<void (SwTextNode *, sw::mark::RestoreMode, bool bAtStart)> restoreFunc( [&](SwTextNode *const, sw::mark::RestoreMode const eMode, bool const bAtStart) @@ -3487,7 +3487,7 @@ bool DocumentContentOperationsManager::ReplaceRange( SwPaM& rPam, const OUString while (!Breaks.empty() // skip over prefix of dummy chars && (aPam.GetMark()->GetNodeIndex() == Breaks.begin()->first) - && (aPam.GetMark()->nContent.GetIndex() == Breaks.begin()->second)) + && (aPam.GetMark()->GetContentIndex() == Breaks.begin()->second)) { // skip! ++aPam.GetMark()->nContent; // always in bounds if Breaks valid @@ -3872,7 +3872,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( if (!bAdd) { // technically old code checked nContent of AT_FLY which is pointless - bAdd = pCopiedPaM && 0 < pCopiedPaM->End()->nContent.GetIndex(); + bAdd = pCopiedPaM && 0 < pCopiedPaM->End()->GetContentIndex(); } } } @@ -3973,8 +3973,8 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( { // only if pCopiedPaM: care about partially selected start node sal_Int32 const nContent = pCopiedPaM && pCopiedPaM->Start()->nNode == aAnchor.GetContentAnchor()->nNode - ? newPos.nContent.GetIndex() - pCopiedPaM->Start()->nContent.GetIndex() - : newPos.nContent.GetIndex(); + ? newPos.GetContentIndex() - pCopiedPaM->Start()->GetContentIndex() + : newPos.GetContentIndex(); newPos.nContent.Assign(newPos.GetNode().GetTextNode(), nContent); } else @@ -4068,11 +4068,11 @@ bool DocumentContentOperationsManager::lcl_RstTextAttr( SwNode* pNd, void* pArgs sal_Int32 nEnd = pTextNode->Len(); if( &pPara->pSttNd->GetNode() == pTextNode && - pPara->pSttNd->nContent.GetIndex() ) - aSt = pPara->pSttNd->nContent.GetIndex(); + pPara->pSttNd->GetContentIndex() ) + aSt = pPara->pSttNd->GetContentIndex(); if( &pPara->pEndNd->GetNode() == pNd ) - nEnd = pPara->pEndNd->nContent.GetIndex(); + nEnd = pPara->pEndNd->GetContentIndex(); if( pPara->pHistory ) { @@ -4291,7 +4291,7 @@ bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam, SwDelet { // if necessary the saved Word for the exception if( m_rDoc.GetAutoCorrExceptWord()->IsDeleted() || pStt->nNode != pEnd->nNode || - pStt->nContent.GetIndex() + 1 != pEnd->nContent.GetIndex() || + pStt->GetContentIndex() + 1 != pEnd->GetContentIndex() || !m_rDoc.GetAutoCorrExceptWord()->CheckDelChar( *pStt )) { m_rDoc.DeleteAutoCorrExceptWord(); } } @@ -4302,7 +4302,7 @@ bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam, SwDelet SwpHints* pHts; if( pTextNd && nullptr != ( pHts = pTextNd->GetpSwpHints()) && pHts->Count() ) { - const sal_Int32 nMkCntPos = rPam.GetMark()->nContent.GetIndex(); + const sal_Int32 nMkCntPos = rPam.GetMark()->GetContentIndex(); for( size_t n = pHts->Count(); n; ) { const SwTextAttr* pAttr = pHts->Get( --n ); @@ -4377,9 +4377,9 @@ bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam, SwDelet { // now move the Content to the new Node bool bOneNd = pStt->nNode == pEnd->nNode; - const sal_Int32 nLen = ( bOneNd ? pEnd->nContent.GetIndex() + const sal_Int32 nLen = ( bOneNd ? pEnd->GetContentIndex() : pCNd->Len() ) - - pStt->nContent.GetIndex(); + - pStt->GetContentIndex(); // Don't call again, if already empty if( nLen ) @@ -4413,10 +4413,10 @@ bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam, SwDelet if( pEndTextNode ) { // if already empty, don't call again - if( pEnd->nContent.GetIndex() ) + if( pEnd->GetContentIndex() ) { SwContentIndex aIdx( pCNd, 0 ); - pEndTextNode->EraseText( aIdx, pEnd->nContent.GetIndex() ); + pEndTextNode->EraseText( aIdx, pEnd->GetContentIndex() ); if( !pEndTextNode->Len() ) { @@ -4460,7 +4460,7 @@ 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. pStt->nContent.Assign( pStt->GetNode().GetContentNode(), - pStt->nContent.GetIndex() ); + pStt->GetContentIndex() ); // If we deleted across Node boundaries we have to correct the PaM, // because they are in different Nodes now. @@ -4499,7 +4499,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt // Own Undo? OUString sRepl( rStr ); SwTextNode* pTextNd = pStt->GetNode().GetTextNode(); - sal_Int32 nStt = pStt->nContent.GetIndex(); + sal_Int32 nStt = pStt->GetContentIndex(); sal_Int32 nEnd; SwDataChanged aTmp( aDelPam ); @@ -4530,7 +4530,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt m_rDoc.getIDocumentMarkAccess()->deleteMark(pBkmk); pStt = aDelPam.Start(); pTextNd = pStt->GetNode().GetTextNode(); - nStt = pStt->nContent.GetIndex(); + nStt = pStt->GetContentIndex(); } if( !sRepl.isEmpty() ) @@ -4553,7 +4553,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt // Remember the End SwNodeIndex aPtNd( aDelPam.GetPoint()->nNode, -1 ); - const sal_Int32 nPtCnt = aDelPam.GetPoint()->nContent.GetIndex(); + const sal_Int32 nPtCnt = aDelPam.GetPoint()->GetContentIndex(); bool bFirst = true; OUString sIns; @@ -4563,7 +4563,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt if( bFirst ) { SwNodeIndex aMkNd( aDelPam.GetMark()->nNode, -1 ); - const sal_Int32 nMkCnt = aDelPam.GetMark()->nContent.GetIndex(); + const sal_Int32 nMkCnt = aDelPam.GetMark()->GetContentIndex(); SplitNode( *aDelPam.GetPoint(), false ); @@ -4646,7 +4646,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt { assert((pStt->nNode == pEnd->nNode || ( pStt->GetNodeIndex() + 1 == pEnd->GetNodeIndex() && - !pEnd->nContent.GetIndex() )) && + !pEnd->GetContentIndex() )) && "invalid range: Point and Mark on different nodes" ); if( !m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline() && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty() ) @@ -4665,11 +4665,11 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt aDelPam.Exchange(); SwNodeIndex aPtNd( pStt->nNode, -1 ); - const sal_Int32 nPtCnt = pStt->nContent.GetIndex(); + const sal_Int32 nPtCnt = pStt->GetContentIndex(); // Set the values again, if Frames or footnotes on the Text have been removed. nStt = nPtCnt; - nEnd = bOneNode ? pEnd->nContent.GetIndex() + nEnd = bOneNode ? pEnd->GetContentIndex() : pTextNd->GetText().getLength(); bool bFirst = true; @@ -4942,7 +4942,7 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo if( !bCanMoveBack ) { pCopyPam->GetPoint()->nNode--; - assert(pCopyPam->GetPoint()->nContent.GetIndex() == 0); + assert(pCopyPam->GetPoint()->GetContentIndex() == 0); } SwNodeRange aRg( pStt->nNode, pEnd->nNode ); @@ -4953,7 +4953,7 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo SwTextNode* pDestTextNd = aInsPos.GetNode().GetTextNode(); bool bCopyCollFormat = !rDoc.IsInsOnlyTextGlossary() && ( (pDestTextNd && !pDestTextNd->GetText().getLength()) || - ( !bOneNode && !rPos.nContent.GetIndex() ) ); + ( !bOneNode && !rPos.GetContentIndex() ) ); bool bCopyBookmarks = true; bool bCopyPageSource = false; SwNodeOffset nDeleteTextNodes(0); @@ -4995,13 +4995,13 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo { ++nDeleteTextNodes; // must be joined in Undo // Don't copy the beginning completely? - if( !bCopyCollFormat || bColumnSel || pStt->nContent.GetIndex() ) + if( !bCopyCollFormat || bColumnSel || pStt->GetContentIndex() ) { SwContentIndex aDestIdx( rPos.nContent ); bool bCopyOk = false; if( !pDestTextNd ) { - if( pStt->nContent.GetIndex() || bOneNode ) + if( pStt->GetContentIndex() || bOneNode ) pDestTextNd = rDoc.GetNodes().MakeTextNode( aInsPos, rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD)); else @@ -5014,7 +5014,7 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo } else if( !bOneNode || bColumnSel ) { - const sal_Int32 nContentEnd = pEnd->nContent.GetIndex(); + const sal_Int32 nContentEnd = pEnd->GetContentIndex(); { ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); rDoc.getIDocumentContentOperations().SplitNode( rPos, false ); @@ -5061,9 +5061,9 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo if( !bCopyOk ) { const sal_Int32 nCpyLen = ( bOneNode - ? pEnd->nContent.GetIndex() + ? pEnd->GetContentIndex() : pSttTextNd->GetText().getLength()) - - pStt->nContent.GetIndex(); + - pStt->GetContentIndex(); pSttTextNd->CopyText( pDestTextNd, aDestIdx, pStt->nContent, nCpyLen ); if( bEndEqualIns ) @@ -5097,16 +5097,16 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo // We have to set the correct PaM for Undo, if this PaM starts in a textnode, // the undo operation will try to merge this node after removing the table. // If we didn't split a textnode, the PaM should start at the inserted table node - if( rPos.nContent.GetIndex() == pDestTextNd->Len() ) + if( rPos.GetContentIndex() == pDestTextNd->Len() ) { // Insertion at the last position of a textnode (empty or not) ++aInsPos; // The table will be inserted behind the text node } - else if( rPos.nContent.GetIndex() ) + else if( rPos.GetContentIndex() ) { // Insertion in the middle of a text node, it has to be split // (and joined from undo) ++nDeleteTextNodes; - const sal_Int32 nContentEnd = pEnd->nContent.GetIndex(); + const sal_Int32 nContentEnd = pEnd->GetContentIndex(); { ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); rDoc.getIDocumentContentOperations().SplitNode( rPos, false ); @@ -5171,7 +5171,7 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo } pEndTextNd->CopyText( pDestTextNd, aDestIdx, SwContentIndex( pEndTextNd ), - pEnd->nContent.GetIndex() ); + pEnd->GetContentIndex() ); // Also copy all format templates if( bCopyCollFormat && ( bOneNode || bEmptyDestNd )) @@ -5290,7 +5290,7 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo // Adjust position (in case it was moved / in another node) rPos.nContent.Assign( rPos.GetNode().GetContentNode(), - rPos.nContent.GetIndex() ); + rPos.GetContentIndex() ); if( rPos.nNode != aInsPos ) { diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx index 842e526dd2c9..81216420bb1e 100644 --- a/sw/source/core/doc/DocumentFieldsManager.cxx +++ b/sw/source/core/doc/DocumentFieldsManager.cxx @@ -1726,7 +1726,7 @@ SwTextField * DocumentFieldsManager::GetTextFieldAtPos(const SwPosition & rPos) SwTextNode * const pNode = rPos.GetNode().GetTextNode(); return (pNode != nullptr) - ? pNode->GetFieldTextAttrAt( rPos.nContent.GetIndex(), true ) + ? pNode->GetFieldTextAttrAt( rPos.GetContentIndex(), true ) : nullptr; } diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx index f045f014273a..b0559ebd215e 100644 --- a/sw/source/core/doc/DocumentLayoutManager.cxx +++ b/sw/source/core/doc/DocumentLayoutManager.cxx @@ -296,7 +296,7 @@ void DocumentLayoutManager::DelLayoutFormat( SwFrameFormat *pFormat ) if ( pTextNd ) { SwTextFlyCnt* const pAttr = static_cast<SwTextFlyCnt*>( - pTextNd->GetTextAttrForCharAt( pPos->nContent.GetIndex(), + pTextNd->GetTextAttrForCharAt( pPos->GetContentIndex(), RES_TXTATR_FLYCNT )); if ( pAttr && (pAttr->GetFlyCnt().GetFrameFormat() == pFormat) ) { @@ -457,7 +457,7 @@ SwFrameFormat *DocumentLayoutManager::CopyLayoutFormat( const SwPosition* pPos = rNewAnchor.GetContentAnchor(); SwFormatFlyCnt aFormat( pDest ); pPos->GetNode().GetTextNode()->InsertItem( - aFormat, pPos->nContent.GetIndex(), 0 ); + aFormat, pPos->GetContentIndex(), 0 ); } if( bMakeFrames ) diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 6eb566b78e95..edf51f8eb0cc 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -397,12 +397,12 @@ namespace bool IsPrevPos( const SwPosition & rPos1, const SwPosition & rPos2 ) { const SwContentNode* pCNd; - if( 0 != rPos2.nContent.GetIndex() ) + if( 0 != rPos2.GetContentIndex() ) return false; if( rPos2.GetNodeIndex() - 1 != rPos1.GetNodeIndex() ) return false; pCNd = rPos1.GetNode().GetContentNode(); - return pCNd && rPos1.nContent.GetIndex() == pCNd->Len(); + return pCNd && rPos1.GetContentIndex() == pCNd->Len(); } // copy style or return with SwRedlineExtra_FormatColl with reject data of the upcoming copy @@ -1025,27 +1025,27 @@ namespace // expand to them. auto [pStt, pEnd] = rPam.StartEnd(); // SwPosition* SwDoc& rDoc = rPam.GetDoc(); - if( !pStt->nContent.GetIndex() && + if( !pStt->GetContentIndex() && !rDoc.GetNodes()[ pStt->GetNodeIndex() - 1 ]->IsContentNode() ) { const SwRangeRedline* pRedl = rDoc.getIDocumentRedlineAccess().GetRedline( *pStt, nullptr ); if( pRedl ) { const SwPosition* pRStt = pRedl->Start(); - if( !pRStt->nContent.GetIndex() && pRStt->GetNodeIndex() == + if( !pRStt->GetContentIndex() && pRStt->GetNodeIndex() == pStt->GetNodeIndex() - 1 ) *pStt = *pRStt; } } if( pEnd->GetNode().IsContentNode() && !rDoc.GetNodes()[ pEnd->GetNodeIndex() + 1 ]->IsContentNode() && - pEnd->nContent.GetIndex() == pEnd->GetNode().GetContentNode()->Len() ) + pEnd->GetContentIndex() == pEnd->GetNode().GetContentNode()->Len() ) { const SwRangeRedline* pRedl = rDoc.getIDocumentRedlineAccess().GetRedline( *pEnd, nullptr ); if( pRedl ) { const SwPosition* pREnd = pRedl->End(); - if( !pREnd->nContent.GetIndex() && pREnd->GetNodeIndex() == + if( !pREnd->GetContentIndex() && pREnd->GetNodeIndex() == pEnd->GetNodeIndex() + 1 ) *pEnd = *pREnd; } @@ -3144,7 +3144,7 @@ const SwRangeRedline* DocumentRedlineManager::SelNextRedline( SwPaM& rPam ) cons SwNodeIndex aTmp( pEnd->nNode ); SwContentNode* pCNd = SwNodes::GoPrevSection( &aTmp ); if( !pCNd || ( aTmp == rSttPos.nNode && - pCNd->Len() == rSttPos.nContent.GetIndex() )) + pCNd->Len() == rSttPos.GetContentIndex() )) pFnd = nullptr; } if( pFnd ) @@ -3270,7 +3270,7 @@ const SwRangeRedline* DocumentRedlineManager::SelPrevRedline( SwPaM& rPam ) cons SwNodeIndex aTmp( pStt->nNode ); SwContentNode* pCNd = m_rDoc.GetNodes().GoNextSection( &aTmp ); if( !pCNd || ( aTmp == rSttPos.nNode && - !rSttPos.nContent.GetIndex() )) + !rSttPos.GetContentIndex() )) pFnd = nullptr; } if( pFnd ) diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx index d95ea954fe73..3d84c57c4a12 100644 --- a/sw/source/core/doc/dbgoutsw.cxx +++ b/sw/source/core/doc/dbgoutsw.cxx @@ -319,7 +319,7 @@ static OUString lcl_dbg_out(const SwPosition & rPos) "( " + OUString::number(sal_Int32(rPos.GetNodeIndex())) + ", " + - OUString::number(rPos.nContent.GetIndex()) + + OUString::number(rPos.GetContentIndex()) + ": " + OUString::number(reinterpret_cast<sal_IntPtr>(rPos.nContent.GetContentNode()), 16) + " )"; diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 7c6e62fd8ea2..82eb590258ef 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1744,8 +1744,8 @@ OUString SwDoc::GetPaMDescr(const SwPaM & rPam) if (nullptr != pTextNode) { - const sal_Int32 nStart = rPam.Start()->nContent.GetIndex(); - const sal_Int32 nEnd = rPam.End()->nContent.GetIndex(); + const sal_Int32 nStart = rPam.Start()->GetContentIndex(); + const sal_Int32 nEnd = rPam.End()->GetContentIndex(); return SwResId(STR_START_QUOTE) + ShortenString(pTextNode->GetText().copy(nStart, nEnd - nStart), diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 2f56cba64c53..83cf9410c6e4 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -211,8 +211,8 @@ namespace { return rFirstStart.nNode < rSecondStart.nNode; } - const sal_Int32 nFirstContent = rFirstStart.nContent.GetIndex(); - const sal_Int32 nSecondContent = rSecondStart.nContent.GetIndex(); + const sal_Int32 nFirstContent = rFirstStart.GetContentIndex(); + const sal_Int32 nSecondContent = rSecondStart.GetContentIndex(); if (nFirstContent != 0 || nSecondContent != 0) { return nFirstContent < nSecondContent; @@ -460,9 +460,9 @@ namespace const SwPosition* const pEndPos = &pMark->GetMarkEnd(); SAL_INFO("sw.core", sal_Int32(pStPos->GetNodeIndex()) << "," << - pStPos->nContent.GetIndex() << " " << + pStPos->GetContentIndex() << " " << sal_Int32(pEndPos->GetNodeIndex()) << "," << - pEndPos->nContent.GetIndex() << " " << + pEndPos->GetContentIndex() << " " << typeid(*pMark).name() << " " << pMark->GetName()); } @@ -515,10 +515,10 @@ OUString IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix() bool IDocumentMarkAccess::IsLegalPaMForCrossRefHeadingBookmark( const SwPaM& rPaM ) { return rPaM.Start()->GetNode().IsTextNode() && - rPaM.Start()->nContent.GetIndex() == 0 && + rPaM.Start()->GetContentIndex() == 0 && ( !rPaM.HasMark() || ( rPaM.GetMark()->nNode == rPaM.GetPoint()->nNode && - rPaM.End()->nContent.GetIndex() == rPaM.End()->GetNode().GetTextNode()->Len() ) ); + rPaM.End()->GetContentIndex() == rPaM.End()->GetNode().GetTextNode()->Len() ) ); } void IDocumentMarkAccess::DeleteFieldmarkCommand(::sw::mark::IFieldmark const& rMark) @@ -554,9 +554,9 @@ namespace sw::mark SAL_INFO("sw.core", rName << " " << sal_Int32(pPos1->GetNodeIndex() )<< "," << - pPos1->nContent.GetIndex() << " " << + pPos1->GetContentIndex() << " " << sal_Int32(pPos2->GetNodeIndex()) << "," << - pPos2->nContent.GetIndex()); + pPos2->GetContentIndex()); } #endif if ( (!rPaM.GetPoint()->GetNode().IsTextNode() @@ -585,7 +585,7 @@ namespace sw::mark ? *rPaM.GetPoint() != *rPaM.GetMark() // CopyText: pam covers CH_TXT_ATR_FORMELEMENT : (rPaM.GetPoint()->nNode != rPaM.GetMark()->nNode - || rPaM.Start()->nContent.GetIndex() + 1 != rPaM.End()->nContent.GetIndex()))) + || rPaM.Start()->GetContentIndex() + 1 != rPaM.End()->GetContentIndex()))) { SAL_WARN("sw.core", "MarkManager::makeMark(..)" " - invalid range on point fieldmark"); @@ -948,7 +948,7 @@ namespace sw::mark aNewPosRel.nContent = 0; // HACK for WW8 import isSortingNeeded = true; // and sort them to be safe... } - aNewPosRel.nContent += pMark->GetMarkPos().nContent.GetIndex(); + aNewPosRel.nContent += pMark->GetMarkPos().GetContentIndex(); pMark->SetMarkPos(aNewPosRel); bChangedPos = true; } @@ -956,7 +956,7 @@ namespace sw::mark &pMark->GetOtherMarkPos().GetNode() == pOldNode) { SwPosition aNewPosRel(aNewPos); - aNewPosRel.nContent += pMark->GetOtherMarkPos().nContent.GetIndex(); + aNewPosRel.nContent += pMark->GetOtherMarkPos().GetContentIndex(); pMark->SetOtherMarkPos(aNewPosRel); bChangedOPos = true; } @@ -1386,7 +1386,7 @@ namespace sw::mark [&rPos] (::sw::mark::MarkBase const*const pMark) { return pMark->GetMarkStart() == rPos // end position includes the CH_TXT_ATR_FIELDEND - || (pMark->GetMarkEnd().nContent.GetIndex() == rPos.nContent.GetIndex() + 1 + || (pMark->GetMarkEnd().GetContentIndex() == rPos.GetContentIndex() + 1 && pMark->GetMarkEnd().nNode == rPos.nNode); } ); return (pFieldmark == m_vFieldmarks.end()) @@ -1487,7 +1487,7 @@ namespace sw::mark IFieldmark* pFieldBM = getFieldmarkFor(aPos); FieldmarkWithDropDownButton* pNewActiveFieldmark = nullptr; if ((!pFieldBM || (pFieldBM->GetFieldname() != ODF_FORMDROPDOWN && pFieldBM->GetFieldname() != ODF_FORMDATE)) - && aPos.nContent.GetIndex() > 0 ) + && aPos.GetContentIndex() > 0 ) { --aPos.nContent; pFieldBM = getFieldmarkFor(aPos); @@ -1818,7 +1818,7 @@ SaveBookmark::SaveBookmark( } } m_nNode1 = rBkmk.GetMarkPos().GetNodeIndex(); - m_nContent1 = rBkmk.GetMarkPos().nContent.GetIndex(); + m_nContent1 = rBkmk.GetMarkPos().GetContentIndex(); m_nNode1 -= rMvPos.GetIndex(); if(pIdx && !m_nNode1) @@ -1827,7 +1827,7 @@ SaveBookmark::SaveBookmark( if(rBkmk.IsExpanded()) { m_nNode2 = rBkmk.GetOtherMarkPos().GetNodeIndex(); - m_nContent2 = rBkmk.GetOtherMarkPos().nContent.GetIndex(); + m_nContent2 = rBkmk.GetOtherMarkPos().GetContentIndex(); m_nNode2 -= rMvPos.GetIndex(); if(pIdx && !m_nNode2) diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 560c0dceb5a4..05d4fc7d580c 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -1745,10 +1745,10 @@ void CompareData::SetRedlinesToDoc( bool bUseDocInfo ) & rEndStt = *pTmp->GetNext()->Start(); const SwContentNode* pCNd; if( rSttEnd == rEndStt || - (!rEndStt.nContent.GetIndex() && + (!rEndStt.GetContentIndex() && rEndStt.GetNodeIndex() - 1 == rSttEnd.GetNodeIndex() && nullptr != ( pCNd = rSttEnd.GetNode().GetContentNode() ) && - rSttEnd.nContent.GetIndex() == pCNd->Len())) + rSttEnd.GetContentIndex() == pCNd->Len())) { if( pTmp->GetNext() == m_pInsertRing.get() ) { @@ -1921,7 +1921,7 @@ SaveMergeRedline::SaveMergeRedline( const SwNode& rDstNd, const SwPosition* pStt = rSrcRedl.Start(); if( rDstNd.IsContentNode() ) - aPos.nContent.Assign( static_cast<const SwContentNode*>(&rDstNd), pStt->nContent.GetIndex() ); + aPos.nContent.Assign( static_cast<const SwContentNode*>(&rDstNd), pStt->GetContentIndex() ); pDestRedl = new SwRangeRedline( rSrcRedl.GetRedlineData(), aPos ); if( RedlineType::Delete != pDestRedl->GetType() ) @@ -1934,7 +1934,7 @@ SaveMergeRedline::SaveMergeRedline( const SwNode& rDstNd, pDestRedl->GetPoint()->nNode += pEnd->GetNodeIndex() - pStt->GetNodeIndex(); pDestRedl->GetPoint()->nContent.Assign( pDestRedl->GetContentNode(), - pEnd->nContent.GetIndex() ); + pEnd->GetContentIndex() ); } sal_uInt16 SaveMergeRedline::InsertRedline(SwPaM* pLastDestRedline) @@ -1948,7 +1948,7 @@ sal_uInt16 SaveMergeRedline::InsertRedline(SwPaM* pLastDestRedline) ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo()); SwNodeIndex aSaveNd( pDestRedl->GetPoint()->nNode, -1 ); - const sal_Int32 nSaveCnt = pDestRedl->GetPoint()->nContent.GetIndex(); + const sal_Int32 nSaveCnt = pDestRedl->GetPoint()->GetContentIndex(); RedlineFlags eOld = rDoc.getIDocumentRedlineAccess().GetRedlineFlags(); rDoc.getIDocumentRedlineAccess().SetRedlineFlags_intern(eOld | RedlineFlags::Ignore); diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx index ca618dcef877..1d2d625e3203 100644 --- a/sw/source/core/doc/doccorr.cxx +++ b/sw/source/core/doc/doccorr.cxx @@ -78,7 +78,7 @@ namespace pPam->GetBound(bool(nb)).nNode = rNewPos.nNode; pPam->GetBound(bool(nb)).nContent.Assign( rNewPos.GetNode().GetContentNode(), - nCntIdx + pPam->GetBound(bool(nb)).nContent.GetIndex()); + nCntIdx + pPam->GetBound(bool(nb)).GetContentIndex()); } } } @@ -246,7 +246,7 @@ void PaMCorrRel( const SwNodeIndex &rOldNode, SwPosition aNewPos( rNewPos ); const SwDoc& rDoc = pOldNode->GetDoc(); - const sal_Int32 nCntIdx = rNewPos.nContent.GetIndex() + nOffset; + const sal_Int32 nCntIdx = rNewPos.GetContentIndex() + nOffset; SwCursorShell const* pShell = rDoc.GetEditShell(); if( pShell ) @@ -315,7 +315,7 @@ void SwDoc::CorrRel(const SwNodeIndex& rOldNode, for(SwRangeRedline* p : rTable) { // lies on the position ?? - lcl_PaMCorrRel1( p, &rOldNode.GetNode(), aNewPos, aNewPos.nContent.GetIndex() + nOffset ); + lcl_PaMCorrRel1( p, &rOldNode.GetNode(), aNewPos, aNewPos.GetContentIndex() + nOffset ); } // To-Do - need to add here 'SwExtraRedlineTable' also ? diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 4e545432acb6..0ae0092bae49 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -90,7 +90,7 @@ void RestFlyInRange( SaveFlyArr & rArr, const SwPosition& rStartPos, assert(aPos.GetNode().GetContentNode()); aPos.nContent.Assign(aPos.GetNode().GetContentNode(), rSave.nNdDiff == SwNodeOffset(0) - ? rStartPos.nContent.GetIndex() + rSave.nContentIndex + ? rStartPos.GetContentIndex() + rSave.nContentIndex : rSave.nContentIndex); } @@ -120,7 +120,7 @@ void SaveFlyInRange( const SwNodeRange& rRg, SaveFlyArr& rArr ) { SaveFly aSave( pAPos->GetNodeIndex() - rRg.aStart.GetIndex(), (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId()) - ? pAPos->nContent.GetIndex() + ? pAPos->GetContentIndex() : 0, pFormat, false ); rArr.push_back( aSave ); @@ -149,7 +149,7 @@ void SaveFlyInRange( const SwPaM& rPam, const SwPosition& rInsPos, if (bMoveAllFlys) { assert(!rPam.End()->GetNode().IsTextNode() // can be table end-node - || rPam.End()->nContent.GetIndex() == rPam.End()->GetNode().GetTextNode()->Len()); + || rPam.End()->GetContentIndex() == rPam.End()->GetNode().GetTextNode()->Len()); ++atParaEnd.nNode; atParaEnd.nContent.Assign(atParaEnd.GetNode().GetContentNode(), 0); } @@ -189,8 +189,8 @@ void SaveFlyInRange( const SwPaM& rPam, const SwPosition& rInsPos, SaveFly aSave( pAPos->GetNodeIndex() - rSttNdIdx.GetIndex(), (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId()) ? (pAPos->nNode == rSttNdIdx) - ? pAPos->nContent.GetIndex() - rPam.Start()->nContent.GetIndex() - : pAPos->nContent.GetIndex() + ? pAPos->GetContentIndex() - rPam.Start()->GetContentIndex() + : pAPos->GetContentIndex() : 0, pFormat, bInsPos ); rArr.push_back( aSave ); @@ -345,14 +345,14 @@ void sw_GetJoinFlags( SwPaM& rPam, bool& rJoinText, bool& rJoinPrev ) return; bool bExchange = pStt == rPam.GetPoint(); - if( !pStt->nContent.GetIndex() && - pEndNd->GetText().getLength() != pEnd->nContent.GetIndex()) + if( !pStt->GetContentIndex() && + pEndNd->GetText().getLength() != pEnd->GetContentIndex()) bExchange = !bExchange; if( bExchange ) rPam.Exchange(); rJoinPrev = rPam.GetPoint() == pStt; - OSL_ENSURE( !pStt->nContent.GetIndex() && - pEndNd->GetText().getLength() != pEnd->nContent.GetIndex() + OSL_ENSURE( !pStt->GetContentIndex() && + pEndNd->GetText().getLength() != pEnd->GetContentIndex() ? (rPam.GetPoint()->nNode < rPam.GetMark()->nNode) : (rPam.GetPoint()->nNode > rPam.GetMark()->nNode), "sw_GetJoinFlags"); @@ -593,7 +593,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM, aCursor.GoSentence( SwCursor::START_SENT ); if( aOrigPos != *aCursor.GetPoint() ) { - nBeginGrammarCheck = aCursor.GetPoint()->nContent.GetIndex(); + nBeginGrammarCheck = aCursor.GetPoint()->GetContentIndex(); } } nEndGrammarCheck = (pSpellArgs->pEndNode == pNd) @@ -741,14 +741,14 @@ SwHyphArgs::SwHyphArgs( const SwPaM *pPam, const Point &rCursorPos, // Set start m_pStart = pPoint->GetNode().GetTextNode(); - m_nPamStart = pPoint->nContent.GetIndex(); + m_nPamStart = pPoint->GetContentIndex(); // Set End and Length const SwPosition *pMark = pPam->GetMark(); m_pEnd = pMark->GetNode().GetTextNode(); - m_nPamLen = pMark->nContent.GetIndex(); + m_nPamLen = pMark->GetContentIndex(); if( pPoint->nNode == pMark->nNode ) - m_nPamLen = m_nPamLen - pPoint->nContent.GetIndex(); + m_nPamLen = m_nPamLen - pPoint->GetContentIndex(); } inline void SwHyphArgs::SetRange( const SwNode *pNew ) @@ -849,8 +849,8 @@ void SwDoc::CountWords( const SwPaM& rPaM, SwDocStat& rStat ) const SwNodeOffset nSttNd = pStt->GetNodeIndex(); const SwNodeOffset nEndNd = pEnd->GetNodeIndex(); - const sal_Int32 nSttCnt = pStt->nContent.GetIndex(); - const sal_Int32 nEndCnt = pEnd->nContent.GetIndex(); + const sal_Int32 nSttCnt = pStt->GetContentIndex(); + const sal_Int32 nEndCnt = pEnd->GetContentIndex(); const SwTextNode* pTNd = pStt->GetNode().GetTextNode(); if( pStt == pEnd && pTNd ) // no region ? diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index ddab1366b4a3..1a52a8458cd7 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -104,7 +104,7 @@ SetGetExpField::SetGetExpField( const SwSectionNode& rSectNd, if( pPos ) { m_nNode = pPos->GetNodeIndex(); - m_nContent = pPos->nContent.GetIndex(); + m_nContent = pPos->GetContentIndex(); } else { @@ -124,12 +124,12 @@ SetGetExpField::SetGetExpField(::sw::mark::IBookmark const& rBookmark, if (pPos) { m_nNode = pPos->GetNodeIndex(); - m_nContent = pPos->nContent.GetIndex(); + m_nContent = pPos->GetContentIndex(); } else { m_nNode = rBookmark.GetMarkStart().GetNodeIndex(); - m_nContent = rBookmark.GetMarkStart().nContent.GetIndex();; + m_nContent = rBookmark.GetMarkStart().GetContentIndex();; } } @@ -163,7 +163,7 @@ SetGetExpField::SetGetExpField( const SwPosition& rPos ) m_eSetGetExpFieldType = CRSRPOS; m_CNTNT.pPos = &rPos; m_nNode = rPos.GetNodeIndex(); - m_nContent = rPos.nContent.GetIndex(); + m_nContent = rPos.GetContentIndex(); } SetGetExpField::SetGetExpField( const SwFlyFrameFormat& rFlyFormat, @@ -174,7 +174,7 @@ SetGetExpField::SetGetExpField( const SwFlyFrameFormat& rFlyFormat, if( pPos ) { m_nNode = pPos->GetNodeIndex(); - m_nContent = pPos->nContent.GetIndex(); + m_nContent = pPos->GetContentIndex(); } else { @@ -214,7 +214,7 @@ void SetGetExpField::SetBodyPos( const SwContentFrame& rFrame ) bool const bResult = ::GetBodyTextNode( rDoc, aPos, rFrame ); OSL_ENSURE(bResult, "Where is the field?"); m_nNode = aPos.GetNodeIndex(); - m_nContent = aPos.nContent.GetIndex(); + m_nContent = aPos.GetContentIndex(); } } @@ -353,10 +353,10 @@ sal_Int32 SetGetExpField::GetCntPosFromContent() const nRet = m_CNTNT.pTextTOX->GetStart(); break; case BOOKMARK: - nRet = m_CNTNT.pBookmark->GetMarkStart().nContent.GetIndex(); + nRet = m_CNTNT.pBookmark->GetMarkStart().GetContentIndex(); break; case CRSRPOS: - nRet = m_CNTNT.pPos->nContent.GetIndex(); + nRet = m_CNTNT.pPos->GetContentIndex(); break; default: break; diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index 8434ebc53355..9915e7de01b2 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -308,7 +308,7 @@ sal_Int8 SwDoc::SetFlyFrameAnchor( SwFrameFormat& rFormat, SfxItemSet& rSet, boo const SwPosition *pPos = rOldAnch.GetContentAnchor(); SwTextNode *pTextNode = pPos->GetNode().GetTextNode(); OSL_ENSURE( pTextNode->HasHints(), "Missing FlyInCnt-Hint." ); - const sal_Int32 nIdx = pPos->nContent.GetIndex(); + const sal_Int32 nIdx = pPos->GetContentIndex(); SwTextAttr * const pHint = pTextNode->GetTextAttrForCharAt( nIdx, RES_TXTATR_FLYCNT ); OSL_ENSURE( pHint && pHint->Which() == RES_TXTATR_FLYCNT, @@ -338,7 +338,7 @@ sal_Int8 SwDoc::SetFlyFrameAnchor( SwFrameFormat& rFormat, SfxItemSet& rSet, boo OSL_ENSURE( pNd, "Cursor does not point to TextNode." ); SwFormatFlyCnt aFormat( static_cast<SwFlyFrameFormat*>(&rFormat) ); - pNd->InsertItem( aFormat, pPos->nContent.GetIndex(), 0 ); + pNd->InsertItem( aFormat, pPos->GetContentIndex(), 0 ); } if( SfxItemState::SET != rSet.GetItemState( RES_VERT_ORIENT, false )) @@ -913,7 +913,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, OSL_ENSURE( pNd, "Cursor not positioned at TextNode." ); SwFormatFlyCnt aFormat( pContact->GetFormat() ); - pNd->InsertItem( aFormat, aPos.nContent.GetIndex(), 0 ); + pNd->InsertItem( aFormat, aPos.GetContentIndex(), 0 ); // Has a textbox attached to the format? Sync it as well! if (pContact->GetFormat() && pContact->GetFormat()->GetOtherTextBoxFormats()) @@ -981,7 +981,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, // The TextAttribut needs to be destroyed which, unfortunately, also // destroys the format. To avoid that, we disconnect the format from // the attribute. - const sal_Int32 nIndx( xOldAsCharAnchorPos->nContent.GetIndex() ); + const sal_Int32 nIndx( xOldAsCharAnchorPos->GetContentIndex() ); SwTextNode* pTextNode( xOldAsCharAnchorPos->GetNode().GetTextNode() ); assert(pTextNode && "<SwDoc::ChgAnchor(..)> - missing previous anchor text node for as-character anchored object"); SwTextAttr * const pHint = diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 24ce692c2568..12268a915872 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -337,7 +337,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, bool bAdd = true; SwNodeIndex aTmpStt( pStt->nNode ); SwNodeIndex aTmpEnd( pEnd->nNode ); - if( pStt->nContent.GetIndex() ) // just one part + if( pStt->GetContentIndex() ) // just one part { // set up a later, and all CharFormatAttr -> TextFormatAttr SwTextNode* pTNd = aTmpStt.GetNode().GetTextNode(); @@ -356,13 +356,13 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, ++aTmpStt; } - if( pEnd->nContent.GetIndex() == pEnd->GetNode().GetContentNode()->Len() ) + if( pEnd->GetContentIndex() == pEnd->GetNode().GetContentNode()->Len() ) { // set up a later, and all CharFormatAttr -> TextFormatAttr ++aTmpEnd; bAdd = false; } - else if( pStt->nNode != pEnd->nNode || !pStt->nContent.GetIndex() ) + else if( pStt->nNode != pEnd->nNode || !pStt->GetContentIndex() ) { SwTextNode* pTNd = aTmpEnd.GetNode().GetTextNode(); if( pTNd && pTNd->HasSwAttrSet() && pTNd->GetpSwAttrSet()->Count() ) @@ -411,13 +411,13 @@ void SwDoc::UpdateRsid( const SwPaM &rRg, const sal_Int32 nLen ) { return; } - const sal_Int32 nStart(rRg.GetPoint()->nContent.GetIndex() - nLen); + const sal_Int32 nStart(rRg.GetPoint()->GetContentIndex() - nLen); SvxRsidItem aRsid( mnRsid, RES_CHRATR_RSID ); SfxItemSetFixed<RES_CHRATR_RSID, RES_CHRATR_RSID> aSet(GetAttrPool()); aSet.Put(aRsid); bool const bRet(pTextNode->SetAttr(aSet, nStart, - rRg.GetPoint()->nContent.GetIndex())); + rRg.GetPoint()->GetContentIndex())); if (bRet && GetIDocumentUndoRedo().DoesUndo()) { @@ -1842,7 +1842,7 @@ void SwDoc::SetFormatItemByAutoFormat( const SwPaM& rPam, const SfxItemSet& rSet getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld | RedlineFlags::Ignore ); } - const sal_Int32 nEnd(rPam.End()->nContent.GetIndex()); + const sal_Int32 nEnd(rPam.End()->GetContentIndex()); std::vector<WhichPair> whichIds; SfxItemIter iter(rSet); for (SfxPoolItem const* pItem = iter.GetCurItem(); pItem; pItem = iter.NextItem()) diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index cdc13e4284de..59ef1da0aede 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -437,9 +437,9 @@ bool SwDoc::SetCurFootnote( const SwPaM& rPam, const OUString& rNumStr, auto [pStt, pEnd] = rPam.StartEnd(); // SwPosition* const SwNodeOffset nSttNd = pStt->GetNodeIndex(); - const sal_Int32 nSttCnt = pStt->nContent.GetIndex(); + const sal_Int32 nSttCnt = pStt->GetContentIndex(); const SwNodeOffset nEndNd = pEnd->GetNodeIndex(); - const sal_Int32 nEndCnt = pEnd->nContent.GetIndex(); + const sal_Int32 nEndCnt = pEnd->GetContentIndex(); size_t nPos = 0; rFootnoteArr.SeekEntry( pStt->nNode, &nPos ); diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 5c1297a48ccb..8b9cd0ee6484 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -234,7 +234,7 @@ SwFlyFrameFormat* SwDoc::MakeFlySection_( const SwPosition& rAnchPos, if ( RndStdIds::FLY_AS_CHAR == eAnchorId ) { - const sal_Int32 nStt = rAnchPos.nContent.GetIndex(); + const sal_Int32 nStt = rAnchPos.GetContentIndex(); SwTextNode * pTextNode = rAnchPos.GetNode().GetTextNode(); OSL_ENSURE(pTextNode!= nullptr, "There should be a SwTextNode!"); @@ -277,7 +277,7 @@ SwFlyFrameFormat* SwDoc::MakeFlySection_( const SwPosition& rAnchPos, if (GetIDocumentUndoRedo().DoesUndo()) { SwNodeOffset nNodeIdx = rAnchPos.GetNodeIndex(); - const sal_Int32 nCntIdx = rAnchPos.nContent.GetIndex(); + const sal_Int32 nCntIdx = rAnchPos.GetContentIndex(); GetIDocumentUndoRedo().AppendUndo( std::make_unique<SwUndoInsLayFormat>( pFormat, nNodeIdx, nCntIdx )); } @@ -475,19 +475,19 @@ static bool lcl_TstFlyRange( const SwPaM* pPam, const SwPosition* pFlyPos, const SwNodeOffset nPamEndIndex = pPaMEnd->GetNodeIndex(); if (RndStdIds::FLY_AT_PARA == nAnchorId) bOk = (nPamStartIndex < nFlyIndex && nPamEndIndex > nFlyIndex) || - (((nPamStartIndex == nFlyIndex) && (pPaMStart->nContent.GetIndex() == 0)) && + (((nPamStartIndex == nFlyIndex) && (pPaMStart->GetContentIndex() == 0)) && (nPamEndIndex > nFlyIndex)); else { - const sal_Int32 nFlyContentIndex = pFlyPos->nContent.GetIndex(); - const sal_Int32 nPamEndContentIndex = pPaMEnd->nContent.GetIndex(); + const sal_Int32 nFlyContentIndex = pFlyPos->GetContentIndex(); + const sal_Int32 nPamEndContentIndex = pPaMEnd->GetContentIndex(); bOk = (nPamStartIndex < nFlyIndex && (( nPamEndIndex > nFlyIndex )|| ((nPamEndIndex == nFlyIndex) && (nPamEndContentIndex > nFlyContentIndex))) ) || (((nPamStartIndex == nFlyIndex) && - (pPaMStart->nContent.GetIndex() <= nFlyContentIndex)) && + (pPaMStart->GetContentIndex() <= nFlyContentIndex)) && ((nPamEndIndex > nFlyIndex) || (nPamEndContentIndex > nFlyContentIndex ))); } @@ -793,7 +793,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable, const SwPosition *pPos = rAnchor.GetContentAnchor(); SwTextNode *pTextNode = pPos->GetNode().GetTextNode(); OSL_ENSURE( pTextNode->HasHints(), "Missing FlyInCnt-Hint." ); - const sal_Int32 nIdx = pPos->nContent.GetIndex(); + const sal_Int32 nIdx = pPos->GetContentIndex(); SwTextAttr * const pHint = pTextNode->GetTextAttrForCharAt(nIdx, RES_TXTATR_FLYCNT); @@ -1112,7 +1112,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable const SwPosition *pPos = rAnchor.GetContentAnchor(); SwTextNode *pTextNode = pPos->GetNode().GetTextNode(); OSL_ENSURE( pTextNode->HasHints(), "Missing FlyInCnt-Hint." ); - const sal_Int32 nIdx = pPos->nContent.GetIndex(); + const sal_Int32 nIdx = pPos->GetContentIndex(); SwTextAttr * const pHint = pTextNode->GetTextAttrForCharAt( nIdx, RES_TXTATR_FLYCNT ); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 239a534264de..4b6e4d1b0152 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -2103,11 +2103,11 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, // Is completely in the range and is the own Redline too? if( aTmpRedl.IsOwnRedline( *pTmp ) && (pRStt->nNode < pStt->nNode || - (pRStt->nNode == pStt->nNode && !pRStt->nContent.GetIndex()) ) && + (pRStt->nNode == pStt->nNode && !pRStt->GetContentIndex()) ) && (pEnd->nNode < pREnd->nNode || (pEnd->nNode == pREnd->nNode && - pCEndNd ? pREnd->nContent.GetIndex() == pCEndNd->Len() - : !pREnd->nContent.GetIndex() )) ) + pCEndNd ? pREnd->GetContentIndex() == pCEndNd->Len() + : !pREnd->GetContentIndex() )) ) { pOwnRedl = pTmp; if( nRedlPos + 1 < getIDocumentRedlineAccess().GetRedlineTable().size() ) @@ -2122,7 +2122,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, ( pRStt->nNode > aIdx || aIdx > pREnd->nNode || // pOwnRedl doesn't start at the beginning of a node, so it's not // possible to resize it to contain the line moved before it - ( pRStt->nNode == aIdx && pRStt->nContent.GetIndex() > 0 ) ) ) + ( pRStt->nNode == aIdx && pRStt->GetContentIndex() > 0 ) ) ) { // it's not in itself, so don't move it pOwnRedl = nullptr; @@ -2211,9 +2211,9 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, SwNodeOffset const nCurrentOffset( nOrigIdx - aPam.Start()->GetNodeIndex()); pam.GetPoint()->nNode += nCurrentOffset; - pam.GetPoint()->nContent.Assign(pam.GetPoint()->GetNode().GetContentNode(), pam.GetPoint()->nContent.GetIndex()); + pam.GetPoint()->nContent.Assign(pam.GetPoint()->GetNode().GetContentNode(), pam.GetPoint()->GetContentIndex()); pam.GetMark()->nNode += nCurrentOffset; - pam.GetMark()->nContent.Assign(pam.GetMark()->GetNode().GetContentNode(), pam.GetMark()->nContent.GetIndex()); + pam.GetMark()->nContent.Assign(pam.GetMark()->GetNode().GetContentNode(), pam.GetMark()->GetContentIndex()); pNewRedline = new SwRangeRedline( RedlineType::Delete, pam ); } diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index c085b5012cd9..7457b11ee2c1 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -1385,8 +1385,8 @@ void SwRangeRedline::InvalidateRange(Invalidation const eWhy) auto [pRStt, pREnd] = StartEnd(); // SwPosition* SwNodeOffset nSttNd = pRStt->GetNodeIndex(), nEndNd = pREnd->GetNodeIndex(); - sal_Int32 nSttCnt = pRStt->nContent.GetIndex(); - sal_Int32 nEndCnt = pREnd->nContent.GetIndex(); + sal_Int32 nSttCnt = pRStt->GetContentIndex(); + sal_Int32 nEndCnt = pREnd->GetContentIndex(); SwNodes& rNds = GetDoc().GetNodes(); for (SwNodeOffset n(nSttNd); n <= nEndNd; ++n) @@ -1439,7 +1439,7 @@ void SwRangeRedline::CalcStartEnd( SwNodeOffset nNdIdx, sal_Int32& rStart, sal_I else if (pREnd->nNode == nNdIdx) { rStart = 0; // Paragraph is overlapped in the beginning - rEnd = pREnd->nContent.GetIndex(); + rEnd = pREnd->GetContentIndex(); } else // redline ends before paragraph { @@ -1449,9 +1449,9 @@ void SwRangeRedline::CalcStartEnd( SwNodeOffset nNdIdx, sal_Int32& rStart, sal_I } else if( pRStt->nNode == nNdIdx ) { - rStart = pRStt->nContent.GetIndex(); + rStart = pRStt->GetContentIndex(); if( pREnd->nNode == nNdIdx ) - rEnd = pREnd->nContent.GetIndex(); // Within the Paragraph + rEnd = pREnd->GetContentIndex(); // Within the Paragraph else rEnd = COMPLETE_STRING; // Paragraph is overlapped in the end } @@ -1480,8 +1480,8 @@ static void lcl_storeAnnotationMarks(SwDoc& rDoc, const SwPosition* pStt, const // 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; - SwPaM aPam( rStartPos.nNode, rStartPos.nContent.GetIndex(), - rStartPos.nNode, rStartPos.nContent.GetIndex() + nLen); + SwPaM aPam( rStartPos.nNode, rStartPos.GetContentIndex(), + rStartPos.nNode, rStartPos.GetContentIndex() + nLen); ::sw::mark::IMark* pMark = rDMA.makeAnnotationBookmark( aPam, (**iter).GetName(), @@ -1791,7 +1791,7 @@ void SwRangeRedline::MoveFromSection(size_t nMyPos) ? pCNd->GetFormatColl() : nullptr; SwNodeIndex aNdIdx( GetPoint()->nNode, -1 ); - const sal_Int32 nPos = GetPoint()->nContent.GetIndex(); + const sal_Int32 nPos = GetPoint()->GetContentIndex(); SwPosition aPos( *GetPoint() ); if( m_bDelLastPara && *aPam.GetPoint() == *aPam.GetMark() ) @@ -1991,7 +1991,7 @@ OUString SwRangeRedline::GetDescr(bool bSimplified) OUString sDescr = DenoteSpecialCharacters(pPaM->GetText().replace('\n', ' '), /*bQuoted=*/!bSimplified); if (const SwTextNode *pTextNode = pPaM->GetNode().GetTextNode()) { - if (const SwTextAttr* pTextAttr = pTextNode->GetFieldTextAttrAt(pPaM->GetPoint()->nContent.GetIndex() - 1, true )) + if (const SwTextAttr* pTextAttr = pTextNode->GetFieldTextAttrAt(pPaM->GetPoint()->GetContentIndex() - 1, true )) { sDescr = ( bSimplified ? "" : SwResId(STR_START_QUOTE) ) + pTextAttr->GetFormatField().GetField()->GetFieldName() diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx index 801f4b92653b..851695e80b8d 100644 --- a/sw/source/core/doc/docruby.cxx +++ b/sw/source/core/doc/docruby.cxx @@ -178,7 +178,7 @@ bool SwDoc::SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry ) SwPosition* pPos = rPam.GetPoint(); const SwTextNode* pTNd = pPos->GetNode().GetTextNode(); OUString const& rText = pTNd->GetText(); - sal_Int32 nStart = pPos->nContent.GetIndex(); + sal_Int32 nStart = pPos->GetContentIndex(); sal_Int32 nEnd = rText.getLength(); bool bHasMark = rPam.HasMark(); @@ -188,7 +188,7 @@ bool SwDoc::SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry ) if( rPam.GetMark()->nNode == pPos->nNode ) { // then use that end - const sal_Int32 nTEnd = rPam.GetMark()->nContent.GetIndex(); + const sal_Int32 nTEnd = rPam.GetMark()->GetContentIndex(); if( nTEnd < nEnd ) nEnd = nTEnd; } @@ -248,7 +248,7 @@ bool SwDoc::SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry ) { rPam.SetMark(); pPos->nContent = pAttr->GetAnyEnd(); - if( pPos->nContent.GetIndex() > nEnd ) + if( pPos->GetContentIndex() > nEnd ) pPos->nContent = nEnd; rEntry.SetRubyAttr( pAttr->GetRuby() ); } @@ -304,12 +304,12 @@ bool SwDoc::SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry ) } } pTNd->GoNext( &pPos->nContent, SwCursorSkipMode::Chars ); - nStart = pPos->nContent.GetIndex(); + nStart = pPos->GetContentIndex(); } - nStart = rPam.GetMark()->nContent.GetIndex(); + nStart = rPam.GetMark()->GetContentIndex(); rEntry.SetText( rText.copy( nStart, - rPam.GetPoint()->nContent.GetIndex() - nStart )); + rPam.GetPoint()->GetContentIndex() - nStart )); return rPam.HasMark(); } diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index c65b060e3fa7..b98419b81857 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -126,7 +126,7 @@ sal_uInt16 SwDoc::GetCurTOXMark( const SwPosition& rPos, sal_Int32 nSttIdx; const sal_Int32 *pEndIdx; - const sal_Int32 nCurrentPos = rPos.nContent.GetIndex(); + const sal_Int32 nCurrentPos = rPos.GetContentIndex(); for( size_t n = 0; n < rHts.Count(); ++n ) { diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx index a9927a4e0ec3..8fd2a751bcc8 100644 --- a/sw/source/core/doc/extinput.cxx +++ b/sw/source/core/doc/extinput.cxx @@ -55,7 +55,7 @@ SwExtTextInput::~SwExtTextInput() SwContentIndex& rIdx = GetPoint()->nContent; sal_Int32 nSttCnt = rIdx.GetIndex(); - sal_Int32 nEndCnt = GetMark()->nContent.GetIndex(); + sal_Int32 nEndCnt = GetMark()->GetContentIndex(); if( nEndCnt == nSttCnt ) return; @@ -153,8 +153,8 @@ void SwExtTextInput::SetInputData( const CommandExtTextInputData& rData ) if( !pTNd ) return; - sal_Int32 nSttCnt = Start()->nContent.GetIndex(); - sal_Int32 nEndCnt = End()->nContent.GetIndex(); + sal_Int32 nSttCnt = Start()->GetContentIndex(); + sal_Int32 nEndCnt = End()->GetContentIndex(); SwContentIndex aIdx( pTNd, nSttCnt ); const OUString& rNewStr = rData.GetText(); @@ -227,8 +227,8 @@ void SwExtTextInput::SetOverwriteCursor( bool bFlag ) if (!pTNd) return; - const sal_Int32 nSttCnt = GetPoint()->nContent.GetIndex(); - const sal_Int32 nEndCnt = GetMark()->nContent.GetIndex(); + const sal_Int32 nSttCnt = GetPoint()->GetContentIndex(); + const sal_Int32 nEndCnt = GetMark()->GetContentIndex(); m_sOverwriteText = pTNd->GetText().copy( std::min(nSttCnt, nEndCnt) ); if( m_sOverwriteText.isEmpty() ) return; @@ -282,8 +282,8 @@ SwExtTextInput* SwDoc::GetExtTextInput( const SwNode& rNd, do { SwNodeOffset nStartNode = pTmp->Start()->GetNodeIndex(), nEndNode = pTmp->End()->GetNodeIndex(); - sal_Int32 nStartCnt = pTmp->Start()->nContent.GetIndex(); - sal_Int32 nEndCnt = pTmp->End()->nContent.GetIndex(); + sal_Int32 nStartCnt = pTmp->Start()->GetContentIndex(); + sal_Int32 nEndCnt = pTmp->End()->GetContentIndex(); if( nStartNode <= nNdIdx && nNdIdx <= nEndNode && ( nContentPos<0 || diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx index 5bb22e4e7713..a364f0aeb234 100644 --- a/sw/source/core/doc/swserv.cxx +++ b/sw/source/core/doc/swserv.cxx @@ -277,13 +277,13 @@ void SwServerObject::SetDdeBookmark( ::sw::mark::IMark& rBookmark) SwDataChanged::SwDataChanged( const SwPaM& rPam ) : m_pPam( &rPam ), m_pPos( nullptr ), m_rDoc( rPam.GetDoc() ) { - m_nContent = rPam.GetPoint()->nContent.GetIndex(); + m_nContent = rPam.GetPoint()->GetContentIndex(); } SwDataChanged::SwDataChanged( SwDoc& rDc, const SwPosition& rPos ) : m_pPam( nullptr ), m_pPos( &rPos ), m_rDoc( rDc ) { - m_nContent = rPos.nContent.GetIndex(); + m_nContent = rPos.GetContentIndex(); } SwDataChanged::~SwDataChanged() |