diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-08-01 10:30:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-08-02 15:11:17 +0200 |
commit | af23d1c1fc407b3d5f020122e2830959d45ffaf1 (patch) | |
tree | 4ff56a1fd767efc3aa05266bc7038e811d1450ee /sw/source/filter | |
parent | 961d42e1ca1da7f3199d46445b3766d9c6a6c938 (diff) |
introduce SwPosition::GetContentIndex
as part of the process of hiding the internals of SwPosition
largely done by doing:
git grep -lF 'nContent.GetIndex' | xargs perl -pi -e
's/\bnContent\.GetIndex/GetContentIndex/g'
Change-Id: I12684071a6666c365dbadbab2a4b37cf51b274d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137695
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter')
31 files changed, 161 insertions, 161 deletions
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx index ebcf5965616e..afa4516ea621 100644 --- a/sw/source/filter/ascii/ascatr.cxx +++ b/sw/source/filter/ascii/ascatr.cxx @@ -215,19 +215,19 @@ public: if (nRedlineStart == COMPLETE_STRING) { nRedlineStart = pStart->GetNodeIndex() == m_rNode.GetIndex() - ? pStart->nContent.GetIndex() + ? pStart->GetContentIndex() : 0; } else { - if (pStart->nContent.GetIndex() != nRedlineEnd) + if (pStart->GetContentIndex() != nRedlineEnd) { - assert(nRedlineEnd < pStart->nContent.GetIndex()); + assert(nRedlineEnd < pStart->GetContentIndex()); break; // no increment, revisit it next call } } nRedlineEnd = pEnd->GetNodeIndex() == m_rNode.GetIndex() - ? pEnd->nContent.GetIndex() + ? pEnd->GetContentIndex() : COMPLETE_STRING; } return std::make_pair(nRedlineStart, nRedlineEnd); @@ -242,12 +242,12 @@ static Writer& OutASC_SwTextNode( Writer& rWrt, SwContentNode& rNode ) { const SwTextNode& rNd = static_cast<SwTextNode&>(rNode); - sal_Int32 nStrPos = rWrt.m_pCurrentPam->GetPoint()->nContent.GetIndex(); + sal_Int32 nStrPos = rWrt.m_pCurrentPam->GetPoint()->GetContentIndex(); const sal_Int32 nNodeEnd = rNd.Len(); sal_Int32 nEnd = nNodeEnd; bool bLastNd = rWrt.m_pCurrentPam->GetPoint()->nNode == rWrt.m_pCurrentPam->GetMark()->nNode; if( bLastNd ) - nEnd = rWrt.m_pCurrentPam->GetMark()->nContent.GetIndex(); + nEnd = rWrt.m_pCurrentPam->GetMark()->GetContentIndex(); bool bIsOneParagraph = rWrt.m_pOrigPam->Start()->nNode == rWrt.m_pOrigPam->End()->nNode && !getenv("SW_ASCII_COPY_NUMBERING"); diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx index 01cf3fd8cbef..b1e7c2bc2bac 100644 --- a/sw/source/filter/ascii/parasc.cxx +++ b/sw/source/filter/ascii/parasc.cxx @@ -161,7 +161,7 @@ ErrCode SwASCIIParser::CallParser() { const SwNodeIndex& rTmp = m_pPam->GetPoint()->nNode; pInsPam.emplace( rTmp, rTmp, SwNodeOffset(0), SwNodeOffset(-1) ); - nSttContent = m_pPam->GetPoint()->nContent.GetIndex(); + nSttContent = m_pPam->GetPoint()->GetContentIndex(); } SwTextFormatColl *pColl = nullptr; diff --git a/sw/source/filter/ascii/wrtasc.cxx b/sw/source/filter/ascii/wrtasc.cxx index 5e4480524f43..d06299ce2b0f 100644 --- a/sw/source/filter/ascii/wrtasc.cxx +++ b/sw/source/filter/ascii/wrtasc.cxx @@ -124,7 +124,7 @@ ErrCode SwASCWriter::WriteStream() bool bTstFly = true; while( m_pCurrentPam->GetPoint()->GetNodeIndex() < m_pCurrentPam->GetMark()->GetNodeIndex() || (m_pCurrentPam->GetPoint()->GetNodeIndex() == m_pCurrentPam->GetMark()->GetNodeIndex() && - m_pCurrentPam->GetPoint()->nContent.GetIndex() <= m_pCurrentPam->GetMark()->nContent.GetIndex()) ) + m_pCurrentPam->GetPoint()->GetContentIndex() <= m_pCurrentPam->GetMark()->GetContentIndex()) ) { SwTextNode* pNd = m_pCurrentPam->GetPoint()->GetNode().GetTextNode(); if( pNd ) diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index c2db52c4cb64..29eacda35114 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -184,7 +184,7 @@ SwFltControlStack::~SwFltControlStack() void SwFltControlStack::MoveAttrs(const SwPosition& rPos, MoveAttrsMode eMode) { SwNodeOffset nPosNd = rPos.GetNodeIndex(); - sal_uInt16 nPosCt = rPos.nContent.GetIndex() - 1; + sal_uInt16 nPosCt = rPos.GetContentIndex() - 1; for (size_t i = 0, nCnt = m_Entries.size(); i < nCnt; ++i) { @@ -591,7 +591,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwTextNode const*const pTextNode( aRegion.End()->GetNode().GetTextNode()); SwTextField const*const pField = pTextNode ? pTextNode->GetFieldTextAttrAt( - aRegion.End()->nContent.GetIndex() - 1, true) : nullptr; + aRegion.End()->GetContentIndex() - 1, true) : nullptr; if (pField) { SwPostItField const*const pPostIt( @@ -770,9 +770,9 @@ void SwFltControlStack::Delete(const SwPaM &rPam) return; SwNodeIndex aStartNode(pStt->nNode, -1); - const sal_Int32 nStartIdx = pStt->nContent.GetIndex(); + const sal_Int32 nStartIdx = pStt->GetContentIndex(); SwNodeIndex aEndNode(pEnd->nNode, -1); - const sal_Int32 nEndIdx = pEnd->nContent.GetIndex(); + const sal_Int32 nEndIdx = pEnd->GetContentIndex(); // We don't support deleting content that is over one node, or removing a node. OSL_ENSURE(aEndNode == aStartNode, "nodes must be the same, or this method extended"); diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index 47655081cd56..395853dba02d 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -180,7 +180,7 @@ ErrCode SwReader::Read( const Reader& rOptions ) mxDoc->GetSpzFrameFormats()->end() ); } - const sal_Int32 nSttContent = pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nSttContent = pPam->GetPoint()->GetContentIndex(); // make sure the End position is correct for all Readers SwContentNode* pCNd = pPam->GetContentNode(); diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 41afa3638a85..4692a6f56b94 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -2184,7 +2184,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode ) if( rHTMLWrt.m_pCurrentPam->GetPoint()->nNode == rHTMLWrt.m_pCurrentPam->GetMark()->nNode ) { - nEnd = rHTMLWrt.m_pCurrentPam->GetMark()->nContent.GetIndex(); + nEnd = rHTMLWrt.m_pCurrentPam->GetMark()->GetContentIndex(); } // are there any hard attributes that must be written as options? @@ -2281,7 +2281,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode ) rHTMLWrt.m_bTextAttr = true; size_t nAttrPos = 0; - sal_Int32 nStrPos = rHTMLWrt.m_pCurrentPam->GetPoint()->nContent.GetIndex(); + sal_Int32 nStrPos = rHTMLWrt.m_pCurrentPam->GetPoint()->GetContentIndex(); const SwTextAttr * pHt = nullptr; const size_t nCntAttr = pNd->HasHints() ? pNd->GetSwpHints().Count() : 0; if( nCntAttr && nStrPos > ( pHt = pNd->GetSwpHints().Get(0) )->GetStart() ) @@ -2470,7 +2470,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode ) // Placeholder for a single-point fieldmark. SwPosition aMarkPos = *rWrt.m_pCurrentPam->GetPoint(); - aMarkPos.nContent += nStrPos - aMarkPos.nContent.GetIndex(); + aMarkPos.nContent += nStrPos - aMarkPos.GetContentIndex(); rHTMLWrt.OutPointFieldmarks(aMarkPos); } else diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index dc71483ab82b..c4e601825931 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -1974,7 +1974,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( const SvxCSS1PropertyInfo &rPropInfo, // still empty and otherwise auto-bound. // Auto-bound frames for the time being inserted at the previous position // and later moved. - const sal_Int32 nContent = m_pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nContent = m_pPam->GetPoint()->GetContentIndex(); if( nContent ) { aAnchor.SetType( RndStdIds::FLY_AT_CHAR ); @@ -2220,7 +2220,7 @@ void SwHTMLParser::EndContextAttrs( HTMLAttrContext *pContext ) { // Set the number of characters for DropCaps. If it's zero at the // end, the attribute is set to invalid and then isn't set from SetAttr. - sal_Int32 nChars = m_pPam->GetPoint()->nContent.GetIndex(); + sal_Int32 nChars = m_pPam->GetPoint()->GetContentIndex(); if( nChars < 1 ) pAttr->Invalidate(); else if( nChars > MAX_DROPCAP_CHARS ) diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx index 30d21fb30609..b7d5283fc4ed 100644 --- a/sw/source/filter/html/htmlctxt.cxx +++ b/sw/source/filter/html/htmlctxt.cxx @@ -182,10 +182,10 @@ void SwHTMLParser::SplitAttrTab( const SwPosition& rNewPos ) #ifndef NDEBUG auto const nOld(pOldEndPara->GetIndex()); #endif - sal_Int32 nOldEndCnt = m_pPam->GetPoint()->nContent.GetIndex(); + sal_Int32 nOldEndCnt = m_pPam->GetPoint()->GetContentIndex(); const SwNodeIndex& rNewSttPara = rNewPos.nNode; - sal_Int32 nNewSttCnt = rNewPos.nContent.GetIndex(); + sal_Int32 nNewSttCnt = rNewPos.GetContentIndex(); bool bMoveBack = false; @@ -207,13 +207,13 @@ void SwHTMLParser::SplitAttrTab( const SwPosition& rNewPos ) if( !bMoveBack ) { bMoveBack = m_pPam->Move( fnMoveBackward ); - nOldEndCnt = m_pPam->GetPoint()->nContent.GetIndex(); + nOldEndCnt = m_pPam->GetPoint()->GetContentIndex(); } } else if( bMoveBack ) { m_pPam->Move( fnMoveForward ); - nOldEndCnt = m_pPam->GetPoint()->nContent.GetIndex(); + nOldEndCnt = m_pPam->GetPoint()->GetContentIndex(); bMoveBack = false; } @@ -400,7 +400,7 @@ void SwHTMLParser::EndContext( HTMLAttrContext *pContext ) // Add a paragraph break if needed if( AM_NONE != pContext->GetAppendMode() && - m_pPam->GetPoint()->nContent.GetIndex() ) + m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( pContext->GetAppendMode() ); // Restart PRE, LISTING and XMP environments @@ -535,7 +535,7 @@ void SwHTMLParser::InsertAttrs( SfxItemSet &rItemSet, bool bCharLvl ) { // Put together a DropCap attribute, if a "float:left" is before the first character - if( bCharLvl && !m_pPam->GetPoint()->nContent.GetIndex() && + if( bCharLvl && !m_pPam->GetPoint()->GetContentIndex() && SvxAdjust::Left == rPropInfo.m_eFloat ) { SwFormatDrop aDrop; diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx index 6889ad4fee2c..84bd66a8057c 100644 --- a/sw/source/filter/html/htmlfld.cxx +++ b/sw/source/filter/html/htmlfld.cxx @@ -610,7 +610,7 @@ void SwHTMLParser::InsertComment( const OUString& rComment, const char *pTag ) // MIB 24.06.97: If a PostIt should be insert after a space, we // will insert before the space. Then there are less problems // during formatting. (bug #40483#) - const sal_Int32 nPos = m_pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nPos = m_pPam->GetPoint()->GetContentIndex(); SwTextNode *pTextNd = m_pPam->GetNode().GetTextNode(); bool bMoveFwd = false; if (nPos>0 && pTextNd && (' ' == pTextNd->GetText()[nPos-1])) @@ -618,7 +618,7 @@ void SwHTMLParser::InsertComment( const OUString& rComment, const char *pTag ) bMoveFwd = true; SwNodeOffset nNodeIdx = m_pPam->GetPoint()->GetNodeIndex(); - const sal_Int32 nIdx = m_pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nIdx = m_pPam->GetPoint()->GetContentIndex(); for( auto i = m_aSetAttrTab.size(); i > 0; ) { HTMLAttr *pAttr = m_aSetAttrTab[--i]; diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx index df8eb9116ccc..891ddf1a398b 100644 --- a/sw/source/filter/html/htmlfly.cxx +++ b/sw/source/filter/html/htmlfly.cxx @@ -51,7 +51,7 @@ SwHTMLPosFlyFrame::SwHTMLPosFlyFrame( const SwPosFlyFrame& rPosFly, if( !rAnchor.GetContentAnchor() ) return; - m_nContentIndex = rAnchor.GetContentAnchor()->nContent.GetIndex(); + m_nContentIndex = rAnchor.GetContentAnchor()->GetContentIndex(); sal_Int16 eHoriRel = rPosFly.GetFormat().GetHoriOrient(). GetRelationOrient(); if( text::RelOrientation::FRAME == eHoriRel || text::RelOrientation::PRINT_AREA == eHoriRel ) diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index c1b548c104d3..e4ea32230b79 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -1197,7 +1197,7 @@ void SwHTMLParser::NewForm( bool bAppend ) if( bAppend ) { - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( AM_SPACE ); else AddParSpace(); @@ -1360,7 +1360,7 @@ void SwHTMLParser::EndForm( bool bAppend ) { if( bAppend ) { - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( AM_SPACE ); else AddParSpace(); diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx index 957a4d45e966..45f5b76b84eb 100644 --- a/sw/source/filter/html/htmlftn.cxx +++ b/sw/source/filter/html/htmlftn.cxx @@ -202,7 +202,7 @@ void SwHTMLParser::FinishFootEndNote() m_xDoc->getIDocumentContentOperations().InsertPoolItem( *m_pPam, aFootnote ); SwTextFootnote * const pTextFootnote = static_cast<SwTextFootnote *>( m_pPam->GetNode().GetTextNode()->GetTextAttrForCharAt( - m_pPam->GetPoint()->nContent.GetIndex() - 1, RES_TXTATR_FTN ) ); + m_pPam->GetPoint()->GetContentIndex() - 1, RES_TXTATR_FTN ) ); // In header and footer no footnotes can be inserted. if (pTextFootnote) m_pFootEndNoteImpl->aTextFootnotes.push_back(SwHTMLTextFootnote(m_pFootEndNoteImpl->sName,pTextFootnote)); diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index ba5d09dce50a..517750c0d51d 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -237,7 +237,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( sal_Int16 eVertOri, } // determine vertical alignment and anchoring - const sal_Int32 nContent = m_pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nContent = m_pPam->GetPoint()->GetContentIndex(); if( nContent ) { aAnchor.SetType( RndStdIds::FLY_AT_CHAR ); @@ -283,7 +283,7 @@ void SwHTMLParser::RegisterFlyFrame( SwFrameFormat *pFlyFormat ) css::text::WrapTextMode_THROUGH == pFlyFormat->GetSurround().GetSurround() ) { m_aMoveFlyFrames.emplace_back(std::make_unique<SwHTMLFrameFormatListener>(pFlyFormat)); - m_aMoveFlyCnts.push_back( m_pPam->GetPoint()->nContent.GetIndex() ); + m_aMoveFlyCnts.push_back( m_pPam->GetPoint()->GetContentIndex() ); } } @@ -462,7 +462,7 @@ IMAGE_SETEVENT: // When we are in an ordered list and the paragraph is still empty and not // numbered, it may be a graphic for a bullet list. - if( !m_pPam->GetPoint()->nContent.GetIndex() && + if( !m_pPam->GetPoint()->GetContentIndex() && GetNumInfo().GetDepth() > 0 && GetNumInfo().GetDepth() <= MAXLEVEL && !m_aBulletGrfs[GetNumInfo().GetDepth()-1].isEmpty() && m_aBulletGrfs[GetNumInfo().GetDepth()-1]==sGrfNm ) @@ -853,7 +853,7 @@ IMAGE_SETEVENT: m_xAttrTab->pINetFormat->GetStartParagraph() == m_pPam->GetPoint()->nNode && m_xAttrTab->pINetFormat->GetStartContent() == - m_pPam->GetPoint()->nContent.GetIndex() - 1 ) + m_pPam->GetPoint()->GetContentIndex() - 1 ) { // the attribute was insert right before as-character anchored // graphic, therefore we move it @@ -1419,7 +1419,7 @@ void SwHTMLParser::StripTrailingPara() SwContentNode* pCNd = m_pPam->GetContentNode(); SwNodeOffset nNodeIdx = m_pPam->GetPoint()->GetNodeIndex(); - if( !m_pPam->GetPoint()->nContent.GetIndex() ) + if( !m_pPam->GetPoint()->GetContentIndex() ) { if( pCNd && pCNd->StartOfSectionIndex() + 2 < pCNd->EndOfSectionIndex() && CanRemoveNode(nNodeIdx)) @@ -1507,7 +1507,7 @@ void SwHTMLParser::StripTrailingPara() bSetSmallFont = true; SwTextNode* pTextNd = pCNd->GetTextNode(); - sal_Int32 nPos = m_pPam->GetPoint()->nContent.GetIndex(); + sal_Int32 nPos = m_pPam->GetPoint()->GetContentIndex(); while( bSetSmallFont && nPos>0 ) { --nPos; diff --git a/sw/source/filter/html/htmlnumreader.cxx b/sw/source/filter/html/htmlnumreader.cxx index 3c25dacdb3e0..7fb3777ccf0f 100644 --- a/sw/source/filter/html/htmlnumreader.cxx +++ b/sw/source/filter/html/htmlnumreader.cxx @@ -56,7 +56,7 @@ void SwHTMLParser::NewNumberBulletList( HtmlTokenId nToken ) // Create a new paragraph bool bSpace = (rInfo.GetDepth() + m_nDefListDeep) == 0; - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( bSpace ? AM_SPACE : AM_NOSPACE, false ); else if( bSpace ) AddParSpace(); @@ -334,7 +334,7 @@ void SwHTMLParser::EndNumberBulletList( HtmlTokenId nToken ) // A new paragraph needs to be created, when // - the current one isn't empty (it contains text or paragraph-bound objects) // - the current one is numbered - bool bAppend = m_pPam->GetPoint()->nContent.GetIndex() > 0; + bool bAppend = m_pPam->GetPoint()->GetContentIndex() > 0; if( !bAppend ) { SwTextNode* pTextNode = m_pPam->GetNode().GetTextNode(); @@ -463,7 +463,7 @@ void SwHTMLParser::NewNumberBulletListItem( HtmlTokenId nToken ) } // create a new paragraph - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( AM_NOSPACE, false ); m_bNoParSpace = false; // no space in <LI>! @@ -555,7 +555,7 @@ void SwHTMLParser::NewNumberBulletListItem( HtmlTokenId nToken ) void SwHTMLParser::EndNumberBulletListItem( HtmlTokenId nToken, bool bSetColl ) { // Create a new paragraph - if( nToken == HtmlTokenId::NONE && m_pPam->GetPoint()->nContent.GetIndex() ) + if( nToken == HtmlTokenId::NONE && m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( AM_NOSPACE ); // Get context to that token and pop it from stack diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index 58e33bca84c9..b60e0f7883a5 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -103,7 +103,7 @@ void SwHTMLParser::NewDivision( HtmlTokenId nToken ) } bool bAppended = false; - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) { AppendTextNode( bHeader||bFooter||!aId.isEmpty()|| !aHRef.isEmpty() ? AM_NORMAL : AM_NOSPACE ); @@ -656,7 +656,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) bool bAppended = false; if( !bPositioned ) { - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) { AppendTextNode( AM_SPACE ); bAppended = true; diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 0678412ead87..707e60acd34b 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -2668,7 +2668,7 @@ sal_Int32 SwHTMLParser::StripTrailingLF() return nStripped; } - const sal_Int32 nLen = m_pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nLen = m_pPam->GetPoint()->GetContentIndex(); if( nLen ) { SwTextNode* pTextNd = m_pPam->GetPoint()->GetNode().GetTextNode(); @@ -3090,7 +3090,7 @@ void CellSaveStruct::InsertCell( SwHTMLParser& rParser, void CellSaveStruct::StartNoBreak( const SwPosition& rPos ) { if( !m_xCnts || - (!rPos.nContent.GetIndex() && m_pCurrCnts == m_xCnts.get() && + (!rPos.GetContentIndex() && m_pCurrCnts == m_xCnts.get() && m_xCnts->GetStartNode() && m_xCnts->GetStartNode()->GetIndex() + 1 == rPos.GetNodeIndex()) ) @@ -3104,7 +3104,7 @@ void CellSaveStruct::EndNoBreak( const SwPosition& rPos ) if( m_bNoBreak ) { m_pNoBreakEndNodeIndex.reset( new SwNodeIndex( rPos.nNode ) ); - m_nNoBreakEndContentPos = rPos.nContent.GetIndex(); + m_nNoBreakEndContentPos = rPos.GetContentIndex(); m_bNoBreak = false; } } @@ -3122,12 +3122,12 @@ void CellSaveStruct::CheckNoBreak( const SwPosition& rPos ) else if( m_pNoBreakEndNodeIndex && m_pNoBreakEndNodeIndex->GetIndex() == rPos.GetNodeIndex() ) { - if( m_nNoBreakEndContentPos == rPos.nContent.GetIndex() ) + if( m_nNoBreakEndContentPos == rPos.GetContentIndex() ) { // <NOBR> was closed immediately before the cell end m_xCnts->SetNoBreak(); } - else if( m_nNoBreakEndContentPos + 1 == rPos.nContent.GetIndex() ) + else if( m_nNoBreakEndContentPos + 1 == rPos.GetContentIndex() ) { SwTextNode const*const pTextNd(rPos.GetNode().GetTextNode()); if( pTextNd ) @@ -3162,7 +3162,7 @@ std::unique_ptr<HTMLTableCnts> SwHTMLParser::InsertTableContents( // Reset attributation start const SwNodeIndex& rSttPara = m_pPam->GetPoint()->nNode; - sal_Int32 nSttCnt = m_pPam->GetPoint()->nContent.GetIndex(); + sal_Int32 nSttCnt = m_pPam->GetPoint()->GetContentIndex(); HTMLAttr** pHTMLAttributes = reinterpret_cast<HTMLAttr**>(m_xAttrTab.get()); for (sal_uInt16 nCnt = sizeof(HTMLAttrTable) / sizeof(HTMLAttr*); nCnt--; ++pHTMLAttributes) @@ -3302,13 +3302,13 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, // Otherwise, we need to open a new paragraph if the paragraph // is empty or contains text frames or bookmarks bAppend = - m_pPam->GetPoint()->nContent.GetIndex() || + m_pPam->GetPoint()->GetContentIndex() || HasCurrentParaFlys() || HasCurrentParaBookmarks(); } if( bAppend ) { - if( !m_pPam->GetPoint()->nContent.GetIndex() ) + if( !m_pPam->GetPoint()->GetContentIndex() ) { //Set default to CJK and CTL m_xDoc->SetTextFormatColl( *m_pPam, @@ -3383,7 +3383,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, // still empty paragraph, since it's not gonna be deleted that way if( (bTopTable && !bAppended) || (!bTopTable && !bParentLFStripped && - !m_pPam->GetPoint()->nContent.GetIndex()) ) + !m_pPam->GetPoint()->GetContentIndex()) ) pPostIts.emplace(); SetAttr( bTopTable, bTopTable, pPostIts ? &*pPostIts : nullptr ); } @@ -3468,7 +3468,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, // create a SwTable with a box and set the PaM to the content of // the box section (the adjustment parameter is a dummy for now // and will be corrected later) - OSL_ENSURE( !m_pPam->GetPoint()->nContent.GetIndex(), + OSL_ENSURE( !m_pPam->GetPoint()->GetContentIndex(), "The paragraph after the table is not empty!" ); const SwTable* pSwTable = m_xDoc->InsertTable( SwInsertTableOptions( SwInsertTableFlags::HeadlineNoBorder, 1 ), @@ -3844,7 +3844,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, } // Remove LFs at the paragraph end - if (StripTrailingLF() == 0 && !m_pPam->GetPoint()->nContent.GetIndex()) + if (StripTrailingLF() == 0 && !m_pPam->GetPoint()->GetContentIndex()) { HTMLTableContext* pTableContext = m_xTable ? m_xTable->GetContext() : nullptr; SwPosition* pSavedPos = pTableContext ? pTableContext->GetPos() : nullptr; @@ -4665,13 +4665,13 @@ void SwHTMLParser::BuildTableCaption( HTMLTable *pCurTable ) { // On moving the caption later, the last paragraph isn't moved as well. // That means, there has to be an empty paragraph at the end of the section - if( m_pPam->GetPoint()->nContent.GetIndex() || bLFStripped ) + if( m_pPam->GetPoint()->GetContentIndex() || bLFStripped ) AppendTextNode( AM_NOSPACE ); } else { // Strip LFs at the end of the paragraph - if( !m_pPam->GetPoint()->nContent.GetIndex() && !bLFStripped ) + if( !m_pPam->GetPoint()->GetContentIndex() && !bLFStripped ) StripTrailingPara(); } diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 3d55e56f28d2..e8980241b3a0 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -768,13 +768,13 @@ void SwHTMLParser::Continue( HtmlTokenId nToken ) if( m_pSttNdIdx->GetIndex()+1 == m_pPam->GetBound().GetNodeIndex() ) { - const sal_Int32 nCntPos = m_pPam->GetBound().nContent.GetIndex(); + const sal_Int32 nCntPos = m_pPam->GetBound().GetContentIndex(); m_pPam->GetBound().nContent.Assign( pTextNode, pTextNode->GetText().getLength() + nCntPos ); } if( m_pSttNdIdx->GetIndex()+1 == m_pPam->GetBound( false ).GetNodeIndex() ) { - const sal_Int32 nCntPos = m_pPam->GetBound( false ).nContent.GetIndex(); + const sal_Int32 nCntPos = m_pPam->GetBound( false ).GetContentIndex(); m_pPam->GetBound( false ).nContent.Assign( pTextNode, pTextNode->GetText().getLength() + nCntPos ); } @@ -801,7 +801,7 @@ void SwHTMLParser::Continue( HtmlTokenId nToken ) // now remove the last useless paragraph SwPosition* pPos = m_pPam->GetPoint(); - if( !pPos->nContent.GetIndex() && !bLFStripped ) + if( !pPos->GetContentIndex() && !bLFStripped ) { SwTextNode* pCurrentNd; SwNodeOffset nNodeIdx = pPos->GetNodeIndex(); @@ -811,7 +811,7 @@ void SwHTMLParser::Continue( HtmlTokenId nToken ) if( IsNewDoc() ) { - if (!m_pPam->GetPoint()->nContent.GetIndex() && CanRemoveNode(nNodeIdx)) + if (!m_pPam->GetPoint()->GetContentIndex() && CanRemoveNode(nNodeIdx)) { SwContentNode* pCNd = m_pPam->GetContentNode(); if( pCNd && pCNd->StartOfSectionIndex()+2 < @@ -855,7 +855,7 @@ void SwHTMLParser::Continue( HtmlTokenId nToken ) // annul the SplitNode from the beginning else if( !IsNewDoc() ) { - if( pPos->nContent.GetIndex() ) // then there was no <p> at the end + if( pPos->GetContentIndex() ) // then there was no <p> at the end m_pPam->Move( fnMoveForward, GoInNode ); // therefore to the next SwTextNode* pTextNode = pPos->GetNode().GetTextNode(); SwNodeIndex aPrvIdx( pPos->nNode ); @@ -1488,7 +1488,7 @@ void SwHTMLParser::NextToken( HtmlTokenId nToken ) // CR in PRE/LISTING/XMP { if( HtmlTokenId::NEWPARA==nToken || - m_pPam->GetPoint()->nContent.GetIndex() ) + m_pPam->GetPoint()->GetContentIndex() ) { AppendTextNode(); // there is no LF at this place // therefore it will cause no problems @@ -1509,7 +1509,7 @@ void SwHTMLParser::NextToken( HtmlTokenId nToken ) break; case HtmlTokenId::LINEFEEDCHAR: - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode(); if (!m_xTable && !m_xDoc->IsInHeaderFooter(m_pPam->GetPoint()->nNode)) { @@ -1522,7 +1522,7 @@ void SwHTMLParser::NextToken( HtmlTokenId nToken ) // insert string without spanning attributes at the end. if( !aToken.isEmpty() && ' '==aToken[0] && !IsReadPRE() ) { - sal_Int32 nPos = m_pPam->GetPoint()->nContent.GetIndex(); + sal_Int32 nPos = m_pPam->GetPoint()->GetContentIndex(); const SwTextNode* pTextNode = nPos ? m_pPam->GetPoint()->GetNode().GetTextNode() : nullptr; if (pTextNode) { @@ -1820,7 +1820,7 @@ void SwHTMLParser::NextToken( HtmlTokenId nToken ) case HtmlTokenId::LI_ON: case HtmlTokenId::LISTHEADER_ON: if( m_nOpenParaToken != HtmlTokenId::NONE && - (m_pPam->GetPoint()->nContent.GetIndex() + (m_pPam->GetPoint()->GetContentIndex() || HtmlTokenId::PARABREAK_ON==m_nOpenParaToken) ) { // only finish paragraph for <P><LI>, not for <DD><LI> @@ -2145,7 +2145,7 @@ void SwHTMLParser::NextToken( HtmlTokenId nToken ) // if there are temporary paragraph attributes and the // paragraph isn't empty then the paragraph attributes are final. - if( !m_aParaAttrs.empty() && m_pPam->GetPoint()->nContent.GetIndex() ) + if( !m_aParaAttrs.empty() && m_pPam->GetPoint()->GetContentIndex() ) m_aParaAttrs.clear(); } @@ -2237,7 +2237,7 @@ bool SwHTMLParser::AppendTextNode( SwHTMLAppendMode eMode, bool bUpdateNum ) // split character attributes and maybe set none, // which are set for the whole paragraph const SwNodeIndex& rEndIdx = aOldPos.nNode; - const sal_Int32 nEndCnt = aOldPos.nContent.GetIndex(); + const sal_Int32 nEndCnt = aOldPos.GetContentIndex(); const SwPosition& rPos = *m_pPam->GetPoint(); HTMLAttr** pHTMLAttributes = reinterpret_cast<HTMLAttr**>(m_xAttrTab.get()); @@ -2746,7 +2746,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, { SwPaM aAttrPam( *m_pPam->GetPoint() ); const SwNodeIndex& rEndIdx = m_pPam->GetPoint()->nNode; - const sal_Int32 nEndCnt = m_pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nEndCnt = m_pPam->GetPoint()->GetContentIndex(); HTMLAttr* pAttr; SwContentNode* pCNd; @@ -2891,7 +2891,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, if( aAttrPam.GetMark()->GetNodeIndex() != rEndIdx.GetIndex() ) { - OSL_ENSURE( !aAttrPam.GetPoint()->nContent.GetIndex(), + OSL_ENSURE( !aAttrPam.GetPoint()->GetContentIndex(), "Content-Position before table not 0???" ); aAttrPam.Move( fnMoveBackward ); } @@ -3069,7 +3069,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, aAttrPam.GetPoint()->GetNodeIndex() == rEndIdx.GetIndex() ) { OSL_ENSURE( !bBeforeTable, "Aha, the case does occur" ); - OSL_ENSURE( !aAttrPam.GetPoint()->nContent.GetIndex(), + OSL_ENSURE( !aAttrPam.GetPoint()->GetContentIndex(), "Content-Position before table not 0???" ); // !!! aAttrPam.Move( fnMoveBackward ); @@ -3109,7 +3109,7 @@ bool SwHTMLParser::EndAttr( HTMLAttr* pAttr, bool bChkEmpty ) // save the current position as end position const SwNodeIndex* pEndIdx = &m_pPam->GetPoint()->nNode; - sal_Int32 nEndCnt = m_pPam->GetPoint()->nContent.GetIndex(); + sal_Int32 nEndCnt = m_pPam->GetPoint()->GetContentIndex(); // Is the last started or an earlier started attribute being ended? HTMLAttr *pLast = nullptr; @@ -3134,7 +3134,7 @@ bool SwHTMLParser::EndAttr( HTMLAttr* pAttr, bool bChkEmpty ) { // Then move back one position in the content! bMoveBack = m_pPam->Move( fnMoveBackward ); - nEndCnt = m_pPam->GetPoint()->nContent.GetIndex(); + nEndCnt = m_pPam->GetPoint()->GetContentIndex(); } // now end the attribute @@ -3360,7 +3360,7 @@ void SwHTMLParser::SplitAttrTab( std::shared_ptr<HTMLAttrTable> const & rNewAttr HTMLAttr** pHTMLAttributes = reinterpret_cast<HTMLAttr**>(m_xAttrTab.get()); HTMLAttr** pSaveAttributes = reinterpret_cast<HTMLAttr**>(rNewAttrTab.get()); bool bSetAttr = true; - const sal_Int32 nSttCnt = m_pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nSttCnt = m_pPam->GetPoint()->GetContentIndex(); sal_Int32 nEndCnt = nSttCnt; if( bMoveEndBack ) @@ -3948,7 +3948,7 @@ void SwHTMLParser::EndFontAttr( HtmlTokenId nToken ) void SwHTMLParser::NewPara() { - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( AM_SPACE ); else AddParSpace(); @@ -4035,7 +4035,7 @@ void SwHTMLParser::EndPara( bool bReal ) // Netscape skips empty paragraphs, we do the same. if( bReal ) { - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( AM_SPACE ); else AddParSpace(); @@ -4104,7 +4104,7 @@ void SwHTMLParser::NewHeading( HtmlTokenId nToken ) } // open a new paragraph - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( AM_SPACE ); else AddParSpace(); @@ -4158,7 +4158,7 @@ void SwHTMLParser::NewHeading( HtmlTokenId nToken ) void SwHTMLParser::EndHeading() { // open a new paragraph - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( AM_SPACE ); else AddParSpace(); @@ -4253,7 +4253,7 @@ void SwHTMLParser::NewTextFormatColl( HtmlTokenId nToken, sal_uInt16 nColl ) OSL_ENSURE( false, "unknown style" ); break; } - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( eMode ); else if( AM_SPACE==eMode ) AddParSpace(); @@ -4306,7 +4306,7 @@ void SwHTMLParser::EndTextFormatColl( HtmlTokenId nToken ) OSL_ENSURE( false, "unknown style" ); break; } - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( eMode ); else if( AM_SPACE==eMode ) AddParSpace(); @@ -4357,7 +4357,7 @@ void SwHTMLParser::NewDefList() // open a new paragraph bool bSpace = (GetNumInfo().GetDepth() + m_nDefListDeep) == 0; - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( bSpace ? AM_SPACE : AM_SOFTNOSPACE ); else if( bSpace ) AddParSpace(); @@ -4432,7 +4432,7 @@ void SwHTMLParser::NewDefList() void SwHTMLParser::EndDefList() { bool bSpace = (GetNumInfo().GetDepth() + m_nDefListDeep) == 1; - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( bSpace ? AM_SPACE : AM_SOFTNOSPACE ); else if( bSpace ) AddParSpace(); @@ -4495,7 +4495,7 @@ void SwHTMLParser::NewDefListItem( HtmlTokenId nToken ) void SwHTMLParser::EndDefListItem( HtmlTokenId nToken ) { // open a new paragraph - if( nToken == HtmlTokenId::NONE && m_pPam->GetPoint()->nContent.GetIndex() ) + if( nToken == HtmlTokenId::NONE && m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( AM_SOFTNOSPACE ); // search context matching the token and fetch it from stack @@ -4980,7 +4980,7 @@ void SwHTMLParser::InsertSpacer() // set a paragraph margin SwTextNode *pTextNode = nullptr; - if( !m_pPam->GetPoint()->nContent.GetIndex() ) + if( !m_pPam->GetPoint()->GetContentIndex() ) { // if possible change the bottom paragraph margin // of previous node @@ -5025,7 +5025,7 @@ void SwHTMLParser::InsertSpacer() MapMode(MapUnit::MapTwip) ).Width(); } - if( !m_pPam->GetPoint()->nContent.GetIndex() ) + if( !m_pPam->GetPoint()->GetContentIndex() ) { sal_uInt16 nLeft=0, nRight=0; short nIndent = 0; @@ -5188,12 +5188,12 @@ void SwHTMLParser::InsertLineBreak() if (pTextNode) { SwFormatLineBreak aLineBreak(eClear); - sal_Int32 nPos = m_pPam->GetPoint()->nContent.GetIndex(); + sal_Int32 nPos = m_pPam->GetPoint()->GetContentIndex(); pTextNode->InsertItem(aLineBreak, nPos, nPos); } } } - else if( m_pPam->GetPoint()->nContent.GetIndex() ) + else if( m_pPam->GetPoint()->GetContentIndex() ) { // If a CLEAR is executed in a non-empty paragraph, then after it // a new paragraph has to be opened. @@ -5260,7 +5260,7 @@ void SwHTMLParser::InsertHorzRule() } } - if( m_pPam->GetPoint()->nContent.GetIndex() ) + if( m_pPam->GetPoint()->GetContentIndex() ) AppendTextNode( AM_NOSPACE ); if( m_nOpenParaToken != HtmlTokenId::NONE ) EndPara(); @@ -5446,8 +5446,8 @@ HTMLAttr::HTMLAttr( const SwPosition& rPos, const SfxPoolItem& rItem, HTMLAttr **ppHd, const std::shared_ptr<HTMLAttrTable>& rAttrTab ) : m_nStartPara( rPos.nNode ), m_nEndPara( rPos.nNode ), - m_nStartContent( rPos.nContent.GetIndex() ), - m_nEndContent(rPos.nContent.GetIndex() ), + m_nStartContent( rPos.GetContentIndex() ), + m_nEndContent(rPos.GetContentIndex() ), m_bInsAtStart( true ), m_bLikePara( false ), m_bValid( true ), diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index aa5e98d911e6..7e25f4f0ef0a 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -971,7 +971,7 @@ struct SwPending inline void HTMLAttr::SetStart( const SwPosition& rPos ) { m_nStartPara = rPos.nNode; - m_nStartContent = rPos.nContent.GetIndex(); + m_nStartContent = rPos.GetContentIndex(); m_nEndPara = m_nStartPara; m_nEndContent = m_nStartContent; } diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index f230f4dab303..7fc2dd407c8c 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -905,7 +905,7 @@ void SwHTMLWriter::Out_SwDoc( SwPaM* pPam ) while( m_pCurrentPam->GetPoint()->GetNodeIndex() < m_pCurrentPam->GetMark()->GetNodeIndex() || (m_pCurrentPam->GetPoint()->GetNodeIndex() == m_pCurrentPam->GetMark()->GetNodeIndex() && - m_pCurrentPam->GetPoint()->nContent.GetIndex() <= m_pCurrentPam->GetMark()->nContent.GetIndex()) ) + m_pCurrentPam->GetPoint()->GetContentIndex() <= m_pCurrentPam->GetMark()->GetContentIndex()) ) { SwNode& rNd = m_pCurrentPam->GetNode(); diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx index 865ff5cfdf97..e4041d2da09a 100644 --- a/sw/source/filter/inc/fltshell.hxx +++ b/sw/source/filter/inc/fltshell.hxx @@ -65,14 +65,14 @@ public: //and the offset to content is de-dynamic-ified SwFltPosition(const SwPosition &rPos) : m_nNode(rPos.nNode, -1) - , m_nContent(rPos.nContent.GetIndex()) + , m_nContent(rPos.GetContentIndex()) { } void FromSwPosition(const SwPosition &rPos) { m_nNode = rPos.GetNodeIndex()-1; - m_nContent = rPos.nContent.GetIndex(); + m_nContent = rPos.GetContentIndex(); } }; diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index 1252ff41243d..a810ff47e3e0 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -464,14 +464,14 @@ bool Writer::GetBookmarks(const SwContentNode& rNd, sal_Int32 nStt, const ::sw::mark::IMark& rBkmk = *(it->second); sal_Int32 nContent; if( rBkmk.GetMarkPos().nNode == nNd && - (nContent = rBkmk.GetMarkPos().nContent.GetIndex() ) >= nStt && + (nContent = rBkmk.GetMarkPos().GetContentIndex() ) >= nStt && nContent < nEnd ) { rArr.push_back( &rBkmk ); } else if( rBkmk.IsExpanded() && nNd == rBkmk.GetOtherMarkPos().GetNodeIndex() && (nContent = - rBkmk.GetOtherMarkPos().nContent.GetIndex() ) >= nStt && + rBkmk.GetOtherMarkPos().GetContentIndex() ) >= nStt && nContent < nEnd ) { rArr.push_back( &rBkmk ); diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 88f397026ff7..a7f72407a33d 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -162,8 +162,8 @@ void DocxExport::AppendBookmarks( const SwTextNode& rNode, sal_Int32 nCurrentPos { for ( IMark* pMark : aMarks ) { - const sal_Int32 nStart = pMark->GetMarkStart().nContent.GetIndex(); - const sal_Int32 nEnd = pMark->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex(); + const sal_Int32 nEnd = pMark->GetMarkEnd().GetContentIndex(); if ( nStart == nCurrentPos ) aStarts.push_back( pMark->GetName() ); @@ -200,8 +200,8 @@ void DocxExport::AppendAnnotationMarks( const SwWW8AttrIter& rAttrs, sal_Int32 n { for ( IMark* pMark : aMarks ) { - const sal_Int32 nStart = pMark->GetMarkStart().nContent.GetIndex(); - const sal_Int32 nEnd = pMark->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex(); + const sal_Int32 nEnd = pMark->GetMarkEnd().GetContentIndex(); if ( nStart == nCurrentPos ) aStarts.push_back( pMark->GetName() ); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 421ae20061ad..f51ea6f62182 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -126,8 +126,8 @@ void RtfExport::AppendBookmarks(const SwTextNode& rNode, sal_Int32 nCurrentPos, { for (const auto& pMark : aMarks) { - const sal_Int32 nStart = pMark->GetMarkStart().nContent.GetIndex(); - const sal_Int32 nEnd = pMark->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex(); + const sal_Int32 nEnd = pMark->GetMarkEnd().GetContentIndex(); if (nStart == nCurrentPos) aStarts.push_back(pMark->GetName()); @@ -159,8 +159,8 @@ void RtfExport::AppendAnnotationMarks(const SwWW8AttrIter& rAttrs, sal_Int32 nCu { for (const auto& pMark : aMarks) { - const sal_Int32 nStart = pMark->GetMarkStart().nContent.GetIndex(); - const sal_Int32 nEnd = pMark->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex(); + const sal_Int32 nEnd = pMark->GetMarkEnd().GetContentIndex(); if (nStart == nCurrentPos) aStarts.push_back(pMark->GetName()); diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 354e428ea513..9a76a61d5e3d 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -722,7 +722,7 @@ namespace sw if (aResult != maStack.rend()) { SwTextNode *const pNode(rPos.GetNode().GetTextNode()); - sal_Int32 const nIndex(rPos.nContent.GetIndex()); + sal_Int32 const nIndex(rPos.GetContentIndex()); // HACK to prevent overlap of field-mark and redline, // which would destroy field-mark invariants when the redline // is hidden: move the redline end one to the left @@ -735,7 +735,7 @@ namespace sw rPos.GetDoc().getIDocumentMarkAccess()->getFieldmarkAt(end)); SAL_WARN_IF(!pFieldMark, "sw.ww8", "expected a field mark"); if (pFieldMark && pFieldMark->GetMarkPos().GetNodeIndex() == (*aResult)->m_aMkPos.m_nNode.GetIndex()+1 - && pFieldMark->GetMarkPos().nContent.GetIndex() < (*aResult)->m_aMkPos.m_nContent) + && pFieldMark->GetMarkPos().GetContentIndex() < (*aResult)->m_aMkPos.m_nContent) { (*aResult)->SetEndPos(end); return true; @@ -756,7 +756,7 @@ namespace sw { sal_Int32 const nInserted = 2; // CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FIELDSEP SwNodeOffset nPosNd = rPos.GetNodeIndex(); - sal_Int32 nPosCt = rPos.nContent.GetIndex() - nInserted; + sal_Int32 nPosCt = rPos.GetContentIndex() - nInserted; bool const isPoint(rMkPos == rPtPos); if ((rMkPos.m_nNode.GetIndex()+1 == nPosNd) && diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 5a7064bd3d27..e7d637e1de2f 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -289,7 +289,7 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos ) const SwPosition* pEnd = m_pCurRedline->End(); if (pEnd->nNode == m_rNode) { - const sal_Int32 i = pEnd->nContent.GetIndex(); + const sal_Int32 i = pEnd->GetContentIndex(); if ( i >= nStartPos && i < nMinPos ) { nMinPos = i; @@ -312,7 +312,7 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos ) if( pStt->nNode == m_rNode ) { - const sal_Int32 i = pStt->nContent.GetIndex(); + const sal_Int32 i = pStt->GetContentIndex(); if( i >= nStartPos && i < nMinPos ) nMinPos = i; } @@ -321,7 +321,7 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos ) if( pEnd->nNode == m_rNode ) { - const sal_Int32 i = pEnd->nContent.GetIndex(); + const sal_Int32 i = pEnd->GetContentIndex(); if( i >= nStartPos && i < nMinPos ) { nMinPos = i; @@ -376,7 +376,7 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos ) while (aTmpFlyIter != maFlyFrames.end() && nNextFlyPos < nStartPos) { const SwPosition &rAnchor = aTmpFlyIter->GetPosition(); - nNextFlyPos = rAnchor.nContent.GetIndex(); + nNextFlyPos = rAnchor.GetContentIndex(); ++aTmpFlyIter; } @@ -636,7 +636,7 @@ bool SwWW8AttrIter::HasFlysAt(sal_Int32 nSwPos) const for (const auto& rFly : maFlyFrames) { const SwPosition& rAnchor = rFly.GetPosition(); - const sal_Int32 nPos = rAnchor.nContent.GetIndex(); + const sal_Int32 nPos = rAnchor.GetContentIndex(); if (nPos == nSwPos) { return true; @@ -720,7 +720,7 @@ FlyProcessingState SwWW8AttrIter::OutFlys(sal_Int32 nSwPos) while ( maFlyIter != maFlyFrames.end() ) { const SwPosition &rAnchor = maFlyIter->GetPosition(); - const sal_Int32 nPos = rAnchor.nContent.GetIndex(); + const sal_Int32 nPos = rAnchor.GetContentIndex(); assert(nPos >= nSwPos && "a fly must get flagged as a nextAttr/CurrentPos"); if ( nPos != nSwPos ) @@ -1500,7 +1500,7 @@ bool SwWW8AttrIter::IncludeEndOfParaCRInRedlineProperties( sal_Int32 nEnd ) cons // attributes that contains the redlining information. if (pEnd->nNode == m_rNode) { - if (pEnd->nContent.GetIndex() == nEnd) + if (pEnd->GetContentIndex() == nEnd) { // This condition detects if the pseudo-char we will export // should be explicitly included by the redlining char @@ -1512,7 +1512,7 @@ bool SwWW8AttrIter::IncludeEndOfParaCRInRedlineProperties( sal_Int32 nEnd ) cons } if (pStart->nNode == m_rNode) { - if (pStart->nContent.GetIndex() == nEnd) + if (pStart->GetContentIndex() == nEnd) { // This condition detects if the pseudo-char we will export // should be explicitly included by the redlining char @@ -1524,7 +1524,7 @@ bool SwWW8AttrIter::IncludeEndOfParaCRInRedlineProperties( sal_Int32 nEnd ) cons } if (pStart->GetNodeIndex()-1 == m_rNode.GetIndex()) { - if (pStart->nContent.GetIndex() == 0) + if (pStart->GetContentIndex() == 0) { // This condition detects if the pseudo-char we will export // should be implicitly excluded by the redlining char @@ -1570,7 +1570,7 @@ const SwRedlineData* SwWW8AttrIter::GetRunLevelRedline( sal_Int32 nPos ) if( m_pCurRedline ) { const SwPosition* pEnd = m_pCurRedline->End(); - if (pEnd->nNode != m_rNode || pEnd->nContent.GetIndex() > nPos) + if (pEnd->nNode != m_rNode || pEnd->GetContentIndex() > nPos) { switch( m_pCurRedline->GetType() ) { @@ -1598,9 +1598,9 @@ const SwRedlineData* SwWW8AttrIter::GetRunLevelRedline( sal_Int32 nPos ) if( pStt->nNode == m_rNode ) { - if( pStt->nContent.GetIndex() >= nPos ) + if( pStt->GetContentIndex() >= nPos ) { - if( pStt->nContent.GetIndex() == nPos ) + if( pStt->GetContentIndex() == nPos ) { switch( pRedl->GetType() ) { @@ -1623,7 +1623,7 @@ const SwRedlineData* SwWW8AttrIter::GetRunLevelRedline( sal_Int32 nPos ) } if( pEnd->nNode == m_rNode && - pEnd->nContent.GetIndex() < nPos ) + pEnd->GetContentIndex() < nPos ) { m_pCurRedline = pRedl; break; @@ -1989,8 +1989,8 @@ bool MSWordExportBase::GetBookmarks( const SwTextNode& rNd, sal_Int32 nStt, if ( pMark->GetMarkStart().nNode == nNd || pMark->GetMarkEnd().nNode == nNd ) { - const sal_Int32 nBStart = pMark->GetMarkStart().nContent.GetIndex(); - const sal_Int32 nBEnd = pMark->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nBStart = pMark->GetMarkStart().GetContentIndex(); + const sal_Int32 nBEnd = pMark->GetMarkEnd().GetContentIndex(); // Keep only the bookmarks starting or ending in the snippet bool bIsStartOk = ( pMark->GetMarkStart().nNode == nNd ) && ( nBStart >= nStt ) && ( nBStart <= nEnd ); @@ -2020,8 +2020,8 @@ bool MSWordExportBase::GetAnnotationMarks( const SwWW8AttrIter& rAttrs, sal_Int3 if ( pMark->GetMarkStart().nNode == nNd || pMark->GetMarkEnd().nNode == nNd ) { - const sal_Int32 nBStart = pMark->GetMarkStart().nContent.GetIndex(); - const sal_Int32 nBEnd = pMark->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nBStart = pMark->GetMarkStart().GetContentIndex(); + const sal_Int32 nBEnd = pMark->GetMarkEnd().GetContentIndex(); // Keep only the bookmarks starting or ending in the snippet bool bIsStartOk = ( pMark->GetMarkStart().nNode == nNd ) && ( nBStart >= nStt ) && ( nBStart <= nEnd ); @@ -2058,8 +2058,8 @@ class CompareMarksEnd public: bool operator() ( const IMark * pOneB, const IMark * pTwoB ) const { - const sal_Int32 nOEnd = pOneB->GetMarkEnd().nContent.GetIndex(); - const sal_Int32 nTEnd = pTwoB->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nOEnd = pOneB->GetMarkEnd().GetContentIndex(); + const sal_Int32 nTEnd = pTwoB->GetMarkEnd().GetContentIndex(); return nOEnd < nTEnd; } @@ -2074,7 +2074,7 @@ bool MSWordExportBase::NearestBookmark( sal_Int32& rNearest, const sal_Int32 nCu if ( !m_rSortedBookmarksStart.empty() ) { IMark* pMarkStart = m_rSortedBookmarksStart.front(); - const sal_Int32 nNext = pMarkStart->GetMarkStart().nContent.GetIndex(); + const sal_Int32 nNext = pMarkStart->GetMarkStart().GetContentIndex(); if( !bNextPositionOnly || (nNext > nCurrentPos )) { rNearest = nNext; @@ -2085,7 +2085,7 @@ bool MSWordExportBase::NearestBookmark( sal_Int32& rNearest, const sal_Int32 nCu if ( !m_rSortedBookmarksEnd.empty() ) { IMark* pMarkEnd = m_rSortedBookmarksEnd[0]; - const sal_Int32 nNext = pMarkEnd->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nNext = pMarkEnd->GetMarkEnd().GetContentIndex(); if( !bNextPositionOnly || nNext > nCurrentPos ) { if ( !bHasBookmark ) @@ -2106,7 +2106,7 @@ void MSWordExportBase::NearestAnnotationMark( sal_Int32& rNearest, const sal_Int if ( !m_rSortedAnnotationMarksStart.empty() ) { IMark* pMarkStart = m_rSortedAnnotationMarksStart.front(); - const sal_Int32 nNext = pMarkStart->GetMarkStart().nContent.GetIndex(); + const sal_Int32 nNext = pMarkStart->GetMarkStart().GetContentIndex(); if( !bNextPositionOnly || (nNext > nCurrentPos )) { rNearest = nNext; @@ -2117,7 +2117,7 @@ void MSWordExportBase::NearestAnnotationMark( sal_Int32& rNearest, const sal_Int if ( !m_rSortedAnnotationMarksEnd.empty() ) { IMark* pMarkEnd = m_rSortedAnnotationMarksEnd[0]; - const sal_Int32 nNext = pMarkEnd->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nNext = pMarkEnd->GetMarkEnd().GetContentIndex(); if( !bNextPositionOnly || nNext > nCurrentPos ) { if ( !bHasAnnotationMark ) @@ -2138,8 +2138,8 @@ void MSWordExportBase::GetSortedAnnotationMarks( const SwWW8AttrIter& rAttrs, sa for ( IMark* pMark : aMarksStart ) { // Remove the positions equal to the current pos - const sal_Int32 nStart = pMark->GetMarkStart().nContent.GetIndex(); - const sal_Int32 nEnd = pMark->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex(); + const sal_Int32 nEnd = pMark->GetMarkEnd().GetContentIndex(); const SwTextNode& rNode = rAttrs.GetNode(); if ( nStart > nCurrentPos && ( pMark->GetMarkStart().nNode == rNode.GetIndex()) ) @@ -2172,8 +2172,8 @@ void MSWordExportBase::GetSortedBookmarks( const SwTextNode& rNode, sal_Int32 nC for ( IMark* pMark : aMarksStart ) { // Remove the positions equal to the current pos - const sal_Int32 nStart = pMark->GetMarkStart().nContent.GetIndex(); - const sal_Int32 nEnd = pMark->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex(); + const sal_Int32 nEnd = pMark->GetMarkEnd().GetContentIndex(); if ( nStart > nCurrentPos && ( pMark->GetMarkStart().nNode == rNode.GetIndex()) ) aSortedStart.push_back( pMark ); @@ -2233,7 +2233,7 @@ bool MSWordExportBase::NeedTextNodeSplit( const SwTextNode& rNd, SwSoftPageBreak pos = rNd.Len(); // skip everything break; } - pos = pMark->GetMarkEnd().nContent.GetIndex(); // no +1, it's behind the char + pos = pMark->GetMarkEnd().GetContentIndex(); // no +1, it's behind the char } pList.insert(pos); } diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index d0ae1a49d835..a7c5cd8d1382 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1443,17 +1443,17 @@ void WW8Export::AppendBookmarks( const SwTextNode& rNd, sal_Int32 nCurrentPos, s } if( !pOPos || ( nNd == pPos->GetNodeIndex() && - ( nContent = pPos->nContent.GetIndex() ) >= nCurrentPos && + ( nContent = pPos->GetContentIndex() ) >= nCurrentPos && nContent < nCurrentEnd ) ) { - sal_uLong nCp = nSttCP + pPos->nContent.GetIndex() - nCurrentPos; + sal_uLong nCp = nSttCP + pPos->GetContentIndex() - nCurrentPos; m_pBkmks->Append(nCp, BookmarkToWord(rBkmk.GetName())); } if( pOPos && nNd == pOPos->GetNodeIndex() && - ( nContent = pOPos->nContent.GetIndex() ) >= nCurrentPos && + ( nContent = pOPos->GetContentIndex() ) >= nCurrentPos && nContent < nCurrentEnd ) { - sal_uLong nCp = nSttCP + pOPos->nContent.GetIndex() - nCurrentPos; + sal_uLong nCp = nSttCP + pOPos->GetContentIndex() - nCurrentPos; m_pBkmks->Append(nCp, BookmarkToWord(rBkmk.GetName())); } } @@ -1466,7 +1466,7 @@ void WW8Export::AppendAnnotationMarks(const SwWW8AttrIter& rAttrs, sal_Int32 nCu { for (const sw::mark::IMark* pMark : aMarks) { - const sal_Int32 nStart = pMark->GetMarkStart().nContent.GetIndex(); + const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex(); if (nStart == nCurrentPos) { m_pAtn->AddRangeStartPosition(pMark->GetName(), Fc2Cp(Strm().Tell()), @@ -2755,7 +2755,7 @@ public: { bool bSimpleContentRemains = m_pCurPam->GetPoint()->nNode < m_pCurPam->GetMark()->nNode || (m_pCurPam->GetPoint()->nNode == m_pCurPam->GetMark()->nNode && - m_pCurPam->GetPoint()->nContent.GetIndex() <= m_pCurPam->GetMark()->nContent.GetIndex()); + m_pCurPam->GetPoint()->GetContentIndex() <= m_pCurPam->GetMark()->GetContentIndex()); if (bSimpleContentRemains) return true; diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 749ec62caa95..802762987863 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1474,7 +1474,7 @@ const SfxPoolItem* SwWW8FltControlStack::GetFormatAttr(const SwPosition& rPos, */ if (pNd->IsTextNode()) { - const sal_Int32 nPos = rPos.nContent.GetIndex(); + const sal_Int32 nPos = rPos.GetContentIndex(); m_xScratchSet.reset(new SfxItemSet(m_rDoc.GetAttrPool(), nWhich, nWhich)); if (pNd->GetTextNode()->GetParaAttr(*m_xScratchSet, nPos, nPos)) pItem = m_xScratchSet->GetItem(nWhich); @@ -1571,10 +1571,10 @@ void SwWW8FltRefStack::SetAttrInDoc(const SwPosition& rTmpPos, const SwPosition& rBkMrkPos = pMark->GetMarkPos(); SwTextNode* pText = rBkMrkPos.GetNode().GetTextNode(); - if( pText && rBkMrkPos.nContent.GetIndex() ) + if( pText && rBkMrkPos.GetContentIndex() ) { SwTextAttr* const pFootnote = pText->GetTextAttrForCharAt( - rBkMrkPos.nContent.GetIndex()-1, RES_TXTATR_FTN ); + rBkMrkPos.GetContentIndex()-1, RES_TXTATR_FTN ); if( pFootnote ) { sal_uInt16 nRefNo = static_cast<SwTextFootnote*>(pFootnote)->GetSeqRefNo(); @@ -2503,7 +2503,7 @@ bool SwWW8ImplReader::SetSpacing(SwPaM &rMyPam, int nSpace, bool bIsUpper ) else aUL.SetLower( static_cast< sal_uInt16 >(nSpace) ); - const sal_Int32 nEnd = pSpacingPos->nContent.GetIndex(); + const sal_Int32 nEnd = pSpacingPos->GetContentIndex(); rMyPam.GetPoint()->nContent.Assign(rMyPam.GetContentNode(), 0); m_xCtrlStck->NewAttr(*pSpacingPos, aUL); rMyPam.GetPoint()->nContent.Assign(rMyPam.GetContentNode(), nEnd); @@ -3572,7 +3572,7 @@ bool SwWW8ImplReader::HandlePageBreakChar() if (!m_bWasParaEnd && IsTemp) { bParaEndAdded = true; - if (0 >= m_pPaM->GetPoint()->nContent.GetIndex()) + if (0 >= m_pPaM->GetPoint()->GetContentIndex()) { if (SwTextNode* pTextNode = m_pPaM->GetNode().GetTextNode()) { @@ -4220,7 +4220,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) m_xPreviousNode.reset(); - if (m_pPaM->GetPoint()->nContent.GetIndex()) + if (m_pPaM->GetPoint()->GetContentIndex()) AppendTextNode(*m_pPaM->GetPoint()); if (!m_bInHyperlink) @@ -5429,7 +5429,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss) if (pHt->Which() != RES_TXTATR_FLYCNT) continue; const sal_Int32 st = pHt->GetStart(); - if (st >= (*ppBkmk)->GetMarkStart().nContent.GetIndex()) + if (st >= (*ppBkmk)->GetMarkStart().GetContentIndex()) { SwFrameFormat* pFrameFormat = pHt->GetFlyCnt().GetFrameFormat(); vecFrameFormat.push_back(pFrameFormat); @@ -6722,7 +6722,7 @@ bool SwWW8ImplReader::InEqualApo(int nLvl) const namespace sw::hack { Position::Position(const SwPosition &rPos) - : maPtNode(rPos.nNode), mnPtContent(rPos.nContent.GetIndex()) + : maPtNode(rPos.nNode), mnPtContent(rPos.GetContentIndex()) { } diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 972df1225e66..e140e6c471ac 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -189,7 +189,7 @@ sal_uInt16 SwWW8ImplReader::End_Footnote() //Get the footnote character and remove it from the txtnode. We'll //replace it with the footnote SwTextNode* pText = m_pPaM->GetNode().GetTextNode(); - sal_Int32 nPos = m_pPaM->GetPoint()->nContent.GetIndex(); + sal_Int32 nPos = m_pPaM->GetPoint()->GetContentIndex(); OUString sChar; SwTextFootnote* pFN = nullptr; @@ -2375,7 +2375,7 @@ void WW8TabDesc::CreateSwTable() // if there is already some content on the Node append new node to ensure // that this content remains ABOVE the table SwPosition* pPoint = m_pIo->m_pPaM->GetPoint(); - bool bInsNode = pPoint->nContent.GetIndex() != 0; + bool bInsNode = pPoint->GetContentIndex() != 0; bool bSetMinHeight = false; /* @@ -3008,7 +3008,7 @@ void WW8TabDesc::SetPamInCell(short nWwCol, bool bPam) SwPosition* pGridPos = m_pIo->m_pPaM->GetPoint(); - const sal_Int32 nEnd = pGridPos->nContent.GetIndex(); + const sal_Int32 nEnd = pGridPos->GetContentIndex(); pGridPos->nContent.Assign(m_pIo->m_pPaM->GetContentNode(), 0); m_pIo->m_xCtrlStck->NewAttr(*pGridPos, aGridItem); pGridPos->nContent.Assign(m_pIo->m_pPaM->GetContentNode(), nEnd); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 41b88884287a..2a6aa140ca4b 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -529,7 +529,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() case ww::eFORMTEXT: if (bUseEnhFields && m_pPaM!=nullptr && m_pPaM->GetPoint()!=nullptr) { SwPosition aEndPos = *m_pPaM->GetPoint(); - SwPaM aFieldPam( m_aFieldStack.back().GetPtNode(), m_aFieldStack.back().GetPtContent(), aEndPos.nNode, aEndPos.nContent.GetIndex()); + SwPaM aFieldPam( m_aFieldStack.back().GetPtNode(), m_aFieldStack.back().GetPtContent(), aEndPos.nNode, aEndPos.GetContentIndex()); IDocumentMarkAccess* pMarksAccess = m_rDoc.getIDocumentMarkAccess( ); IFieldmark *pFieldmark = pMarksAccess->makeFieldBookmark( aFieldPam, m_aFieldStack.back().GetBookmarkName(), ODF_FORMTEXT, @@ -596,7 +596,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() SwContentNode* pNd = aRestorePos.GetNode().GetContentNode(); sal_Int32 nMaxValidIndex = pNd ? pNd->Len() : 0; - if (aRestorePos.nContent.GetIndex() > nMaxValidIndex) + if (aRestorePos.GetContentIndex() > nMaxValidIndex) { SAL_WARN("sw.ww8", "Attempt to restore to invalid content position"); aRestorePos.nContent.Assign(pNd, nMaxValidIndex); @@ -637,7 +637,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() SwPosition aEndPos = *m_pPaM->GetPoint(); SwPaM aFieldPam( m_aFieldStack.back().GetPtNode(), m_aFieldStack.back().GetPtContent(), - aEndPos.nNode, aEndPos.nContent.GetIndex()); + aEndPos.nNode, aEndPos.GetContentIndex()); IDocumentMarkAccess* pMarksAccess = m_rDoc.getIDocumentMarkAccess( ); @@ -3448,7 +3448,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) m_bCareFirstParaEndInToc = true; } - if (m_pPaM->GetPoint()->nContent.GetIndex()) + if (m_pPaM->GetPoint()->GetContentIndex()) AppendTextNode(*m_pPaM->GetPoint()); const SwPosition* pPos = m_pPaM->GetPoint(); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 72cde2bb5946..19e888c9cfe1 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -3434,9 +3434,9 @@ SwFrameFormat *SwWW8ImplReader::ContainsSingleInlineGraphic(const SwPaM &rRegion */ SwFrameFormat *pRet=nullptr; SwNodeIndex aBegin(rRegion.Start()->nNode); - const sal_Int32 nBegin(rRegion.Start()->nContent.GetIndex()); + const sal_Int32 nBegin(rRegion.Start()->GetContentIndex()); SwNodeIndex aEnd(rRegion.End()->nNode); - const sal_Int32 nEnd(rRegion.End()->nContent.GetIndex()); + const sal_Int32 nEnd(rRegion.End()->GetContentIndex()); const SwTextNode* pTNd; const SwTextAttr* pTFlyAttr; if ( @@ -4546,7 +4546,7 @@ void SwWW8ImplReader::Read_LineBreakClear(sal_uInt16 /*nId*/, const sal_uInt8* p if (nLen == -1 && m_oLineBreakClear.has_value()) { SwTextNode* pText = m_pPaM->GetNode().GetTextNode(); - sal_Int32 nPos = m_pPaM->GetPoint()->nContent.GetIndex(); + sal_Int32 nPos = m_pPaM->GetPoint()->GetContentIndex(); if (!pText || !nPos) { // There should have been a linebreak char. diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 6cbfbda7b17a..30b8daaf4840 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -676,7 +676,7 @@ void SwXMLImport::endDocument() pPaM->GetBound().GetNodeIndex() ) { const sal_Int32 nCntPos = - pPaM->GetBound().nContent.GetIndex(); + pPaM->GetBound().GetContentIndex(); pPaM->GetBound().nContent.Assign( pTextNode, pTextNode->GetText().getLength() + nCntPos ); } @@ -684,7 +684,7 @@ void SwXMLImport::endDocument() pPaM->GetBound( false ).GetNodeIndex() ) { const sal_Int32 nCntPos = - pPaM->GetBound( false ).nContent.GetIndex(); + pPaM->GetBound( false ).GetContentIndex(); pPaM->GetBound( false ).nContent.Assign( pTextNode, pTextNode->GetText().getLength() + nCntPos ); } @@ -711,8 +711,8 @@ void SwXMLImport::endDocument() } SwPosition* pPos = pPaM->GetPoint(); - OSL_ENSURE( !pPos->nContent.GetIndex(), "last paragraph isn't empty" ); - if( !pPos->nContent.GetIndex() ) + OSL_ENSURE( !pPos->GetContentIndex(), "last paragraph isn't empty" ); + if( !pPos->GetContentIndex() ) { SwTextNode* pCurrNd; SwNodeOffset nNodeIdx = pPos->GetNodeIndex(); |