sw/inc/pam.hxx | 3 sw/inc/swcrsr.hxx | 6 sw/qa/core/txtnode/txtnode.cxx | 6 sw/qa/core/uwriter.cxx | 50 ++-- sw/qa/extras/globalfilter/globalfilter.cxx | 18 - sw/qa/extras/layout/layout.cxx | 18 - sw/qa/extras/rtfexport/rtfexport4.cxx | 4 sw/qa/extras/tiledrendering/tiledrendering.cxx | 10 sw/qa/extras/uiwriter/uiwriter.cxx | 18 - sw/qa/extras/uiwriter/uiwriter2.cxx | 20 - sw/qa/extras/uiwriter/uiwriter4.cxx | 4 sw/qa/extras/uiwriter/uiwriter5.cxx | 4 sw/qa/extras/uiwriter/uiwriter7.cxx | 18 - sw/qa/uibase/uno/uno.cxx | 2 sw/qa/uibase/wrtsh/wrtsh.cxx | 4 sw/source/core/access/accframebase.cxx | 6 sw/source/core/access/accmap.cxx | 6 sw/source/core/access/accpara.cxx | 4 sw/source/core/crsr/annotationmark.cxx | 2 sw/source/core/crsr/bookmark.cxx | 42 ++-- sw/source/core/crsr/callnk.cxx | 4 sw/source/core/crsr/crbm.cxx | 4 sw/source/core/crsr/crossrefbookmark.cxx | 2 sw/source/core/crsr/crsrsh.cxx | 32 +-- sw/source/core/crsr/crstrvl.cxx | 36 +-- sw/source/core/crsr/findattr.cxx | 30 +- sw/source/core/crsr/findfmt.cxx | 4 sw/source/core/crsr/findtxt.cxx | 6 sw/source/core/crsr/pam.cxx | 20 - sw/source/core/crsr/swcrsr.cxx | 62 +++--- sw/source/core/crsr/trvlfnfl.cxx | 6 sw/source/core/crsr/trvlreg.cxx | 6 sw/source/core/crsr/trvltbl.cxx | 4 sw/source/core/crsr/viscrs.cxx | 4 sw/source/core/doc/CntntIdxStore.cxx | 24 +- sw/source/core/doc/DocumentContentOperationsManager.cxx | 164 ++++++++-------- sw/source/core/doc/DocumentFieldsManager.cxx | 2 sw/source/core/doc/DocumentLayoutManager.cxx | 4 sw/source/core/doc/DocumentRedlineManager.cxx | 16 - sw/source/core/doc/dbgoutsw.cxx | 2 sw/source/core/doc/doc.cxx | 4 sw/source/core/doc/docbm.cxx | 30 +- sw/source/core/doc/doccomp.cxx | 10 sw/source/core/doc/doccorr.cxx | 6 sw/source/core/doc/docedt.cxx | 30 +- sw/source/core/doc/docfld.cxx | 16 - sw/source/core/doc/docfly.cxx | 8 sw/source/core/doc/docfmt.cxx | 12 - sw/source/core/doc/docftn.cxx | 4 sw/source/core/doc/doclay.cxx | 16 - sw/source/core/doc/docnum.cxx | 12 - sw/source/core/doc/docredln.cxx | 18 - sw/source/core/doc/docruby.cxx | 12 - sw/source/core/doc/doctxm.cxx | 2 sw/source/core/doc/extinput.cxx | 14 - sw/source/core/doc/swserv.cxx | 4 sw/source/core/docnode/ndsect.cxx | 26 +- sw/source/core/docnode/ndtbl.cxx | 12 - sw/source/core/docnode/nodes.cxx | 20 - sw/source/core/edit/acorrect.cxx | 8 sw/source/core/edit/autofmt.cxx | 4 sw/source/core/edit/edattr.cxx | 18 - sw/source/core/edit/eddel.cxx | 2 sw/source/core/edit/edfcol.cxx | 4 sw/source/core/edit/edfmt.cxx | 12 - sw/source/core/edit/editsh.cxx | 16 - sw/source/core/edit/edlingu.cxx | 52 ++--- sw/source/core/edit/edsect.cxx | 8 sw/source/core/edit/edtab.cxx | 4 sw/source/core/fields/postithelper.cxx | 6 sw/source/core/fields/reffld.cxx | 4 sw/source/core/frmedt/fefly1.cxx | 4 sw/source/core/frmedt/feshview.cxx | 2 sw/source/core/frmedt/fetab.cxx | 2 sw/source/core/frmedt/fews.cxx | 2 sw/source/core/layout/atrfrm.cxx | 2 sw/source/core/layout/flycnt.cxx | 2 sw/source/core/layout/frmtool.cxx | 6 sw/source/core/layout/layact.cxx | 2 sw/source/core/layout/sortedobjs.cxx | 4 sw/source/core/layout/trvlfrm.cxx | 6 sw/source/core/table/swtable.cxx | 4 sw/source/core/text/itratr.cxx | 14 - sw/source/core/text/itrform2.cxx | 2 sw/source/core/text/porlay.cxx | 44 ++-- sw/source/core/text/redlnitr.cxx | 16 - sw/source/core/text/txtfrm.cxx | 6 sw/source/core/tox/txmsrt.cxx | 2 sw/source/core/txtnode/modeltoviewhelper.cxx | 6 sw/source/core/txtnode/ndtxt.cxx | 14 - sw/source/core/txtnode/txtedt.cxx | 2 sw/source/core/undo/SwUndoField.cxx | 2 sw/source/core/undo/rolbck.cxx | 16 - sw/source/core/undo/unattr.cxx | 12 - sw/source/core/undo/undel.cxx | 12 - sw/source/core/undo/undobj.cxx | 30 +- sw/source/core/undo/undobj1.cxx | 12 - sw/source/core/undo/undraw.cxx | 4 sw/source/core/undo/unins.cxx | 24 +- sw/source/core/undo/unmove.cxx | 2 sw/source/core/undo/unnum.cxx | 2 sw/source/core/undo/unovwr.cxx | 26 +- sw/source/core/undo/unredln.cxx | 6 sw/source/core/undo/unsect.cxx | 4 sw/source/core/undo/unspnd.cxx | 2 sw/source/core/undo/untbl.cxx | 2 sw/source/core/undo/untblk.cxx | 4 sw/source/core/unocore/unocrsrhelper.cxx | 20 - sw/source/core/unocore/unodraw.cxx | 10 sw/source/core/unocore/unofield.cxx | 6 sw/source/core/unocore/unoframe.cxx | 2 sw/source/core/unocore/unoftn.cxx | 2 sw/source/core/unocore/unolinebreak.cxx | 2 sw/source/core/unocore/unoobj.cxx | 14 - sw/source/core/unocore/unoobj2.cxx | 14 - sw/source/core/unocore/unoport.cxx | 4 sw/source/core/unocore/unoportenum.cxx | 18 - sw/source/core/unocore/unorefmk.cxx | 10 sw/source/core/unocore/unotbl.cxx | 2 sw/source/core/unocore/unotext.cxx | 12 - sw/source/core/unocore/unotextmarkup.cxx | 4 sw/source/filter/ascii/ascatr.cxx | 12 - sw/source/filter/ascii/parasc.cxx | 2 sw/source/filter/ascii/wrtasc.cxx | 2 sw/source/filter/basflt/fltshell.cxx | 8 sw/source/filter/basflt/shellio.cxx | 2 sw/source/filter/html/htmlatr.cxx | 6 sw/source/filter/html/htmlcss1.cxx | 4 sw/source/filter/html/htmlctxt.cxx | 12 - sw/source/filter/html/htmlfld.cxx | 4 sw/source/filter/html/htmlfly.cxx | 2 sw/source/filter/html/htmlform.cxx | 4 sw/source/filter/html/htmlftn.cxx | 2 sw/source/filter/html/htmlgrin.cxx | 12 - sw/source/filter/html/htmlnumreader.cxx | 8 sw/source/filter/html/htmlsect.cxx | 4 sw/source/filter/html/htmltab.cxx | 26 +- sw/source/filter/html/swhtml.cxx | 66 +++--- sw/source/filter/html/swhtml.hxx | 2 sw/source/filter/html/wrthtml.cxx | 2 sw/source/filter/inc/fltshell.hxx | 4 sw/source/filter/writer/writer.cxx | 4 sw/source/filter/ww8/docxexport.cxx | 8 sw/source/filter/ww8/rtfexport.cxx | 8 sw/source/filter/ww8/writerhelper.cxx | 6 sw/source/filter/ww8/wrtw8nds.cxx | 56 ++--- sw/source/filter/ww8/wrtww8.cxx | 12 - sw/source/filter/ww8/ww8par.cxx | 16 - sw/source/filter/ww8/ww8par2.cxx | 6 sw/source/filter/ww8/ww8par5.cxx | 8 sw/source/filter/ww8/ww8par6.cxx | 6 sw/source/filter/xml/xmlimp.cxx | 8 sw/source/ui/misc/contentcontroldlg.cxx | 2 sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx | 8 sw/source/uibase/dochdl/swdtflvr.cxx | 4 sw/source/uibase/docvw/AnnotationWin.cxx | 6 sw/source/uibase/docvw/edtwin.cxx | 16 - sw/source/uibase/lingu/hhcwrp.cxx | 6 sw/source/uibase/shells/langhelper.cxx | 2 sw/source/uibase/shells/textfld.cxx | 12 - sw/source/uibase/shells/textsh1.cxx | 2 sw/source/uibase/uiview/viewling.cxx | 2 sw/source/uibase/uno/unotxdoc.cxx | 6 sw/source/uibase/wrtsh/delete.cxx | 2 sw/source/uibase/wrtsh/select.cxx | 4 165 files changed, 945 insertions(+), 942 deletions(-)
New commits: commit af23d1c1fc407b3d5f020122e2830959d45ffaf1 Author: Noel Grandin <[email protected]> AuthorDate: Mon Aug 1 10:30:06 2022 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue Aug 2 15:11:17 2022 +0200 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 <[email protected]> diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx index 900793dbe969..4df18cafb49b 100644 --- a/sw/inc/pam.hxx +++ b/sw/inc/pam.hxx @@ -78,6 +78,9 @@ struct SAL_WARN_UNUSED SW_DLLPUBLIC SwPosition SwNodes& GetNodes() { return nNode.GetNodes(); } SwNode& GetNode() const { return nNode.GetNode(); } + + + sal_Int32 GetContentIndex() const { return nContent.GetIndex(); } }; SW_DLLPUBLIC std::ostream &operator <<(std::ostream& s, const SwPosition& position); diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index c78a5bea80ed..486507b23c4e 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -246,7 +246,7 @@ struct SwCursor_SavePos final SwCursor_SavePos( const SwCursor& rCursor ) : nNode( rCursor.GetPoint()->GetNodeIndex() ), - nContent( rCursor.GetPoint()->nContent.GetIndex() ) + nContent( rCursor.GetPoint()->GetContentIndex() ) {} }; @@ -291,8 +291,8 @@ public: { return m_nTableMkNd != GetMark()->GetNodeIndex() || m_nTablePtNd != GetPoint()->GetNodeIndex() || - m_nTableMkCnt != GetMark()->nContent.GetIndex() || - m_nTablePtCnt != GetPoint()->nContent.GetIndex(); + m_nTableMkCnt != GetMark()->GetContentIndex() || + m_nTablePtCnt != GetPoint()->GetContentIndex(); } bool IsChgd() const { return m_bChanged; } diff --git a/sw/qa/core/txtnode/txtnode.cxx b/sw/qa/core/txtnode/txtnode.cxx index 69feba758a7c..bad6155de8c0 100644 --- a/sw/qa/core/txtnode/txtnode.cxx +++ b/sw/qa/core/txtnode/txtnode.cxx @@ -173,7 +173,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testFlyAnchorUndo) SwDocShell* pShell = pTextDoc->GetDocShell(); SwDoc* pDoc = pShell->GetDoc(); const SwFrameFormats& rSpz = *pDoc->GetSpzFrameFormats(); - sal_Int32 nExpected = rSpz[0]->GetAnchor().GetContentAnchor()->nContent.GetIndex(); + sal_Int32 nExpected = rSpz[0]->GetAnchor().GetContentAnchor()->GetContentIndex(); // When deleting that last character and undoing it: SwWrtShell* pWrtShell = pShell->GetWrtShell(); @@ -182,7 +182,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testFlyAnchorUndo) pWrtShell->Undo(); // Then make sure the anchor position after the undo is the same as the original: - sal_Int32 nActual = rSpz[0]->GetAnchor().GetContentAnchor()->nContent.GetIndex(); + sal_Int32 nActual = rSpz[0]->GetAnchor().GetContentAnchor()->GetContentIndex(); // Without the accompanying fix in place, this test would have failed with: // - Expected: 3 // - Actual : 2 @@ -283,7 +283,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testPictureContentControlKeyboard) const SwFormatAnchor& rFormatAnchor = pFlyFormat->GetAnchor(); const SwPosition* pAnchorPos = rFormatAnchor.GetContentAnchor(); SwTextNode* pTextNode = pAnchorPos->GetNode().GetTextNode(); - SwTextAttr* pAttr = pTextNode->GetTextAttrAt(pAnchorPos->nContent.GetIndex(), + SwTextAttr* pAttr = pTextNode->GetTextAttrAt(pAnchorPos->GetContentIndex(), RES_TXTATR_CONTENTCONTROL, SwTextNode::PARENT); auto pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr); auto& rFormatContentControl diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index b09b874f7a41..7cd0b38ec2ae 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -303,10 +303,10 @@ static SwTextNode* getModelToViewTestDocument(SwDoc *pDoc) pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint()); pDoc->getIDocumentContentOperations().InsertString(aPaM, "AAAAA BBBBB "); SwTextNode* pTextNode = aPaM.GetNode().GetTextNode(); - sal_Int32 nPos = aPaM.GetPoint()->nContent.GetIndex(); + sal_Int32 nPos = aPaM.GetPoint()->GetContentIndex(); pTextNode->InsertItem(aFootnote, nPos, nPos); pDoc->getIDocumentContentOperations().InsertString(aPaM, " CCCCC "); - nPos = aPaM.GetPoint()->nContent.GetIndex(); + nPos = aPaM.GetPoint()->GetContentIndex(); pTextNode->InsertItem(aFootnote, nPos, nPos); pDoc->getIDocumentContentOperations().InsertString(aPaM, " DDDDD"); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>((4*5) + 5 + 2), pTextNode->GetText().getLength()); @@ -699,7 +699,7 @@ void SwDocTest::testSwScanner() m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint()); m_pDoc->getIDocumentContentOperations().InsertString(aPaM, "Apple"); pTextNode = aPaM.GetNode().GetTextNode(); - sal_Int32 nPos = aPaM.GetPoint()->nContent.GetIndex(); + sal_Int32 nPos = aPaM.GetPoint()->GetContentIndex(); SwFormatFootnote aFootnote; aFootnote.SetNumStr("banana"); SwTextAttr* pTA = pTextNode->InsertItem(aFootnote, nPos, nPos); @@ -709,7 +709,7 @@ void SwDocTest::testSwScanner() CPPUNIT_ASSERT_EQUAL(static_cast<sal_uLong>(1), aDocStat.nWord); CPPUNIT_ASSERT_EQUAL_MESSAGE("footnote should be expanded", static_cast<sal_uLong>(11), aDocStat.nChar); - const sal_Int32 nNextPos = aPaM.GetPoint()->nContent.GetIndex(); + const sal_Int32 nNextPos = aPaM.GetPoint()->GetContentIndex(); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(nPos+1), nNextPos); SwFormatRefMark aRef("refmark"); pTA = pTextNode->InsertItem(aRef, nNextPos, nNextPos); @@ -1409,21 +1409,21 @@ void SwDocTest::testMarkMove() SwPaM aPaM(aIdx); m_pDoc->getIDocumentContentOperations().InsertString(aPaM, "Paragraph 1"); aPaM.SetMark(); - aPaM.GetMark()->nContent -= aPaM.GetMark()->nContent.GetIndex(); + aPaM.GetMark()->nContent -= aPaM.GetMark()->GetContentIndex(); pMarksAccess->makeMark(aPaM, "Para1", IDocumentMarkAccess::MarkType::BOOKMARK, sw::mark::InsertMode::New); m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint()); m_pDoc->getIDocumentContentOperations().InsertString(aPaM, "Paragraph 2"); aPaM.SetMark(); - aPaM.GetMark()->nContent -= aPaM.GetMark()->nContent.GetIndex(); + aPaM.GetMark()->nContent -= aPaM.GetMark()->GetContentIndex(); pMarksAccess->makeMark(aPaM, "Para2", IDocumentMarkAccess::MarkType::BOOKMARK, sw::mark::InsertMode::New); m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint()); m_pDoc->getIDocumentContentOperations().InsertString(aPaM, "Paragraph 3"); aPaM.SetMark(); - aPaM.GetMark()->nContent -= aPaM.GetMark()->nContent.GetIndex(); + aPaM.GetMark()->nContent -= aPaM.GetMark()->GetContentIndex(); pMarksAccess->makeMark(aPaM, "Para3", IDocumentMarkAccess::MarkType::BOOKMARK, sw::mark::InsertMode::New); } @@ -1438,20 +1438,20 @@ void SwDocTest::testMarkMove() ::sw::mark::IMark* pBM2 = *pMarksAccess->findMark("Para2"); ::sw::mark::IMark* pBM3 = *pMarksAccess->findMark("Para3"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0) , pBM1->GetMarkStart().nContent.GetIndex()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(11), pBM1->GetMarkEnd().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0) , pBM1->GetMarkStart().GetContentIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(11), pBM1->GetMarkEnd().GetContentIndex()); CPPUNIT_ASSERT_EQUAL( pBM1->GetMarkStart().GetNodeIndex(), pBM1->GetMarkEnd().GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0) , pBM2->GetMarkStart().nContent.GetIndex()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(11), pBM2->GetMarkEnd().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0) , pBM2->GetMarkStart().GetContentIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(11), pBM2->GetMarkEnd().GetContentIndex()); CPPUNIT_ASSERT_EQUAL( pBM2->GetMarkStart().GetNodeIndex(), pBM2->GetMarkEnd().GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(11), pBM3->GetMarkStart().nContent.GetIndex()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(22), pBM3->GetMarkEnd().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(11), pBM3->GetMarkStart().GetContentIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(22), pBM3->GetMarkEnd().GetContentIndex()); CPPUNIT_ASSERT_EQUAL( pBM3->GetMarkStart().GetNodeIndex(), pBM3->GetMarkEnd().GetNodeIndex()); @@ -1475,20 +1475,20 @@ void SwDocTest::testMarkMove() pBM2 = *pMarksAccess->findMark("Para2"); pBM3 = *pMarksAccess->findMark("Para3"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pBM1->GetMarkStart().nContent.GetIndex()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(6), pBM1->GetMarkEnd().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pBM1->GetMarkStart().GetContentIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(6), pBM1->GetMarkEnd().GetContentIndex()); CPPUNIT_ASSERT_EQUAL( pBM1->GetMarkStart().GetNodeIndex(), pBM1->GetMarkEnd().GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(6), pBM2->GetMarkStart().nContent.GetIndex()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), pBM2->GetMarkEnd().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(6), pBM2->GetMarkStart().GetContentIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(12), pBM2->GetMarkEnd().GetContentIndex()); CPPUNIT_ASSERT_EQUAL( pBM2->GetMarkStart().GetNodeIndex(), pBM2->GetMarkEnd().GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), pBM3->GetMarkStart().nContent.GetIndex()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(23), pBM3->GetMarkEnd().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(12), pBM3->GetMarkStart().GetContentIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(23), pBM3->GetMarkEnd().GetContentIndex()); CPPUNIT_ASSERT_EQUAL( pBM3->GetMarkStart().GetNodeIndex(), pBM3->GetMarkEnd().GetNodeIndex()); @@ -1511,20 +1511,20 @@ void SwDocTest::testMarkMove() pBM2 = *pMarksAccess->findMark("Para2"); pBM3 = *pMarksAccess->findMark("Para3"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pBM1->GetMarkStart().nContent.GetIndex()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(6), pBM1->GetMarkEnd().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pBM1->GetMarkStart().GetContentIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(6), pBM1->GetMarkEnd().GetContentIndex()); CPPUNIT_ASSERT_EQUAL( pBM1->GetMarkStart().GetNodeIndex(), pBM1->GetMarkEnd().GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(6), pBM2->GetMarkStart().nContent.GetIndex()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(4), pBM2->GetMarkEnd().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(6), pBM2->GetMarkStart().GetContentIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), pBM2->GetMarkEnd().GetContentIndex()); CPPUNIT_ASSERT_EQUAL( pBM2->GetMarkStart().GetNodeIndex()+1, pBM2->GetMarkEnd().GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(4), pBM3->GetMarkStart().nContent.GetIndex()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(15), pBM3->GetMarkEnd().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), pBM3->GetMarkStart().GetContentIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(15), pBM3->GetMarkEnd().GetContentIndex()); CPPUNIT_ASSERT_EQUAL( pBM3->GetMarkStart().GetNodeIndex(), pBM3->GetMarkEnd().GetNodeIndex()); diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index a4cf833bbc21..850df79be627 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -987,7 +987,7 @@ static auto verifyNestedFieldmark(OUString const& rTestName, SwPosition const innerPos(*node1.GetNode().GetTextNode(), node1.GetNode().GetTextNode()->GetText().indexOf(CH_TXT_ATR_FIELDSTART)); CPPUNIT_ASSERT_EQUAL_MESSAGE(rTestName.toUtf8().getStr(), - sal_Int32(1), innerPos.nContent.GetIndex()); + sal_Int32(1), innerPos.GetContentIndex()); ::sw::mark::IFieldmark *const pInner(rIDMA.getFieldmarkAt(innerPos)); CPPUNIT_ASSERT_MESSAGE(rTestName.toUtf8().getStr(), pInner); OUString const innerString(SwPaM(pInner->GetMarkPos(), pInner->GetOtherMarkPos()).GetText()); @@ -1003,7 +1003,7 @@ static auto verifyNestedFieldmark(OUString const& rTestName, SwPosition const outerPos(*node2.GetNode().GetTextNode(), node2.GetNode().GetTextNode()->GetText().indexOf(CH_TXT_ATR_FIELDSTART)); CPPUNIT_ASSERT_EQUAL_MESSAGE(rTestName.toUtf8().getStr(), - sal_Int32(0), outerPos.nContent.GetIndex()); + sal_Int32(0), outerPos.GetContentIndex()); ::sw::mark::IFieldmark const*const pOuter(rIDMA.getFieldmarkAt(outerPos)); CPPUNIT_ASSERT_MESSAGE(rTestName.toUtf8().getStr(), pOuter); OUString const outerString(SwPaM(pOuter->GetMarkPos(), pOuter->GetOtherMarkPos()).GetText()); @@ -1703,7 +1703,7 @@ void Test::testDateFormField() CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString(vEnSpaces, 5), sCurrentDate); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), SwNodeOffset(9), pFieldmark->GetMarkStart().GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(5), pFieldmark->GetMarkStart().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(5), pFieldmark->GetMarkStart().GetContentIndex()); } else if (nIndex == 1) // The second has the default format { @@ -1712,7 +1712,7 @@ void Test::testDateFormField() CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString("06/12/19"), sCurrentDate); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), SwNodeOffset(9), pFieldmark->GetMarkStart().GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(20), pFieldmark->GetMarkStart().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(20), pFieldmark->GetMarkStart().GetContentIndex()); } else if (nIndex == 2) // The third one has special format { @@ -1721,7 +1721,7 @@ void Test::testDateFormField() CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString("2019. febr. 12."), sCurrentDate); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), SwNodeOffset(9), pFieldmark->GetMarkStart().GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(40), pFieldmark->GetMarkStart().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(40), pFieldmark->GetMarkStart().GetContentIndex()); } else if (nIndex == 3) // The fourth one has placeholder text @@ -1731,7 +1731,7 @@ void Test::testDateFormField() CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString("[select date]"), sCurrentDate); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), SwNodeOffset(9), pFieldmark->GetMarkStart().GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(62), pFieldmark->GetMarkStart().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(62), pFieldmark->GetMarkStart().GetContentIndex()); } else // The last one is really empty @@ -1741,7 +1741,7 @@ void Test::testDateFormField() CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString(""), sCurrentDate); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), SwNodeOffset(9), pFieldmark->GetMarkStart().GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(82), pFieldmark->GetMarkStart().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(82), pFieldmark->GetMarkStart().GetContentIndex()); } ++nIndex; @@ -1865,8 +1865,8 @@ void Test::testDateFormFieldCharacterFormatting() ::sw::mark::IDateFieldmark* pFieldmark = dynamic_cast<::sw::mark::IDateFieldmark*>(*pMarkAccess->getAllMarksBegin()); CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), pFieldmark); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString(ODF_FORMDATE), pFieldmark->GetFieldname()); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(0), pFieldmark->GetMarkStart().nContent.GetIndex()); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(11), pFieldmark->GetMarkEnd().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(0), pFieldmark->GetMarkStart().GetContentIndex()); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(11), pFieldmark->GetMarkEnd().GetContentIndex()); // We have one date field, first half of the field has bold character weight and second part has red character color CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), awt::FontWeight::BOLD, getProperty<float>(getRun(getParagraph(1), 3), "CharWeight")); diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 0e3811fa22fc..d775962ffe26 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3870,17 +3870,17 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBtlrCell) // Test that pressing "up" at the start of the cell goes to the next character position. SwNodeOffset nNodeIndex = pWrtShell->GetCursor()->Start()->GetNodeIndex(); - sal_Int32 nIndex = pWrtShell->GetCursor()->Start()->nContent.GetIndex(); + sal_Int32 nIndex = pWrtShell->GetCursor()->Start()->GetContentIndex(); KeyEvent aKeyEvent(0, KEY_UP); SwEditWin& rEditWin = pShell->GetView()->GetEditWin(); rEditWin.KeyInput(aKeyEvent); Scheduler::ProcessEventsToIdle(); // Without the accompanying fix in place, this test would have failed: "up" was interpreted as // logical "left", which does nothing if you're at the start of the text anyway. - CPPUNIT_ASSERT_EQUAL(nIndex + 1, pWrtShell->GetCursor()->Start()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(nIndex + 1, pWrtShell->GetCursor()->Start()->GetContentIndex()); // Test that pressing "right" goes to the next paragraph (logical "down"). - sal_Int32 nContentIndex = pWrtShell->GetCursor()->Start()->nContent.GetIndex(); + sal_Int32 nContentIndex = pWrtShell->GetCursor()->Start()->GetContentIndex(); aKeyEvent = KeyEvent(0, KEY_RIGHT); rEditWin.KeyInput(aKeyEvent); Scheduler::ProcessEventsToIdle(); @@ -3891,7 +3891,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBtlrCell) // Test that we have the correct character index after traveling to the next paragraph. // Without the accompanying fix in place, this test would have failed: char position was 5, i.e. // the cursor jumped to the end of the paragraph for no reason. - CPPUNIT_ASSERT_EQUAL(nContentIndex, pWrtShell->GetCursor()->Start()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(nContentIndex, pWrtShell->GetCursor()->Start()->GetContentIndex()); // Test that clicking "below" the second paragraph positions the cursor at the start of the // second paragraph. @@ -3916,7 +3916,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBtlrCell) CPPUNIT_ASSERT_EQUAL(aCellStart.GetNodeIndex() + 1, aPosition.GetNodeIndex()); // Without the accompanying fix in place, this test would have failed: character position was 5, // i.e. cursor was at the end of the paragraph. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aPosition.nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aPosition.GetContentIndex()); // Test that the selection rectangles are inside the cell frame if we select all the cell // content. @@ -4083,7 +4083,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testImageComment) // - Actual : 4 // i.e. the cursor got positioned between the image and its comment, so typing extended the // comment, instead of adding content after the commented image. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5), aPosition.nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5), aPosition.GetContentIndex()); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testScriptField) @@ -4116,7 +4116,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testScriptField) pCellTextFrame->GetModelPositionForViewPoint(&aPosition, aPoint); // Position was 1 without the fix from tdf#141079 - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aPosition.nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aPosition.GetContentIndex()); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testCommentCursorPosition) @@ -4146,7 +4146,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testCommentCursorPosition) // - Actual : 3 or 4 // i.e. the cursor got positioned before the comments, // so typing extended the first comment instead of adding content after the comments. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6), aPosition.nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6), aPosition.GetContentIndex()); // The second line is also important, but can't be auto-tested // since the failing situation depends on GetViewWidth which is zero in the headless tests. // bb<comment>| - the cursor should move behind the |, not before it. @@ -4179,7 +4179,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testCombiningCharacterCursorPosition) // - Actual : 1 // i.e. the cursor got positioned before the acute, so typing shifted the acute (applying it // to newly typed characters) instead of adding content after it. - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aPosition.nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aPosition.GetContentIndex()); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf64222) diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 7726fa4e7f0d..367b75ac34d8 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -117,11 +117,11 @@ DECLARE_RTFEXPORT_TEST(testAnchoredAtSamePosition, "anchor.fodt") CPPUNIT_ASSERT_EQUAL(RndStdIds::FLY_AT_CHAR, rFlys[0]->GetAnchor().GetAnchorId()); CPPUNIT_ASSERT_EQUAL(SwNodeOffset(12), rFlys[0]->GetAnchor().GetContentAnchor()->GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL(nIndex, rFlys[0]->GetAnchor().GetContentAnchor()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(nIndex, rFlys[0]->GetAnchor().GetContentAnchor()->GetContentIndex()); CPPUNIT_ASSERT_EQUAL(RndStdIds::FLY_AT_CHAR, rFlys[1]->GetAnchor().GetAnchorId()); CPPUNIT_ASSERT_EQUAL(SwNodeOffset(12), rFlys[1]->GetAnchor().GetContentAnchor()->GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL(nIndex, rFlys[1]->GetAnchor().GetContentAnchor()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(nIndex, rFlys[1]->GetAnchor().GetContentAnchor()->GetContentIndex()); } DECLARE_RTFEXPORT_TEST(testRedlineInsdel, "redline-insdel.rtf") diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index d6020fef6f58..32233cda4349 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -319,7 +319,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPostKeyEvent) pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); // Did we manage to go after the first character? - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pShellCursor->GetPoint()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pShellCursor->GetPoint()->GetContentIndex()); pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'x', 0); pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 'x', 0); @@ -335,7 +335,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPostMouseEvent) pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); // Did we manage to go after the first character? - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pShellCursor->GetPoint()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pShellCursor->GetPoint()->GetContentIndex()); Point aStart = pShellCursor->GetSttPos(); aStart.setX(aStart.getX() - 1000); @@ -343,7 +343,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPostMouseEvent) pXTextDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP, aStart.getX(), aStart.getY(), 1, MOUSE_LEFT, 0); Scheduler::ProcessEventsToIdle(); // The new cursor position must be before the first word. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), pShellCursor->GetPoint()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), pShellCursor->GetPoint()->GetContentIndex()); } CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSetTextSelection) @@ -2265,7 +2265,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testIMESupport) // the cursor should be at position 2nd SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), pShellCursor->GetPoint()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), pShellCursor->GetPoint()->GetContentIndex()); // content contains only the last IME composition, not all CPPUNIT_ASSERT_EQUAL(OUString(aInputs[aInputs.size() - 1] + "Aaa bbb."), pShellCursor->GetPoint()->GetNode().GetTextNode()->GetText()); @@ -2370,7 +2370,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testIMEFormattingAtEndOfParagraph) // the cursor should be at position 3rd SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), pShellCursor->GetPoint()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), pShellCursor->GetPoint()->GetContentIndex()); // check the content CPPUNIT_ASSERT_EQUAL(OUString("bab"), pShellCursor->GetPoint()->GetNode().GetTextNode()->GetText()); diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index a07869e1bee1..f18b5868a802 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -922,13 +922,13 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCp1000071) const SwRedlineTable& rTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable(); CPPUNIT_ASSERT_EQUAL( SwRedlineTable::size_type( 2 ), rTable.size()); SwNodeOffset redlineStart0NodeIndex = rTable[ 0 ]->Start()->GetNodeIndex(); - sal_Int32 redlineStart0Index = rTable[ 0 ]->Start()->nContent.GetIndex(); + sal_Int32 redlineStart0Index = rTable[ 0 ]->Start()->GetContentIndex(); SwNodeOffset redlineEnd0NodeIndex = rTable[ 0 ]->End()->GetNodeIndex(); - sal_Int32 redlineEnd0Index = rTable[ 0 ]->End()->nContent.GetIndex(); + sal_Int32 redlineEnd0Index = rTable[ 0 ]->End()->GetContentIndex(); SwNodeOffset redlineStart1NodeIndex = rTable[ 1 ]->Start()->GetNodeIndex(); - sal_Int32 redlineStart1Index = rTable[ 1 ]->Start()->nContent.GetIndex(); + sal_Int32 redlineStart1Index = rTable[ 1 ]->Start()->GetContentIndex(); SwNodeOffset redlineEnd1NodeIndex = rTable[ 1 ]->End()->GetNodeIndex(); - sal_Int32 redlineEnd1Index = rTable[ 1 ]->End()->nContent.GetIndex(); + sal_Int32 redlineEnd1Index = rTable[ 1 ]->End()->GetContentIndex(); // Change the document layout to be 2 columns, and then undo. pWrtShell->SelAll(); @@ -944,13 +944,13 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCp1000071) // Check that redlines are the same like at the beginning. CPPUNIT_ASSERT_EQUAL( SwRedlineTable::size_type( 2 ), rTable.size()); CPPUNIT_ASSERT_EQUAL( redlineStart0NodeIndex, rTable[ 0 ]->Start()->GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL( redlineStart0Index, rTable[ 0 ]->Start()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL( redlineStart0Index, rTable[ 0 ]->Start()->GetContentIndex()); CPPUNIT_ASSERT_EQUAL( redlineEnd0NodeIndex, rTable[ 0 ]->End()->GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL( redlineEnd0Index, rTable[ 0 ]->End()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL( redlineEnd0Index, rTable[ 0 ]->End()->GetContentIndex()); CPPUNIT_ASSERT_EQUAL( redlineStart1NodeIndex, rTable[ 1 ]->Start()->GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL( redlineStart1Index, rTable[ 1 ]->Start()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL( redlineStart1Index, rTable[ 1 ]->Start()->GetContentIndex()); CPPUNIT_ASSERT_EQUAL( redlineEnd1NodeIndex, rTable[ 1 ]->End()->GetNodeIndex()); - CPPUNIT_ASSERT_EQUAL( redlineEnd1Index, rTable[ 1 ]->End()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL( redlineEnd1Index, rTable[ 1 ]->End()->GetContentIndex()); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testShapeTextboxVertadjust) @@ -1014,7 +1014,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCommentedWord) // Make sure that not only the word, but its comment anchor is also selected. SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); // This was 9, only "word", not "word<anchor character>" was selected. - CPPUNIT_ASSERT_EQUAL(sal_Int32(10), pShellCursor->End()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(10), pShellCursor->End()->GetContentIndex()); // Test that getAnchor() points to "word", not to an empty string. uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index 91a1446259e6..dfecc0997d13 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -1110,7 +1110,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf135976) CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetFlyCount(FLYCNTTYPE_FRM)); CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetLayout()->GetLastPage()->GetSortedObjs()->size()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(4), pFly->GetAnchor().GetContentAnchor()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), pFly->GetAnchor().GetContentAnchor()->GetContentIndex()); pWrtShell->UnSelectFrame(); pWrtShell->SttEndDoc(/*bStart=*/false); @@ -1123,26 +1123,26 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf135976) // the problem was that the fly was deleted from the layout CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetLayout()->GetLastPage()->GetSortedObjs()->size()); // check that the anchor was moved outside the redline - CPPUNIT_ASSERT_EQUAL(sal_Int32(3), pFly->GetAnchor().GetContentAnchor()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), pFly->GetAnchor().GetContentAnchor()->GetContentIndex()); pWrtShell->Undo(2); CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetFlyCount(FLYCNTTYPE_FRM)); CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetLayout()->GetLastPage()->GetSortedObjs()->size()); // check that the anchor was restored - CPPUNIT_ASSERT_EQUAL(sal_Int32(4), pFly->GetAnchor().GetContentAnchor()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), pFly->GetAnchor().GetContentAnchor()->GetContentIndex()); pWrtShell->Redo(2); CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetFlyCount(FLYCNTTYPE_FRM)); CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetLayout()->GetLastPage()->GetSortedObjs()->size()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(3), pFly->GetAnchor().GetContentAnchor()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), pFly->GetAnchor().GetContentAnchor()->GetContentIndex()); pWrtShell->Undo(2); CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetFlyCount(FLYCNTTYPE_FRM)); CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetLayout()->GetLastPage()->GetSortedObjs()->size()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(4), pFly->GetAnchor().GetContentAnchor()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), pFly->GetAnchor().GetContentAnchor()->GetContentIndex()); // now again in the other direction: @@ -1155,25 +1155,25 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf135976) CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetFlyCount(FLYCNTTYPE_FRM)); // the problem was that the fly was deleted from the layout CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetLayout()->GetLastPage()->GetSortedObjs()->size()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(5), pFly->GetAnchor().GetContentAnchor()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), pFly->GetAnchor().GetContentAnchor()->GetContentIndex()); pWrtShell->Undo(2); CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetFlyCount(FLYCNTTYPE_FRM)); CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetLayout()->GetLastPage()->GetSortedObjs()->size()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(4), pFly->GetAnchor().GetContentAnchor()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), pFly->GetAnchor().GetContentAnchor()->GetContentIndex()); pWrtShell->Redo(2); CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetFlyCount(FLYCNTTYPE_FRM)); CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetLayout()->GetLastPage()->GetSortedObjs()->size()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(5), pFly->GetAnchor().GetContentAnchor()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), pFly->GetAnchor().GetContentAnchor()->GetContentIndex()); pWrtShell->Undo(2); CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetFlyCount(FLYCNTTYPE_FRM)); CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetLayout()->GetLastPage()->GetSortedObjs()->size()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(4), pFly->GetAnchor().GetContentAnchor()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), pFly->GetAnchor().GetContentAnchor()->GetContentIndex()); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf39721) @@ -1765,7 +1765,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf147414) // problem was this was 1 i.e. before the deleted "b" while " " was inserted after CPPUNIT_ASSERT_EQUAL(sal_Int32(3), - pWrtShell->getShellCursor(false)->GetPoint()->nContent.GetIndex()); + pWrtShell->getShellCursor(false)->GetPoint()->GetContentIndex()); CPPUNIT_ASSERT_EQUAL( OUString("Ab c"), pWrtShell->getShellCursor(false)->GetPoint()->GetNode().GetTextNode()->GetText()); diff --git a/sw/qa/extras/uiwriter/uiwriter4.cxx b/sw/qa/extras/uiwriter/uiwriter4.cxx index ae2c66471f14..b92c2a2992c5 100644 --- a/sw/qa/extras/uiwriter/uiwriter4.cxx +++ b/sw/qa/extras/uiwriter/uiwriter4.cxx @@ -1431,8 +1431,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testCursorWindows) SwShellCursor* pShellCursor1 = pWrtShell1->getShellCursor(false); SwShellCursor* pShellCursor2 = pWrtShell2->getShellCursor(false); // This was 3, not 0 -- cursor of the other window moved. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), pShellCursor1->Start()->nContent.GetIndex()); - CPPUNIT_ASSERT_EQUAL(aText.getLength(), pShellCursor2->Start()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), pShellCursor1->Start()->GetContentIndex()); + CPPUNIT_ASSERT_EQUAL(aText.getLength(), pShellCursor2->Start()->GetContentIndex()); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testLandscape) diff --git a/sw/qa/extras/uiwriter/uiwriter5.cxx b/sw/qa/extras/uiwriter/uiwriter5.cxx index db54e25e42f9..335ecaedd1c2 100644 --- a/sw/qa/extras/uiwriter/uiwriter5.cxx +++ b/sw/qa/extras/uiwriter/uiwriter5.cxx @@ -815,8 +815,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testCheckboxFormFieldInsertion) pWrtShell->StartOfSection(false); pWrtShell->SplitNode(); CPPUNIT_ASSERT_EQUAL(pFieldmark->GetMarkPos().nNode, pFieldmark->GetOtherMarkPos().nNode); - CPPUNIT_ASSERT_EQUAL(sal_Int32(pFieldmark->GetMarkPos().nContent.GetIndex() + 1), - pFieldmark->GetOtherMarkPos().nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(pFieldmark->GetMarkPos().GetContentIndex() + 1), + pFieldmark->GetOtherMarkPos().GetContentIndex()); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testDropDownFormFieldInsertion) diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx b/sw/qa/extras/uiwriter/uiwriter7.cxx index 41a84f5bc264..37e0e276a566 100644 --- a/sw/qa/extras/uiwriter/uiwriter7.cxx +++ b/sw/qa/extras/uiwriter/uiwriter7.cxx @@ -858,7 +858,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342) pCursor->Move(fnMoveForward); SwTextNode* pTextNd1 = pCursor->GetNode().GetTextNode(); SwTextAttr* const pFootnote1 - = pTextNd1->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + = pTextNd1->GetTextAttrForCharAt(pCursor->GetPoint()->GetContentIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote1(pFootnote1->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), rFootnote1.GetNumber()); SwTextFootnote* pTFNote1 = static_cast<SwTextFootnote*>(pFootnote1); @@ -867,7 +867,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342) pCursor->Move(fnMoveForward); SwTextNode* pTextNd2 = pCursor->GetNode().GetTextNode(); SwTextAttr* const pFootnote2 - = pTextNd2->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + = pTextNd2->GetTextAttrForCharAt(pCursor->GetPoint()->GetContentIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote2(pFootnote2->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), rFootnote2.GetNumber()); SwTextFootnote* pTFNote2 = static_cast<SwTextFootnote*>(pFootnote2); @@ -876,7 +876,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342) pCursor->Move(fnMoveForward); SwTextNode* pTextNd3 = pCursor->GetNode().GetTextNode(); SwTextAttr* const pFootnote3 - = pTextNd3->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + = pTextNd3->GetTextAttrForCharAt(pCursor->GetPoint()->GetContentIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote3(pFootnote3->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(3), rFootnote3.GetNumber()); SwTextFootnote* pTFNote3 = static_cast<SwTextFootnote*>(pFootnote3); @@ -899,7 +899,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342) pCursor->Move(fnMoveForward); SwTextNode* pTextNd4 = pCursor->GetNode().GetTextNode(); SwTextAttr* const pFootnote4 - = pTextNd4->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + = pTextNd4->GetTextAttrForCharAt(pCursor->GetPoint()->GetContentIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote4(pFootnote4->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(4), rFootnote4.GetNumber()); SwTextFootnote* pTFNote4 = static_cast<SwTextFootnote*>(pFootnote4); @@ -927,7 +927,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342) pCursor->Move(fnMoveForward); SwTextNode* pTextNd11 = pCursor->GetNode().GetTextNode(); SwTextAttr* const pFootnote11 - = pTextNd11->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + = pTextNd11->GetTextAttrForCharAt(pCursor->GetPoint()->GetContentIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote11(pFootnote11->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), rFootnote11.GetNumber()); SwTextFootnote* pTFNote11 = static_cast<SwTextFootnote*>(pFootnote11); @@ -957,7 +957,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342) pCursor->Move(fnMoveForward); SwTextNode* pTextNd12 = pCursor->GetNode().GetTextNode(); SwTextAttr* const pFootnote12 - = pTextNd12->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + = pTextNd12->GetTextAttrForCharAt(pCursor->GetPoint()->GetContentIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote12(pFootnote12->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), rFootnote12.GetNumber()); SwTextFootnote* pTFNote12 = static_cast<SwTextFootnote*>(pFootnote12); @@ -966,7 +966,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342) pCursor->Move(fnMoveForward); SwTextNode* pTextNd13 = pCursor->GetNode().GetTextNode(); SwTextAttr* const pFootnote13 - = pTextNd13->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + = pTextNd13->GetTextAttrForCharAt(pCursor->GetPoint()->GetContentIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote13(pFootnote13->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(3), rFootnote13.GetNumber()); SwTextFootnote* pTFNote13 = static_cast<SwTextFootnote*>(pFootnote13); @@ -975,7 +975,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342) pCursor->Move(fnMoveForward); SwTextNode* pTextNd14 = pCursor->GetNode().GetTextNode(); SwTextAttr* const pFootnote14 - = pTextNd14->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + = pTextNd14->GetTextAttrForCharAt(pCursor->GetPoint()->GetContentIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote14(pFootnote14->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(4), rFootnote14.GetNumber()); SwTextFootnote* pTFNote14 = static_cast<SwTextFootnote*>(pFootnote14); @@ -998,7 +998,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342) pCursor->Move(fnMoveForward); SwTextNode* pTextNd15 = pCursor->GetNode().GetTextNode(); SwTextAttr* const pFootnote15 - = pTextNd15->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + = pTextNd15->GetTextAttrForCharAt(pCursor->GetPoint()->GetContentIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote15(pFootnote15->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(5), rFootnote15.GetNumber()); SwTextFootnote* pTFNote15 = static_cast<SwTextFootnote*>(pFootnote15); diff --git a/sw/qa/uibase/uno/uno.cxx b/sw/qa/uibase/uno/uno.cxx index 16359e2dd7b9..c79e1d1f79c4 100644 --- a/sw/qa/uibase/uno/uno.cxx +++ b/sw/qa/uibase/uno/uno.cxx @@ -81,7 +81,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testCreateTextRangeByPixelPosition) auto pTextRange = dynamic_cast<SwXTextRange*>(xTextRange.get()); SwPaM aPaM(pDoc->GetNodes()); pTextRange->GetPositions(aPaM); - sal_Int32 nActual = aPaM.GetPoint()->nContent.GetIndex(); + sal_Int32 nActual = aPaM.GetPoint()->GetContentIndex(); // Without the needed PixelToLogic() call in place, this test would have failed with: // - Expected: 1 // - Actual : 0 diff --git a/sw/qa/uibase/wrtsh/wrtsh.cxx b/sw/qa/uibase/wrtsh/wrtsh.cxx index 0d43bb6a3651..b5bf67899b0d 100644 --- a/sw/qa/uibase/wrtsh/wrtsh.cxx +++ b/sw/qa/uibase/wrtsh/wrtsh.cxx @@ -87,9 +87,9 @@ CPPUNIT_TEST_FIXTURE(Test, testGotoContentControl) // Then make sure that the content control is selected (without the dummy character): // Without the accompanying fix in place, this test would have failed, the user had to manually // select the placeholder text. - sal_Int32 nStart = pWrtShell->GetCursor()->Start()->nContent.GetIndex(); + sal_Int32 nStart = pWrtShell->GetCursor()->Start()->GetContentIndex(); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nStart); - sal_Int32 nEnd = pWrtShell->GetCursor()->End()->nContent.GetIndex(); + sal_Int32 nEnd = pWrtShell->GetCursor()->End()->GetContentIndex(); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5), nEnd); } diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx index 58c093f05441..1a5a8adde5a1 100644 --- a/sw/source/core/access/accframebase.cxx +++ b/sw/source/core/access/accframebase.cxx @@ -285,7 +285,7 @@ bool SwAccessibleFrameBase::GetSelectedState( ) const SwPosition *pPos = rAnchor.GetContentAnchor(); if( !pPos ) return false; - int nIndex = pPos->nContent.GetIndex(); + int nIndex = pPos->GetContentIndex(); if( pPos->GetNode().GetTextNode() ) { SwPaM* pCursor = GetCursor(); @@ -310,8 +310,8 @@ bool SwAccessibleFrameBase::GetSelectedState( ) { if( rAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR ) { - if( ((nHere == nStartIndex) && (nIndex >= pStart->nContent.GetIndex())) || (nHere > nStartIndex) ) - if( ((nHere == nEndIndex) && (nIndex < pEnd->nContent.GetIndex())) || (nHere < nEndIndex) ) + if( ((nHere == nStartIndex) && (nIndex >= pStart->GetContentIndex())) || (nHere > nStartIndex) ) + if( ((nHere == nEndIndex) && (nIndex < pEnd->GetContentIndex())) || (nHere < nEndIndex) ) return true; } else if( rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA ) diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index b522d00ad282..4bb32730583e 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1195,7 +1195,7 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() } if( pPos->GetNode().GetTextNode() ) { - int nIndex = pPos->nContent.GetIndex(); + int nIndex = pPos->GetContentIndex(); bool bMarked = false; if( pCursor != nullptr ) { @@ -1229,8 +1229,8 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() { if( rAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR ) { - if( ( ((nHere == nStartIndex) && (nIndex >= pStart->nContent.GetIndex())) || (nHere > nStartIndex) ) - &&( ((nHere == nEndIndex) && (nIndex < pEnd->nContent.GetIndex())) || (nHere < nEndIndex) ) ) + if( ( ((nHere == nStartIndex) && (nIndex >= pStart->GetContentIndex())) || (nHere > nStartIndex) ) + &&( ((nHere == nEndIndex) && (nIndex < pEnd->GetContentIndex())) || (nHere < nEndIndex) ) ) { uno::Reference < XAccessible > xAcc( (*aIter).second ); if( xAcc.is() ) diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index b9ac98bb9dc0..c51d77ae8ba1 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1635,9 +1635,9 @@ void SwAccessibleParagraph::_getRunAttributesImpl( SwTextNode *const pTextNode(aModelPos.GetNode().GetTextNode()); { SwPosition const aEndPos(*pTextNode, - aModelPos.nContent.GetIndex() == pTextNode->Len() + aModelPos.GetContentIndex() == pTextNode->Len() ? pTextNode->Len() // ??? - : aModelPos.nContent.GetIndex() + 1); + : aModelPos.GetContentIndex() + 1); pPaM.emplace(aModelPos, aEndPos); } diff --git a/sw/source/core/crsr/annotationmark.cxx b/sw/source/core/crsr/annotationmark.cxx index 2fbbb6cf1d8e..d8d048be0c98 100644 --- a/sw/source/core/crsr/annotationmark.cxx +++ b/sw/source/core/crsr/annotationmark.cxx @@ -54,7 +54,7 @@ namespace sw::mark SwTextNode *pTextNode = GetMarkEnd().GetNode().GetTextNode(); assert(pTextNode); SwTextField *const pTextField = pTextNode->GetFieldTextAttrAt( - GetMarkEnd().nContent.GetIndex()-1, true); + GetMarkEnd().GetContentIndex()-1, true); assert(pTextField != nullptr); auto pPostItField = dynamic_cast<const SwPostItField*>(pTextField->GetFormatField().GetField()); diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx index 682519a6e041..acca29c7e470 100644 --- a/sw/source/core/crsr/bookmark.cxx +++ b/sw/source/core/crsr/bookmark.cxx @@ -70,11 +70,11 @@ namespace sw::mark { SwTextNode & rTextNode(*pNode->GetTextNode()); sal_Int32 const nStart(n == nStartNode - ? rStartPos.nContent.GetIndex() + 1 + ? rStartPos.GetContentIndex() + 1 : 0); sal_Int32 const nEnd(n == nEndNode // subtract 1 to ignore the end char - ? rEndPos.nContent.GetIndex() - 1 + ? rEndPos.GetContentIndex() - 1 : rTextNode.Len()); for (sal_Int32 i = nEnd; nStart < i; --i) { @@ -125,19 +125,19 @@ namespace { // make sure the position has 1) the proper node, and 2) a proper index SwTextNode* pTextNode = rPos.GetNode().GetTextNode(); - if(pTextNode == nullptr && rPos.nContent.GetIndex() > 0) + if(pTextNode == nullptr && rPos.GetContentIndex() > 0) { SAL_INFO( "sw.core", - "illegal position: " << rPos.nContent.GetIndex() + "illegal position: " << rPos.GetContentIndex() << " without proper TextNode"); rPos.nContent.Assign(nullptr, 0); } - else if(pTextNode != nullptr && rPos.nContent.GetIndex() > pTextNode->Len()) + else if(pTextNode != nullptr && rPos.GetContentIndex() > pTextNode->Len()) { SAL_INFO( "sw.core", - "illegal position: " << rPos.nContent.GetIndex() + "illegal position: " << rPos.GetContentIndex() << " is beyond " << pTextNode->Len()); rPos.nContent.Assign(pTextNode, pTextNode->Len()); } @@ -150,16 +150,16 @@ namespace if (aEndMark != CH_TXT_ATR_FORMELEMENT) { SwPosition const& rStart(rField.GetMarkStart()); - assert(rStart.GetNode().GetTextNode()->GetText()[rStart.nContent.GetIndex()] == aStartMark); (void) rStart; (void) aStartMark; + assert(rStart.GetNode().GetTextNode()->GetText()[rStart.GetContentIndex()] == aStartMark); (void) rStart; (void) aStartMark; SwPosition const sepPos(sw::mark::FindFieldSep(rField)); - assert(sepPos.GetNode().GetTextNode()->GetText()[sepPos.nContent.GetIndex()] == CH_TXT_ATR_FIELDSEP); (void) sepPos; + assert(sepPos.GetNode().GetTextNode()->GetText()[sepPos.GetContentIndex()] == CH_TXT_ATR_FIELDSEP); (void) sepPos; } else { // must be m_pPos1 < m_pPos2 because of asymmetric SplitNode update - assert(rField.GetMarkPos().nContent.GetIndex() + 1 == rField.GetOtherMarkPos().nContent.GetIndex()); + assert(rField.GetMarkPos().GetContentIndex() + 1 == rField.GetOtherMarkPos().GetContentIndex()); } SwPosition const& rEnd(rField.GetMarkEnd()); - assert(rEnd.GetNode().GetTextNode()->GetText()[rEnd.nContent.GetIndex() - 1] == aEndMark); (void) rEnd; + assert(rEnd.GetNode().GetTextNode()->GetText()[rEnd.GetContentIndex() - 1] == aEndMark); (void) rEnd; } void lcl_SetFieldMarks(Fieldmark& rField, @@ -217,7 +217,7 @@ namespace } else { // InsertString moved the mark's end, not its start - assert(rField.GetMarkPos().nContent.GetIndex() + 1 == rField.GetOtherMarkPos().nContent.GetIndex()); + assert(rField.GetMarkPos().GetContentIndex() + 1 == rField.GetOtherMarkPos().GetContentIndex()); } } lcl_AssertFieldMarksSet(rField, aStartMark, aEndMark); @@ -248,8 +248,8 @@ namespace SwTextNode *const pEndTextNode = rEnd.GetNode().GetTextNode(); assert(pEndTextNode); const sal_Int32 nEndPos = (rEnd == rStart) - ? rEnd.nContent.GetIndex() - : rEnd.nContent.GetIndex() - 1; + ? rEnd.GetContentIndex() + : rEnd.GetContentIndex() - 1; assert(pEndTextNode->GetText()[nEndPos] == aEndMark); SwPosition const aEnd(*pEndTextNode, nEndPos); io_rDoc.GetDocumentContentOperationsManager().DeleteDummyChar(aEnd, aEndMark); @@ -259,7 +259,7 @@ namespace auto InvalidatePosition(SwPosition const& rPos) -> void { - SwUpdateAttr const aHint(rPos.nContent.GetIndex(), rPos.nContent.GetIndex(), 0); + SwUpdateAttr const aHint(rPos.GetContentIndex(), rPos.GetContentIndex(), 0); rPos.GetNode().GetTextNode()->CallSwClientNotify(sw::LegacyModifyHint(&aHint, &aHint)); } } @@ -307,7 +307,7 @@ namespace sw::mark { return "Mark: ( Name, [ Node1, Index1 ] ): ( " + m_aName + ", [ " + OUString::number( sal_Int32(GetMarkPos().GetNodeIndex()) ) + ", " - + OUString::number( GetMarkPos().nContent.GetIndex( ) ) + " ] )"; + + OUString::number( GetMarkPos().GetContentIndex( ) ) + " ] )"; } void MarkBase::dumpAsXml(xmlTextWriterPtr pWriter) const @@ -520,9 +520,9 @@ namespace sw::mark { return "Fieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( " + m_aName + ", " + m_aFieldname + ", [ " + OUString::number( sal_Int32(GetMarkPos().GetNodeIndex( )) ) - + ", " + OUString::number( GetMarkPos( ).nContent.GetIndex( ) ) + " ], [" + + ", " + OUString::number( GetMarkPos( ).GetContentIndex( ) ) + " ], [" + OUString::number( sal_Int32(GetOtherMarkPos().GetNodeIndex( )) ) + ", " - + OUString::number( GetOtherMarkPos( ).nContent.GetIndex( ) ) + " ] ) "; + + OUString::number( GetOtherMarkPos( ).GetContentIndex( ) ) + " ] ) "; } void Fieldmark::Invalidate( ) @@ -829,8 +829,8 @@ namespace sw::mark { const SwTextNode* const pTextNode = GetMarkEnd().GetNode().GetTextNode(); SwPosition const sepPos(sw::mark::FindFieldSep(*this)); - const sal_Int32 nStart(sepPos.nContent.GetIndex()); - const sal_Int32 nEnd (GetMarkEnd().nContent.GetIndex()); + const sal_Int32 nStart(sepPos.GetContentIndex()); + const sal_Int32 nEnd (GetMarkEnd().GetContentIndex()); OUString sContent; if(nStart + 1 < pTextNode->GetText().getLength() && nEnd <= pTextNode->GetText().getLength() && @@ -846,8 +846,8 @@ namespace sw::mark const SwTextNode* const pTextNode = GetMarkEnd().GetNode().GetTextNode(); SwPosition const sepPos(sw::mark::FindFieldSep(*this)); - const sal_Int32 nStart(sepPos.nContent.GetIndex()); - const sal_Int32 nEnd (GetMarkEnd().nContent.GetIndex()); + const sal_Int32 nStart(sepPos.GetContentIndex()); + const sal_Int32 nEnd (GetMarkEnd().GetContentIndex()); if(nStart + 1 < pTextNode->GetText().getLength() && nEnd <= pTextNode->GetText().getLength() && nEnd > nStart + 2) diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx index cd8f4d8283c3..7628a51c27c0 100644 --- a/sw/source/core/crsr/callnk.cxx +++ b/sw/source/core/crsr/callnk.cxx @@ -40,7 +40,7 @@ SwCallLink::SwCallLink( SwCursorShell & rSh ) SwPaM* pCursor = m_rShell.IsTableMode() ? m_rShell.GetTableCrs() : m_rShell.GetCursor(); SwNode& rNd = pCursor->GetPoint()->GetNode(); m_nNode = rNd.GetIndex(); - m_nContent = pCursor->GetPoint()->nContent.GetIndex(); + m_nContent = pCursor->GetPoint()->GetContentIndex(); m_nNodeType = rNd.GetNodeType(); m_bHasSelection = ( *pCursor->GetPoint() != *pCursor->GetMark() ); @@ -130,7 +130,7 @@ SwCallLink::~SwCallLink() COVERITY_NOEXCEPT_FALSE } } - sal_Int32 nCmp, nCurrentContent = pCurrentCursor->GetPoint()->nContent.GetIndex(); + sal_Int32 nCmp, nCurrentContent = pCurrentCursor->GetPoint()->GetContentIndex(); SwNodeType nNdWhich = pCNd->GetNodeType(); SwNodeOffset nCurrentNode = pCurrentCursor->GetPoint()->GetNodeIndex(); diff --git a/sw/source/core/crsr/crbm.cxx b/sw/source/core/crsr/crbm.cxx index b19f85af1cb9..4c9153012425 100644 --- a/sw/source/core/crsr/crbm.cxx +++ b/sw/source/core/crsr/crbm.cxx @@ -150,14 +150,14 @@ bool IsMarkHidden(SwRootFrame const& rLayout, ::sw::mark::IMark const& rMark) } else { - if (rMark.GetMarkPos().nContent.GetIndex() == pTextNode->Len()) + if (rMark.GetMarkPos().GetContentIndex() == pTextNode->Len()) { // at end of node: never deleted (except if node deleted) return pTextNode->GetRedlineMergeFlag() == SwNode::Merge::Hidden; } else { // check character following mark pos return pFrame->MapModelToViewPos(rMark.GetMarkPos()) - == pFrame->MapModelToView(pTextNode, rMark.GetMarkPos().nContent.GetIndex() + 1); + == pFrame->MapModelToView(pTextNode, rMark.GetMarkPos().GetContentIndex() + 1); } } } diff --git a/sw/source/core/crsr/crossrefbookmark.cxx b/sw/source/core/crsr/crossrefbookmark.cxx index ca5bd2c9ad28..2976c2962a6d 100644 --- a/sw/source/core/crsr/crossrefbookmark.cxx +++ b/sw/source/core/crsr/crossrefbookmark.cxx @@ -54,7 +54,7 @@ namespace sw::mark assert(rNewPos.GetNode().GetTextNode() && "<sw::mark::CrossRefBookmark::SetMarkPos(..)>" " - new bookmark position for cross-reference bookmark doesn't mark text node"); - assert(rNewPos.nContent.GetIndex() == 0 && + assert(rNewPos.GetContentIndex() == 0 && "<sw::mark::CrossRefBookmark::SetMarkPos(..)>" " - new bookmark position for cross-reference bookmark doesn't mark start of text node"); MarkBase::SetMarkPos(rNewPos); diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 0fb667ce0578..f32d0a40ace9 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -229,7 +229,7 @@ void SwCursorShell::StartAction() // save for update of the ribbon bar const SwNode& rNd = m_pCurrentCursor->GetPoint()->GetNode(); m_nCurrentNode = rNd.GetIndex(); - m_nCurrentContent = m_pCurrentCursor->GetPoint()->nContent.GetIndex(); + m_nCurrentContent = m_pCurrentCursor->GetPoint()->GetContentIndex(); m_nCurrentNdTyp = rNd.GetNodeType(); if( rNd.IsTextNode() ) m_nLeftFramePos = SwCallLink::getLayoutFrame( GetLayout(), *rNd.GetTextNode(), m_nCurrentContent, true ); @@ -2569,10 +2569,10 @@ OUString SwCursorShell::GetSelText() const else if (rNode.IsTextNode()) { sal_Int32 const nStart(i == pStart->GetNodeIndex() - ? pStart->nContent.GetIndex() + ? pStart->GetContentIndex() : 0); sal_Int32 const nEnd(i == pEnd->GetNodeIndex() - ? pEnd->nContent.GetIndex() + ? pEnd->GetContentIndex() : rNode.GetTextNode()->Len()); buf.append(rNode.GetTextNode()->GetExpandText( GetLayout(), @@ -2590,9 +2590,9 @@ OUString SwCursorShell::GetSelText() const SwTextNode* pTextNd = m_pCurrentCursor->GetNode().GetTextNode(); if( pTextNd ) { - const sal_Int32 nStt = m_pCurrentCursor->Start()->nContent.GetIndex(); + const sal_Int32 nStt = m_pCurrentCursor->Start()->GetContentIndex(); aText = pTextNd->GetExpandText(GetLayout(), nStt, - m_pCurrentCursor->End()->nContent.GetIndex() - nStt ); + m_pCurrentCursor->End()->GetContentIndex() - nStt ); } } return aText; @@ -2614,7 +2614,7 @@ sal_Unicode SwCursorShell::GetChar( bool bEnd, tools::Long nOffset ) if( !pTextNd ) return 0; - const sal_Int32 nPos = pPos->nContent.GetIndex(); + const sal_Int32 nPos = pPos->GetContentIndex(); const OUString& rStr = pTextNd->GetText(); sal_Unicode cCh = 0; @@ -2638,7 +2638,7 @@ bool SwCursorShell::ExtendSelection( bool bEnd, sal_Int32 nCount ) SwTextNode* pTextNd = pPos->GetNode().GetTextNode(); assert(pTextNd); - sal_Int32 nPos = pPos->nContent.GetIndex(); + sal_Int32 nPos = pPos->GetContentIndex(); if( bEnd ) { if ((nPos + nCount) <= pTextNd->GetText().getLength()) @@ -2757,7 +2757,7 @@ sal_uInt16 SwCursorShell::GetCursorCnt( bool bAll ) const bool SwCursorShell::IsStartOfDoc() const { - if( m_pCurrentCursor->GetPoint()->nContent.GetIndex() ) + if( m_pCurrentCursor->GetPoint()->GetContentIndex() ) return false; // after EndOfIcons comes the content selection (EndNd+StNd+ContentNd) @@ -2775,7 +2775,7 @@ bool SwCursorShell::IsEndOfDoc() const pCNd = SwNodes::GoPrevious( &aIdx ); return aIdx == m_pCurrentCursor->GetPoint()->nNode && - pCNd->Len() == m_pCurrentCursor->GetPoint()->nContent.GetIndex(); + pCNd->Len() == m_pCurrentCursor->GetPoint()->GetContentIndex(); } /** Invalidate cursors @@ -3409,8 +3409,8 @@ bool SwCursorShell::IsSelFullPara() const if( m_pCurrentCursor->GetPoint()->GetNodeIndex() == m_pCurrentCursor->GetMark()->GetNodeIndex() && !m_pCurrentCursor->IsMultiSelection() ) { - sal_Int32 nStt = m_pCurrentCursor->GetPoint()->nContent.GetIndex(); - sal_Int32 nEnd = m_pCurrentCursor->GetMark()->nContent.GetIndex(); + sal_Int32 nStt = m_pCurrentCursor->GetPoint()->GetContentIndex(); + sal_Int32 nEnd = m_pCurrentCursor->GetMark()->GetContentIndex(); if( nStt > nEnd ) { sal_Int32 nTmp = nStt; @@ -3464,7 +3464,7 @@ bool SwCursorShell::SelectHiddenRange() const SwTextNode* pNode = rPt.GetNode().GetTextNode(); if ( pNode ) { - const sal_Int32 nPos = rPt.nContent.GetIndex(); + const sal_Int32 nPos = rPt.GetContentIndex(); // check if nPos is in hidden range sal_Int32 nHiddenStart; @@ -3755,7 +3755,7 @@ void SwCursorShell::GetSmartTagTerm( std::vector< OUString >& rSmartTagTypes, if ( !pSmartTagList ) return; - sal_Int32 nCurrent = aPos.nContent.GetIndex(); + sal_Int32 nCurrent = aPos.GetContentIndex(); sal_Int32 nBegin = nCurrent; sal_Int32 nLen = 1; @@ -3797,7 +3797,7 @@ void SwCursorShell::GetSmartTagRect( const Point& rPt, SwRect& rSelectRect ) if( pNode->IsInProtectSect() ) return; - sal_Int32 nBegin = aPos.nContent.GetIndex(); + sal_Int32 nBegin = aPos.GetContentIndex(); sal_Int32 nLen = 1; if (!pSmartTagList->InWrongWord(nBegin, nLen) || pNode->IsSymbolAt(nBegin)) @@ -3809,9 +3809,9 @@ void SwCursorShell::GetSmartTagRect( const Point& rPt, SwRect& rSelectRect ) //save the start and end positions of the line and the starting point Push(); LeftMargin(); - const sal_Int32 nLineStart = GetCursor()->GetPoint()->nContent.GetIndex(); + const sal_Int32 nLineStart = GetCursor()->GetPoint()->GetContentIndex(); RightMargin(); - const sal_Int32 nLineEnd = GetCursor()->GetPoint()->nContent.GetIndex(); + const sal_Int32 nLineEnd = GetCursor()->GetPoint()->GetContentIndex(); Pop(PopMode::DeleteCurrent); // make sure the selection build later from the data below does not diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 114dccd12d93..d3ffee6f4913 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -756,7 +756,7 @@ bool SwCursorShell::MoveFieldType( SwTextNode* pTNd = rPos.GetNode().GetTextNode(); OSL_ENSURE( pTNd, "No ContentNode" ); - SwTextField * pTextField = pTNd->GetFieldTextAttrAt( rPos.nContent.GetIndex(), true ); + SwTextField * pTextField = pTNd->GetFieldTextAttrAt( rPos.GetContentIndex(), true ); const bool bDelField = ( pTextField == nullptr ); sal_Int32 nContentOffset = -1; @@ -766,7 +766,7 @@ bool SwCursorShell::MoveFieldType( SwFormatField* pFormatField = new SwFormatField( SwDateTimeField( static_cast<SwDateTimeFieldType*>(mxDoc->getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::DateTime ) ) ) ); - pTextField = new SwTextField( *pFormatField, rPos.nContent.GetIndex(), + pTextField = new SwTextField( *pFormatField, rPos.GetContentIndex(), mxDoc->IsClipBoard() ); pTextField->ChgTextNode( pTNd ); } @@ -775,7 +775,7 @@ bool SwCursorShell::MoveFieldType( // the cursor might be anywhere inside the input field, // but we will be searching for the field start if (pTextField->Which() == RES_TXTATR_INPUTFIELD - && rPos.nContent.GetIndex() != pTextField->GetStart()) + && rPos.GetContentIndex() != pTextField->GetStart()) nContentOffset = pTextField->GetStart(); } bool isSrch; @@ -932,7 +932,7 @@ SwTextField * SwCursorShell::GetTextFieldAtPos( SwTextNode * const pNode = pPos->GetNode().GetTextNode(); if ( pNode != nullptr ) { - pTextField = pNode->GetFieldTextAttrAt( pPos->nContent.GetIndex(), bIncludeInputFieldAtStart ); + pTextField = pNode->GetFieldTextAttrAt( pPos->GetContentIndex(), bIncludeInputFieldAtStart ); } return pTextField; @@ -952,7 +952,7 @@ SwTextField* SwCursorShell::GetTextFieldAtCursor( pTextField->End() != nullptr ? *(pTextField->End()) - pTextField->GetStart() : 1; - if ( ( pCursor->End()->nContent.GetIndex() - pCursor->Start()->nContent.GetIndex() ) <= nTextFieldLength ) + if ( ( pCursor->End()->GetContentIndex() - pCursor->Start()->GetContentIndex() ) <= nTextFieldLength ) { pFieldAtCursor = pTextField; } @@ -1013,7 +1013,7 @@ SwTextContentControl* SwCursorShell::CursorInsideContentControl() const continue; } - sal_Int32 nIndex = pStart->nContent.GetIndex(); + sal_Int32 nIndex = pStart->GetContentIndex(); if (SwTextAttr* pAttr = pTextNode->GetTextAttrAt(nIndex, RES_TXTATR_CONTENTCONTROL, SwTextNode::PARENT)) { return static_txtattr_cast<SwTextContentControl*>(pAttr); @@ -1406,7 +1406,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, && !aTmpState.m_bFootnoteNoInfo ) { const SwWrongList* pSmartTagList = pTextNd->GetSmartTags(); - sal_Int32 nCurrent = aPos.nContent.GetIndex(); + sal_Int32 nCurrent = aPos.GetContentIndex(); const sal_Int32 nBegin = nCurrent; sal_Int32 nLen = 1; @@ -1454,7 +1454,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, && ( IsAttrAtPos::Field | IsAttrAtPos::ClickField ) & rContentAtPos.eContentAtPos && !aTmpState.m_bFootnoteNoInfo ) { - pTextAttr = pTextNd->GetFieldTextAttrAt( aPos.nContent.GetIndex() ); + pTextAttr = pTextNd->GetFieldTextAttrAt( aPos.GetContentIndex() ); const SwField* pField = pTextAttr != nullptr ? pTextAttr->GetFormatField().GetField() : nullptr; @@ -1533,7 +1533,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, if (!bRet && rContentAtPos.eContentAtPos & IsAttrAtPos::ContentControl) { SwTextAttr* pAttr = pTextNd->GetTextAttrAt( - aPos.nContent.GetIndex(), RES_TXTATR_CONTENTCONTROL, SwTextNode::PARENT); + aPos.GetContentIndex(), RES_TXTATR_CONTENTCONTROL, SwTextNode::PARENT); if (pAttr) { rContentAtPos.eContentAtPos = IsAttrAtPos::ContentControl; @@ -1558,7 +1558,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, rContentAtPos.eContentAtPos = IsAttrAtPos::Ftn; } else if ( nullptr != ( pTextAttr = pTextNd->GetTextAttrForCharAt( - aPos.nContent.GetIndex(), RES_TXTATR_FTN )) ) + aPos.GetContentIndex(), RES_TXTATR_FTN )) ) { bRet = true; if( bSetCursor ) @@ -1612,7 +1612,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, { std::vector<SwTextAttr *> const marks( pTextNd->GetTextAttrsAt( - aPos.nContent.GetIndex(), RES_TXTATR_TOXMARK)); + aPos.GetContentIndex(), RES_TXTATR_TOXMARK)); if (!marks.empty()) { // hmm... can only return 1 here pTextAttr = *marks.begin(); @@ -1624,7 +1624,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, { std::vector<SwTextAttr *> const marks( pTextNd->GetTextAttrsAt( - aPos.nContent.GetIndex(), RES_TXTATR_REFMARK)); + aPos.GetContentIndex(), RES_TXTATR_REFMARK)); if (!marks.empty()) { // hmm... can only return 1 here pTextAttr = *marks.begin(); @@ -1678,7 +1678,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, && IsAttrAtPos::InetAttr & rContentAtPos.eContentAtPos && !aTmpState.m_bFootnoteNoInfo ) { - sal_Int32 index = aPos.nContent.GetIndex(); + sal_Int32 index = aPos.GetContentIndex(); pTextAttr = pTextNd->GetTextAttrAt(index, RES_TXTATR_INETFMT); if(!pTextAttr && index > 0) @@ -1895,7 +1895,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, #ifdef DBG_UTIL if( !bRet && IsAttrAtPos::CurrAttrs & rContentAtPos.eContentAtPos ) { - const sal_Int32 n = aPos.nContent.GetIndex(); + const sal_Int32 n = aPos.GetContentIndex(); SfxItemSetFixed<POOLATTR_BEGIN, POOLATTR_END - 1> aSet( GetDoc()->GetAttrPool() ); if( pTextNd->GetpSwpHints() ) { @@ -1932,7 +1932,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, rContentAtPos.sStr = "Pos: ("; rContentAtPos.sStr += OUString::number( sal_Int32(aPos.GetNodeIndex())); rContentAtPos.sStr += ":"; - rContentAtPos.sStr += OUString::number( aPos.nContent.GetIndex()); + rContentAtPos.sStr += OUString::number( aPos.GetContentIndex()); rContentAtPos.sStr += ")"; rContentAtPos.sStr += "\nParagraph Style: "; rContentAtPos.sStr += pTextNd->GetFormatColl()->GetName(); @@ -1993,7 +1993,7 @@ const SwPostItField* SwCursorShell::GetPostItFieldAtCursor() const const SwTextNode* pTextNd = pCursorPos->GetNode().GetTextNode(); if ( pTextNd ) { - SwTextAttr* pTextAttr = pTextNd->GetFieldTextAttrAt( pCursorPos->nContent.GetIndex() ); + SwTextAttr* pTextAttr = pTextNd->GetFieldTextAttrAt( pCursorPos->GetContentIndex() ); const SwField* pField = pTextAttr != nullptr ? pTextAttr->GetFormatField().GetField() : nullptr; if ( pField && pField->Which()== SwFieldIds::Postit ) { @@ -2149,7 +2149,7 @@ bool SwCursorShell::SelectTextAttr( sal_uInt16 nWhich, SwPosition& rPos = *m_pCurrentCursor->GetPoint(); SwTextNode* pTextNd = rPos.GetNode().GetTextNode(); pTextAttr = pTextNd - ? pTextNd->GetTextAttrAt(rPos.nContent.GetIndex(), + ? pTextNd->GetTextAttrAt(rPos.GetContentIndex(), nWhich, bExpand ? SwTextNode::EXPAND : SwTextNode::DEFAULT) : nullptr; @@ -2264,7 +2264,7 @@ bool SwCursorShell::SetShadowCursorPos( const Point& rPt, SwFillMode eFillMode ) ++aEnd; if( aEnd.GetNode().IsEndNode() && - pCNd->Len() == aPos.nContent.GetIndex() ) + pCNd->Len() == aPos.GetContentIndex() ) aPos.nNode = *pSectNd->EndOfSectionNode(); } diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index 56ded25b8e62..7b7c475189e5 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -104,9 +104,9 @@ static void lcl_SetAttrPam( SwPaM& rPam, sal_Int32 nStart, const sal_Int32* pEnd { sal_Int32 nContentPos; if( bSaveMark ) - nContentPos = rPam.GetMark()->nContent.GetIndex(); + nContentPos = rPam.GetMark()->GetContentIndex(); else - nContentPos = rPam.GetPoint()->nContent.GetIndex(); + nContentPos = rPam.GetPoint()->GetContentIndex(); bool bTstEnd = rPam.GetPoint()->nNode == rPam.GetMark()->nNode; SwContentNode* pCNd = rPam.GetContentNode(); @@ -146,7 +146,7 @@ static bool lcl_SearchAttr( const SwTextNode& rTextNd, SwPaM& rPam, const SwTextAttr *pTextHt = nullptr; bool bForward = &fnMove == &fnMoveForward; size_t nPos = bForward ? 0 : rTextNd.GetSwpHints().Count(); - sal_Int32 nContentPos = rPam.GetPoint()->nContent.GetIndex(); + sal_Int32 nContentPos = rPam.GetPoint()->GetContentIndex(); while( nullptr != ( pTextHt=(*fnMove.fnGetHint)(rTextNd.GetSwpHints(),nPos,nContentPos))) if (pTextHt->Which() == rCmpItem.Which()) @@ -247,16 +247,16 @@ void SwAttrCheckArr::SetNewSet( const SwTextNode& rTextNd, const SwPaM& rPam ) if( m_bForward ) { - m_nNodeStart = rPam.GetPoint()->nContent.GetIndex(); + m_nNodeStart = rPam.GetPoint()->GetContentIndex(); m_nNodeEnd = rPam.GetPoint()->nNode == rPam.GetMark()->nNode - ? rPam.GetMark()->nContent.GetIndex() + ? rPam.GetMark()->GetContentIndex() : rTextNd.GetText().getLength(); } else { - m_nNodeEnd = rPam.GetPoint()->nContent.GetIndex(); + m_nNodeEnd = rPam.GetPoint()->GetContentIndex(); m_nNodeStart = rPam.GetPoint()->nNode == rPam.GetMark()->nNode - ? rPam.GetMark()->nContent.GetIndex() + ? rPam.GetMark()->GetContentIndex() : 0; } @@ -927,8 +927,8 @@ bool FindAttrImpl(SwPaM & rSearchPam, // if at beginning/end then move it out of the node if( bSrchForward - ? pPam->GetPoint()->nContent.GetIndex() == pPam->GetContentNode()->Len() - : !pPam->GetPoint()->nContent.GetIndex() ) + ? pPam->GetPoint()->GetContentIndex() == pPam->GetContentNode()->Len() + : !pPam->GetPoint()->GetContentIndex() ) { if( !(*fnMove.fnNds)( &pPam->GetPoint()->nNode, false )) { @@ -962,7 +962,7 @@ bool FindAttrImpl(SwPaM & rSearchPam, while (pAttr && (pAttrNode->GetIndex() < pPam->GetPoint()->GetNodeIndex() || (pAttrNode->GetIndex() == pPam->GetPoint()->GetNodeIndex() - && pAttr->GetStart() < pPam->GetPoint()->nContent.GetIndex()) + && pAttr->GetStart() < pPam->GetPoint()->GetContentIndex()) || pAttr->Which() != nWhich)); } else @@ -975,7 +975,7 @@ bool FindAttrImpl(SwPaM & rSearchPam, while (pAttr && (pPam->GetPoint()->GetNodeIndex() < pAttrNode->GetIndex() || (pPam->GetPoint()->GetNodeIndex() == pAttrNode->GetIndex() - && pPam->GetPoint()->nContent.GetIndex() <= pAttr->GetStart()) + && pPam->GetPoint()->GetContentIndex() <= pAttr->GetStart()) || pAttr->Which() != nWhich)); } if (pAttr) @@ -1064,8 +1064,8 @@ static bool FindAttrsImpl(SwPaM & rSearchPam, // if at beginning/end then move it out of the node if( bMoveFirst && ( bSrchForward - ? pPam->GetPoint()->nContent.GetIndex() == pPam->GetContentNode()->Len() - : !pPam->GetPoint()->nContent.GetIndex() ) ) + ? pPam->GetPoint()->GetContentIndex() == pPam->GetContentNode()->Len() + : !pPam->GetPoint()->GetContentIndex() ) ) { if( !(*fnMove.fnNds)( &pPam->GetPoint()->nNode, false )) { @@ -1133,14 +1133,14 @@ static bool FindAttrsImpl(SwPaM & rSearchPam, continue; } sal_Int32 const nStart(rExtent.pNode == &rStart.GetNode() - ? rStart.nContent.GetIndex() + ? rStart.GetContentIndex() : 0); if (rExtent.nEnd <= nStart) { continue; } sal_Int32 const nEnd(rExtent.pNode == &rEnd.GetNode() - ? rEnd.nContent.GetIndex() + ? rEnd.GetContentIndex() : rExtent.pNode->Len()); if (nEnd < rExtent.nStart || (nStart != nEnd && nEnd == rExtent.nStart)) diff --git a/sw/source/core/crsr/findfmt.cxx b/sw/source/core/crsr/findfmt.cxx index 020a277efdd9..725c4934153d 100644 --- a/sw/source/core/crsr/findfmt.cxx +++ b/sw/source/core/crsr/findfmt.cxx @@ -36,8 +36,8 @@ bool FindFormatImpl(SwPaM & rSearchPam, // if at beginning/end then move it out of the node if( bSrchForward - ? pPam->GetPoint()->nContent.GetIndex() == pPam->GetContentNode()->Len() - : !pPam->GetPoint()->nContent.GetIndex() ) + ? pPam->GetPoint()->GetContentIndex() == pPam->GetContentNode()->Len() + : !pPam->GetPoint()->GetContentIndex() ) { if( !(*fnMove.fnNds)( &pPam->GetPoint()->nNode, false )) { diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index dbe856ec37cf..4e23a612766e 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -430,7 +430,7 @@ bool FindTextImpl(SwPaM & rSearchPam, } else { - nEnd.SetModelIndex(pPam->GetMark()->nContent.GetIndex()); + nEnd.SetModelIndex(pPam->GetMark()->GetContentIndex()); } } else @@ -1155,8 +1155,8 @@ std::optional<OUString> ReplaceBackReferences(const i18nutil::SearchOptions2& rS } else { - nStart.SetModelIndex(pPam->Start()->nContent.GetIndex()); - nEnd.SetModelIndex(pPam->End()->nContent.GetIndex()); + nStart.SetModelIndex(pPam->Start()->GetContentIndex()); + nEnd.SetModelIndex(pPam->End()->GetContentIndex()); } std::vector<AmbiguousIndex> aFltArr; OUString const aStr = lcl_CleanStr(*pTextNode->GetTextNode(), pFrame, pLayout, diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 3f42c4c60dc6..0698b3f6d3a6 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -204,13 +204,13 @@ void SwPosition::dumpAsXml(xmlTextWriterPtr pWriter) const { (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwPosition")); (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nNode"), BAD_CAST(OString::number(sal_Int32(GetNodeIndex())).getStr())); - (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nContent"), BAD_CAST(OString::number(nContent.GetIndex()).getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nContent"), BAD_CAST(OString::number(GetContentIndex()).getStr())); (void)xmlTextWriterEndElement(pWriter); } std::ostream &operator <<(std::ostream& s, const SwPosition& position) { - return s << "SwPosition (node " << position.GetNodeIndex() << ", offset " << position.nContent.GetIndex() << ")"; + return s << "SwPosition (node " << position.GetNodeIndex() << ", offset " << position.GetContentIndex() << ")"; } namespace { @@ -810,11 +810,11 @@ bool SwPaM::HasReadonlySel( bool bFormView ) const for (size_t i = 0; i < pHints->Count(); ++i) { SwTextAttr const*const pHint(pHints->Get(i)); - if (n == rStart.nNode && pHint->GetStart() < rStart.nContent.GetIndex()) + if (n == rStart.nNode && pHint->GetStart() < rStart.GetContentIndex()) { continue; // before selection } - if (n == rEnd.nNode && rEnd.nContent.GetIndex() <= pHint->GetStart()) + if (n == rEnd.nNode && rEnd.GetContentIndex() <= pHint->GetStart()) { break; // after selection } @@ -837,7 +837,7 @@ bool SwPaM::HasReadonlySel( bool bFormView ) const SwTextNode* pTextNode = pStart->GetNode().GetTextNode(); if (pTextNode) { - sal_Int32 nIndex = pStart->nContent.GetIndex(); + sal_Int32 nIndex = pStart->GetContentIndex(); SwTextAttr* pAttr = pTextNode->GetTextAttrAt(nIndex, RES_TXTATR_CONTENTCONTROL, SwTextNode::PARENT); auto pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr); @@ -1061,7 +1061,7 @@ bool GoCurrPara( SwPaM & rPam, SwMoveFnCollection const & aPosPara ) SwContentNode * pNd = rPos.GetNode().GetContentNode(); if( pNd ) { - const sal_Int32 nOld = rPos.nContent.GetIndex(); + const sal_Int32 nOld = rPos.GetContentIndex(); const sal_Int32 nNew = &aPosPara == &fnMoveForward ? 0 : pNd->Len(); // if already at beginning/end then to the next/previous if( nOld != nNew ) @@ -1142,10 +1142,10 @@ OUString SwPaM::GetText() const { // Handle corner cases of start/end node(s) const sal_Int32 nStart = bIsStartNode - ? Start()->nContent.GetIndex() + ? Start()->GetContentIndex() : 0; const sal_Int32 nEnd = bIsEndNode - ? End()->nContent.GetIndex() + ? End()->GetContentIndex() : aTmpStr.getLength(); aResult.append(aTmpStr.subView(nStart, nEnd-nStart)); @@ -1176,12 +1176,12 @@ void SwPaM::InvalidatePaM() { // pretend that the PaM marks changed formatting to reformat... sal_Int32 const nStart( - index == Start()->nNode ? Start()->nContent.GetIndex() : 0); + index == Start()->nNode ? Start()->GetContentIndex() : 0); // this should work even for length of 0 SwUpdateAttr const aHint( nStart, index == End()->nNode - ? End()->nContent.GetIndex() - nStart + ? End()->GetContentIndex() - nStart : pTextNode->Len() - nStart, 0); pTextNode->TriggerNodeUpdate(sw::LegacyModifyHint(&aHint, &aHint)); diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index d6ef76de8c61..b4b360113481 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -89,8 +89,8 @@ struct PercentHdl if( rPam.GetPoint()->nNode == rPam.GetMark()->nNode ) { bNodeIdx = false; - nStt = rPam.GetMark()->nContent.GetIndex(); - nEnd = rPam.GetPoint()->nContent.GetIndex(); + nStt = rPam.GetMark()->GetContentIndex(); + nEnd = rPam.GetPoint()->GetContentIndex(); } else { @@ -118,7 +118,7 @@ struct PercentHdl if( bNodeIdx ) nPos = sal_Int32(rPos.GetNodeIndex()); else - nPos = rPos.nContent.GetIndex(); + nPos = rPos.GetContentIndex(); ::SetProgressState( bBack ? nActPos - nPos : nPos, pDSh ); } }; @@ -219,7 +219,7 @@ namespace SwTextNode* pTextNd = pPos->GetNode().GetTextNode(); if (!pTextNd) return nullptr; - return pTextNd->GetTextAttrAt(pPos->nContent.GetIndex(), RES_TXTATR_INPUTFIELD, SwTextNode::PARENT); + return pTextNd->GetTextAttrAt(pPos->GetContentIndex(), RES_TXTATR_INPUTFIELD, SwTextNode::PARENT); } } @@ -391,7 +391,7 @@ bool SwCursor::IsSelOvr( SwCursorSelOverFlags eFlags ) if (rPtIdx.GetIndex() == m_vSavePos.back().nNode - && GetPoint()->nContent.GetIndex() == m_vSavePos.back().nContent) + && GetPoint()->GetContentIndex() == m_vSavePos.back().nContent) { // new position equals saved one // --> trigger restore of saved pos by setting <pFrame> to NULL - see below @@ -458,11 +458,11 @@ bool SwCursor::IsSelOvr( SwCursorSelOverFlags eFlags ) const sal_Int32 nRefContentIdx = ( SwCursorSelOverFlags::Toggle & eFlags ) ? m_vSavePos.back().nContent - : GetMark()->nContent.GetIndex(); + : GetMark()->GetContentIndex(); const bool bIsForwardSelection = nRefNodeIdx < GetPoint()->GetNodeIndex() || ( nRefNodeIdx == GetPoint()->GetNodeIndex() - && nRefContentIdx < GetPoint()->nContent.GetIndex() ); + && nRefContentIdx < GetPoint()->GetContentIndex() ); if ( pInputFieldTextAttrAtPoint != nullptr ) { @@ -1215,7 +1215,7 @@ bool SwCursor::IsStartWordWT(sal_Int16 nWordType, SwRootFrame const*const pLayou SwTextNode* pTextNd = GetNode().GetTextNode(); if (pTextNd) { - sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); + sal_Int32 nPtPos = GetPoint()->GetContentIndex(); HideWrapper w(pLayout, pTextNd, nPtPos); @@ -1233,7 +1233,7 @@ bool SwCursor::IsEndWordWT(sal_Int16 nWordType, SwRootFrame const*const pLayout) SwTextNode* pTextNd = GetNode().GetTextNode(); if (pTextNd) { - sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); + sal_Int32 nPtPos = GetPoint()->GetContentIndex(); HideWrapper w(pLayout, pTextNd, nPtPos); @@ -1252,7 +1252,7 @@ bool SwCursor::IsInWordWT(sal_Int16 nWordType, SwRootFrame const*const pLayout) SwTextNode* pTextNd = GetNode().GetTextNode(); if (pTextNd) { - sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); + sal_Int32 nPtPos = GetPoint()->GetContentIndex(); { HideWrapper w(pLayout, pTextNd, nPtPos); @@ -1281,7 +1281,7 @@ bool SwCursor::IsStartEndSentence(bool bEnd, SwRootFrame const*const pLayout) co { bool bRet = bEnd ? GetContentNode() && GetPoint()->nContent == GetContentNode()->Len() : - GetPoint()->nContent.GetIndex() == 0; + GetPoint()->GetContentIndex() == 0; if ((pLayout != nullptr && pLayout->HasMergedParas()) || !bRet) { @@ -1300,7 +1300,7 @@ bool SwCursor::GoStartWordWT(sal_Int16 nWordType, SwRootFrame const*const pLayou if (pTextNd) { SwCursorSaveState aSave( *this ); - sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); + sal_Int32 nPtPos = GetPoint()->GetContentIndex(); { HideWrapper w(pLayout, pTextNd, nPtPos); @@ -1329,7 +1329,7 @@ bool SwCursor::GoEndWordWT(sal_Int16 nWordType, SwRootFrame const*const pLayout) if (pTextNd) { SwCursorSaveState aSave( *this ); - sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); + sal_Int32 nPtPos = GetPoint()->GetContentIndex(); { HideWrapper w(pLayout, pTextNd, nPtPos); @@ -1342,7 +1342,7 @@ bool SwCursor::GoEndWordWT(sal_Int16 nWordType, SwRootFrame const*const pLayout) } if (nPtPos <= pTextNd->GetText().getLength() && nPtPos >= 0 && - GetPoint()->nContent.GetIndex() != nPtPos ) + GetPoint()->GetContentIndex() != nPtPos ) { *GetPoint() = SwPosition(*pTextNd, nPtPos); if( !IsSelOvr() ) @@ -1359,7 +1359,7 @@ bool SwCursor::GoNextWordWT(sal_Int16 nWordType, SwRootFrame const*const pLayout if (pTextNd) { SwCursorSaveState aSave( *this ); - sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); + sal_Int32 nPtPos = GetPoint()->GetContentIndex(); { HideWrapper w(pLayout, pTextNd, nPtPos); @@ -1387,7 +1387,7 @@ bool SwCursor::GoPrevWordWT(sal_Int16 nWordType, SwRootFrame const*const pLayout if (pTextNd) { SwCursorSaveState aSave( *this ); - sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); + sal_Int32 nPtPos = GetPoint()->GetContentIndex(); { HideWrapper w(pLayout, pTextNd, nPtPos); @@ -1454,7 +1454,7 @@ bool SwCursor::SelectWordWT( SwViewShell const * pViewShell, sal_Int16 nWordType else { bool bForward = true; - sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); + sal_Int32 nPtPos = GetPoint()->GetContentIndex(); HideWrapper w(pViewShell->GetLayout(), pTextNd, nPtPos); @@ -1503,7 +1503,7 @@ bool SwCursor::SelectWordWT( SwViewShell const * pViewShell, sal_Int16 nWordType bool bStartMatch = GetMark()->nNode == pAnnotationMark->GetMarkStart().nNode && GetMark()->nContent == pAnnotationMark->GetMarkStart().nContent; bool bEndMatch = GetPoint()->nNode == pAnnotationMark->GetMarkEnd().nNode && - GetPoint()->nContent.GetIndex() + 1 == pAnnotationMark->GetMarkEnd().nContent.GetIndex(); + GetPoint()->GetContentIndex() + 1 == pAnnotationMark->GetMarkEnd().GetContentIndex(); if (bStartMatch && bEndMatch) ++GetPoint()->nContent; } @@ -1564,7 +1564,7 @@ bool SwCursor::GoSentence(SentenceMoveType eMoveType, SwRootFrame const*const pL OUString const sNodeText(lcl_MaskDeletedRedlines(pTextNd)); SwCursorSaveState aSave( *this ); - sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); + sal_Int32 nPtPos = GetPoint()->GetContentIndex(); { HideWrapper w(pLayout, pTextNd, nPtPos, &sNodeText); @@ -1640,8 +1640,8 @@ void SwCursor::ExpandToSentenceBorders(SwRootFrame const*const pLayout) OUString sEndText( pStartNd == pEndNd? sStartText : lcl_MaskDeletedRedlines( pEndNd ) ); SwCursorSaveState aSave( *this ); - sal_Int32 nStartPos = Start()->nContent.GetIndex(); - sal_Int32 nEndPos = End()->nContent.GetIndex(); + sal_Int32 nStartPos = Start()->GetContentIndex(); + sal_Int32 nEndPos = End()->GetContentIndex(); { HideWrapper w(pLayout, pStartNd, nStartPos, &sStartText); @@ -1782,8 +1782,8 @@ bool SwCursor::LeftRight( bool bLeft, sal_uInt16 nCnt, SwCursorSkipMode nMode, { SwTextNode const*const pNode(GetPoint()->GetNode().GetTextNode()); assert(pNode); - if (pNode->Len() != GetPoint()->nContent.GetIndex() - && pNode->GetText()[GetPoint()->nContent.GetIndex()] == CH_TXT_ATR_FIELDSTART) + if (pNode->Len() != GetPoint()->GetContentIndex() + && pNode->GetText()[GetPoint()->GetContentIndex()] == CH_TXT_ATR_FIELDSTART) { IDocumentMarkAccess const& rIDMA(*GetDoc().getIDocumentMarkAccess()); sw::mark::IFieldmark const*const pMark(rIDMA.getFieldmarkAt(*GetPoint())); @@ -1838,8 +1838,8 @@ bool SwCursor::LeftRight( bool bLeft, sal_uInt16 nCnt, SwCursorSkipMode nMode, { SwTextNode const*const pNode(GetPoint()->GetNode().GetTextNode()); assert(pNode); - if (pNode->Len() != GetPoint()->nContent.GetIndex() - && pNode->GetText()[GetPoint()->nContent.GetIndex()] == CH_TXT_ATR_FIELDEND) + if (pNode->Len() != GetPoint()->GetContentIndex() + && pNode->GetText()[GetPoint()->GetContentIndex()] == CH_TXT_ATR_FIELDEND) { IDocumentMarkAccess const& rIDMA(*GetDoc().getIDocumentMarkAccess()); sw::mark::IFieldmark const*const pMark(rIDMA.getFieldmarkAt(*GetPoint())); @@ -1853,7 +1853,7 @@ bool SwCursor::LeftRight( bool bLeft, sal_uInt16 nCnt, SwCursorSkipMode nMode, SwTextNode const*const pNode(GetPoint()->GetNode().GetTextNode()); assert(pNode); SwTextAttr const*const pInputField(pNode->GetTextAttrAt( - GetPoint()->nContent.GetIndex(), RES_TXTATR_INPUTFIELD, SwTextNode::PARENT)); + GetPoint()->GetContentIndex(), RES_TXTATR_INPUTFIELD, SwTextNode::PARENT)); if (pInputField) { continue; // skip over input fields @@ -2112,7 +2112,7 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt, //if cursor has already been at start or end of file, //Update cursor to change nUpDownX. - if ( aOldPos.nContent.GetIndex() == nOffset ) + if ( aOldPos.GetContentIndex() == nOffset ) { GetDoc().GetEditShell()->UpdateCursor(); bRet = false; @@ -2156,7 +2156,7 @@ bool SwCursor::IsAtLeftRightMargin(SwRootFrame const& rLayout, bool bLeft, bool if( pFrame ) { SwPaM aPam( *GetPoint() ); - if( !bLeft && aPam.GetPoint()->nContent.GetIndex() ) + if( !bLeft && aPam.GetPoint()->GetContentIndex() ) --aPam.GetPoint()->nContent; bRet = (bLeft ? pFrame->LeftMargin( &aPam ) : pFrame->RightMargin( &aPam, bAPI )) @@ -2307,7 +2307,7 @@ bool SwCursor::MovePara(SwWhichPara fnWhichPara, SwMoveFnCollection const & fnPo if ( pContentNd ) { const sal_Int32 nSttEnd = &fnPosPara == &fnMoveForward ? 0 : pContentNd->Len(); - if ( GetPoint()->nContent.GetIndex() != nSttEnd ) + if ( GetPoint()->GetContentIndex() != nSttEnd ) bShortCut = true; } } @@ -2590,8 +2590,8 @@ bool SwTableCursor::IsCursorMovedUpdate() m_nTableMkNd = GetMark()->GetNodeIndex(); m_nTablePtNd = GetPoint()->GetNodeIndex(); - m_nTableMkCnt = GetMark()->nContent.GetIndex(); - m_nTablePtCnt = GetPoint()->nContent.GetIndex(); + m_nTableMkCnt = GetMark()->GetContentIndex(); + m_nTablePtCnt = GetPoint()->GetContentIndex(); return true; } diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx index d1fa10b9efa4..f19e9e6c9f4b 100644 --- a/sw/source/core/crsr/trvlfnfl.cxx +++ b/sw/source/core/crsr/trvlfnfl.cxx @@ -67,7 +67,7 @@ bool SwCursor::GotoFootnoteText() SwTextAttr *const pFootnote( pTextNd ? pTextNd->GetTextAttrForCharAt( - GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN) + GetPoint()->GetContentIndex(), RES_TXTATR_FTN) : nullptr); if (pFootnote) { @@ -214,7 +214,7 @@ bool SwCursor::GotoNextFootnoteAnchor() if( nPos < rFootnoteArr.size() ) { SwNodeOffset nNdPos = GetPoint()->GetNodeIndex(); - const sal_Int32 nCntPos = GetPoint()->nContent.GetIndex(); + const sal_Int32 nCntPos = GetPoint()->GetContentIndex(); pTextFootnote = rFootnoteArr[ nPos ]; // search forwards @@ -285,7 +285,7 @@ bool SwCursor::GotoPrevFootnoteAnchor() { // there is a footnote with this index, so search also for the next one SwNodeOffset nNdPos = GetPoint()->GetNodeIndex(); - const sal_Int32 nCntPos = GetPoint()->nContent.GetIndex(); + const sal_Int32 nCntPos = GetPoint()->GetContentIndex(); pTextFootnote = rFootnoteArr[ nPos ]; // search forwards diff --git a/sw/source/core/crsr/trvlreg.cxx b/sw/source/core/crsr/trvlreg.cxx index d87ee41454c0..8f5fb4a2309a 100644 --- a/sw/source/core/crsr/trvlreg.cxx +++ b/sw/source/core/crsr/trvlreg.cxx @@ -187,7 +187,7 @@ bool GotoCurrRegionAndSkip( SwPaM& rCurrentCursor, SwMoveFnCollection const & fn return false; SwPosition* pPos = rCurrentCursor.GetPoint(); - const sal_Int32 nCurrCnt = pPos->nContent.GetIndex(); + const sal_Int32 nCurrCnt = pPos->GetContentIndex(); bool bMoveBackward = &fnPosRegion == &fnMoveBackward; do { @@ -212,7 +212,7 @@ bool GotoCurrRegionAndSkip( SwPaM& rCurrentCursor, SwMoveFnCollection const & fn pPos->nContent.Assign( pCNd, bMoveBackward ? pCNd->Len() : 0 ); if( &pPos->GetNode() != &rCurrNd || - pPos->nContent.GetIndex() != nCurrCnt ) + pPos->GetContentIndex() != nCurrCnt ) // there was a change return true; @@ -230,7 +230,7 @@ bool SwCursor::MoveRegion( SwWhichRegion fnWhichRegion, SwMoveFnCollection const (*fnWhichRegion)( *this, fnPosRegion, IsReadOnlyAvailable() ) && !IsSelOvr() && (GetPoint()->GetNodeIndex() != m_vSavePos.back().nNode || - GetPoint()->nContent.GetIndex() != m_vSavePos.back().nContent); + GetPoint()->GetContentIndex() != m_vSavePos.back().nContent); } bool SwCursorShell::MoveRegion( SwWhichRegion fnWhichRegion, SwMoveFnCollection const & fnPosRegion ) diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx ... etc. - the rest is truncated
