sw/inc/pam.hxx | 2 sw/inc/swcrsr.hxx | 6 sw/qa/core/frmedt/frmedt.cxx | 4 sw/qa/core/uwriter.cxx | 60 ++++----- sw/qa/extras/globalfilter/globalfilter.cxx | 10 - sw/qa/extras/layout/layout.cxx | 10 - sw/qa/extras/mailmerge/mailmerge.cxx | 4 sw/qa/extras/rtfexport/rtfexport4.cxx | 4 sw/qa/extras/uiwriter/uiwriter.cxx | 16 +- sw/qa/extras/uiwriter/uiwriter5.cxx | 2 sw/qa/extras/uiwriter/uiwriter6.cxx | 6 sw/source/core/access/accframebase.cxx | 4 sw/source/core/access/accmap.cxx | 10 - sw/source/core/access/accpara.cxx | 18 +- sw/source/core/crsr/bookmark.cxx | 10 - sw/source/core/crsr/callnk.cxx | 2 sw/source/core/crsr/crsrsh.cxx | 26 ++-- sw/source/core/crsr/crstrvl.cxx | 6 sw/source/core/crsr/findattr.cxx | 16 +- sw/source/core/crsr/findtxt.cxx | 12 - sw/source/core/crsr/pam.cxx | 8 - sw/source/core/crsr/swcrsr.cxx | 44 +++---- sw/source/core/crsr/trvlfnfl.cxx | 4 sw/source/core/crsr/trvlreg.cxx | 2 sw/source/core/crsr/trvltbl.cxx | 6 sw/source/core/crsr/viscrs.cxx | 4 sw/source/core/doc/CntntIdxStore.cxx | 10 - sw/source/core/doc/DocumentContentOperationsManager.cxx | 100 ++++++++-------- sw/source/core/doc/DocumentLayoutManager.cxx | 2 sw/source/core/doc/DocumentRedlineManager.cxx | 36 ++--- sw/source/core/doc/dbgoutsw.cxx | 2 sw/source/core/doc/docbm.cxx | 12 - sw/source/core/doc/doccomp.cxx | 8 - sw/source/core/doc/docedt.cxx | 16 +- sw/source/core/doc/docfld.cxx | 12 - sw/source/core/doc/docfly.cxx | 4 sw/source/core/doc/docfmt.cxx | 4 sw/source/core/doc/docftn.cxx | 4 sw/source/core/doc/doclay.cxx | 8 - sw/source/core/doc/docnew.cxx | 4 sw/source/core/doc/docnum.cxx | 56 ++++---- sw/source/core/doc/docredln.cxx | 12 - sw/source/core/doc/docsort.cxx | 6 sw/source/core/doc/extinput.cxx | 4 sw/source/core/doc/swserv.cxx | 10 - sw/source/core/docnode/ndsect.cxx | 10 - sw/source/core/docnode/ndtbl.cxx | 22 +-- sw/source/core/docnode/nodes.cxx | 8 - sw/source/core/edit/acorrect.cxx | 6 sw/source/core/edit/edattr.cxx | 24 +-- sw/source/core/edit/eddel.cxx | 4 sw/source/core/edit/edglbldc.cxx | 2 sw/source/core/edit/editsh.cxx | 10 - sw/source/core/edit/ednumber.cxx | 16 +- sw/source/core/edit/edtab.cxx | 4 sw/source/core/fields/postithelper.cxx | 2 sw/source/core/frmedt/fecopy.cxx | 10 - sw/source/core/frmedt/fetab.cxx | 4 sw/source/core/frmedt/fews.cxx | 2 sw/source/core/frmedt/tblsel.cxx | 6 sw/source/core/layout/atrfrm.cxx | 4 sw/source/core/layout/flowfrm.cxx | 2 sw/source/core/layout/flycnt.cxx | 2 sw/source/core/layout/frmtool.cxx | 8 - sw/source/core/text/frmcrsr.cxx | 8 - sw/source/core/text/frmpaint.cxx | 4 sw/source/core/text/itratr.cxx | 4 sw/source/core/text/porlay.cxx | 8 - sw/source/core/text/redlnitr.cxx | 12 - sw/source/core/text/txtfld.cxx | 4 sw/source/core/text/txtfly.cxx | 2 sw/source/core/tox/txmsrt.cxx | 2 sw/source/core/txtnode/ndtxt.cxx | 2 sw/source/core/undo/SwUndoField.cxx | 2 sw/source/core/undo/rolbck.cxx | 16 +- sw/source/core/undo/unattr.cxx | 8 - sw/source/core/undo/undel.cxx | 28 ++-- sw/source/core/undo/undobj.cxx | 28 ++-- sw/source/core/undo/undobj1.cxx | 14 +- sw/source/core/undo/undraw.cxx | 2 sw/source/core/undo/unins.cxx | 18 +- sw/source/core/undo/unmove.cxx | 4 sw/source/core/undo/unnum.cxx | 6 sw/source/core/undo/unovwr.cxx | 2 sw/source/core/undo/unredln.cxx | 6 sw/source/core/undo/unspnd.cxx | 2 sw/source/core/undo/untbl.cxx | 8 - sw/source/core/undo/untblk.cxx | 20 +-- sw/source/core/unocore/unocrsr.cxx | 2 sw/source/core/unocore/unocrsrhelper.cxx | 2 sw/source/core/unocore/unoobj.cxx | 6 sw/source/core/unocore/unoobj2.cxx | 18 +- sw/source/core/unocore/unotext.cxx | 10 - sw/source/filter/ascii/ascatr.cxx | 10 - sw/source/filter/ascii/wrtasc.cxx | 8 - sw/source/filter/basflt/fltshell.cxx | 2 sw/source/filter/basflt/shellio.cxx | 4 sw/source/filter/html/css1atr.cxx | 2 sw/source/filter/html/htmlatr.cxx | 18 +- sw/source/filter/html/htmlctxt.cxx | 2 sw/source/filter/html/htmlfld.cxx | 2 sw/source/filter/html/htmlflywriter.cxx | 2 sw/source/filter/html/htmlforw.cxx | 6 sw/source/filter/html/htmlgrin.cxx | 8 - sw/source/filter/html/htmlnumwriter.cxx | 8 - sw/source/filter/html/htmlsect.cxx | 10 - sw/source/filter/html/htmltab.cxx | 6 sw/source/filter/html/swhtml.cxx | 32 ++--- sw/source/filter/html/wrthtml.cxx | 22 +-- sw/source/filter/inc/fltshell.hxx | 2 sw/source/filter/rtf/swparrtf.cxx | 4 sw/source/filter/writer/writer.cxx | 6 sw/source/filter/ww8/rtfattributeoutput.cxx | 2 sw/source/filter/ww8/writerhelper.cxx | 4 sw/source/filter/ww8/wrtw8nds.cxx | 4 sw/source/filter/ww8/wrtww8.cxx | 14 +- sw/source/filter/ww8/ww8atr.cxx | 4 sw/source/filter/ww8/ww8glsy.cxx | 2 sw/source/filter/ww8/ww8par.cxx | 10 - sw/source/filter/xml/XMLRedlineImportHelper.cxx | 2 sw/source/filter/xml/xmlimp.cxx | 12 - sw/source/uibase/dochdl/swdtflvr.cxx | 4 sw/source/uibase/docvw/edtwin.cxx | 4 123 files changed, 609 insertions(+), 607 deletions(-)
New commits: commit 961d42e1ca1da7f3199d46445b3766d9c6a6c938 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Aug 1 10:23:44 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Aug 2 15:10:43 2022 +0200 introduce SwPosition::GetNodeIndex as part of the process of hiding the internals of SwPosition largely done by doing: git grep -lF 'nNode.GetIndex' | xargs perl -pi -e 's/\bnNode\.GetIndex/GetNodeIndex/g' Change-Id: I3616cea4c47595afe74f1aa8e3be553279f25d44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137694 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx index fde6d69da065..900793dbe969 100644 --- a/sw/inc/pam.hxx +++ b/sw/inc/pam.hxx @@ -71,6 +71,8 @@ struct SAL_WARN_UNUSED SW_DLLPUBLIC SwPosition void dumpAsXml(xmlTextWriterPtr pWriter) const; + SwNodeOffset GetNodeIndex() const { return nNode.GetIndex(); } + // Gets pointer on NodesArray. const SwNodes& GetNodes() const { return nNode.GetNodes(); } SwNodes& GetNodes() { return nNode.GetNodes(); } diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index 27f42c0bd72d..c78a5bea80ed 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -245,7 +245,7 @@ struct SwCursor_SavePos final sal_Int32 nContent; SwCursor_SavePos( const SwCursor& rCursor ) - : nNode( rCursor.GetPoint()->nNode.GetIndex() ), + : nNode( rCursor.GetPoint()->GetNodeIndex() ), nContent( rCursor.GetPoint()->nContent.GetIndex() ) {} }; @@ -289,8 +289,8 @@ public: // Has table cursor been changed? bool IsCursorMoved() const { - return m_nTableMkNd != GetMark()->nNode.GetIndex() || - m_nTablePtNd != GetPoint()->nNode.GetIndex() || + return m_nTableMkNd != GetMark()->GetNodeIndex() || + m_nTablePtNd != GetPoint()->GetNodeIndex() || m_nTableMkCnt != GetMark()->nContent.GetIndex() || m_nTablePtCnt != GetPoint()->nContent.GetIndex(); } diff --git a/sw/qa/core/frmedt/frmedt.cxx b/sw/qa/core/frmedt/frmedt.cxx index 850dcc65571f..e6fd394b81fa 100644 --- a/sw/qa/core/frmedt/frmedt.cxx +++ b/sw/qa/core/frmedt/frmedt.cxx @@ -51,9 +51,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreFrmedtTest, testTextboxReanchor) SwFrameFormat* pTextFrameFormat = FindFrameFormat(pTextFrameObj); CPPUNIT_ASSERT_EQUAL(OUString("Frame2"), pTextFrameFormat->GetName()); SwFrameFormat* pDrawShapeFormat = FindFrameFormat(pDrawShape); - SwNodeOffset nOldAnchor = pDrawShapeFormat->GetAnchor().GetContentAnchor()->nNode.GetIndex(); + SwNodeOffset nOldAnchor = pDrawShapeFormat->GetAnchor().GetContentAnchor()->GetNodeIndex(); pShell->FindAnchorPos(pTextFrameObj->GetLastBoundRect().Center(), true); - SwNodeOffset nNewAnchor = pDrawShapeFormat->GetAnchor().GetContentAnchor()->nNode.GetIndex(); + SwNodeOffset nNewAnchor = pDrawShapeFormat->GetAnchor().GetContentAnchor()->GetNodeIndex(); // Without the accompanying fix in place, this test would have failed with: // - Expected: 6 // - Actual : 9 diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index ae59144b9be8..b09b874f7a41 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -1441,27 +1441,27 @@ void SwDocTest::testMarkMove() CPPUNIT_ASSERT_EQUAL(sal_Int32(0) , pBM1->GetMarkStart().nContent.GetIndex()); CPPUNIT_ASSERT_EQUAL(sal_Int32(11), pBM1->GetMarkEnd().nContent.GetIndex()); CPPUNIT_ASSERT_EQUAL( - pBM1->GetMarkStart().nNode.GetIndex(), - pBM1->GetMarkEnd().nNode.GetIndex()); + 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( - pBM2->GetMarkStart().nNode.GetIndex(), - pBM2->GetMarkEnd().nNode.GetIndex()); + 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( - pBM3->GetMarkStart().nNode.GetIndex(), - pBM3->GetMarkEnd().nNode.GetIndex()); + pBM3->GetMarkStart().GetNodeIndex(), + pBM3->GetMarkEnd().GetNodeIndex()); CPPUNIT_ASSERT_EQUAL( - pBM1->GetMarkStart().nNode.GetIndex()+1, - pBM2->GetMarkStart().nNode.GetIndex()); + pBM1->GetMarkStart().GetNodeIndex()+1, + pBM2->GetMarkStart().GetNodeIndex()); CPPUNIT_ASSERT_EQUAL( - pBM2->GetMarkStart().nNode.GetIndex(), - pBM3->GetMarkStart().nNode.GetIndex()); + pBM2->GetMarkStart().GetNodeIndex(), + pBM3->GetMarkStart().GetNodeIndex()); // cut some text { @@ -1478,27 +1478,27 @@ void SwDocTest::testMarkMove() CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pBM1->GetMarkStart().nContent.GetIndex()); CPPUNIT_ASSERT_EQUAL(sal_Int32(6), pBM1->GetMarkEnd().nContent.GetIndex()); CPPUNIT_ASSERT_EQUAL( - pBM1->GetMarkStart().nNode.GetIndex(), - pBM1->GetMarkEnd().nNode.GetIndex()); + 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( - pBM2->GetMarkStart().nNode.GetIndex(), - pBM2->GetMarkEnd().nNode.GetIndex()); + 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( - pBM3->GetMarkStart().nNode.GetIndex(), - pBM3->GetMarkEnd().nNode.GetIndex()); + pBM3->GetMarkStart().GetNodeIndex(), + pBM3->GetMarkEnd().GetNodeIndex()); CPPUNIT_ASSERT_EQUAL( - pBM1->GetMarkStart().nNode.GetIndex(), - pBM2->GetMarkStart().nNode.GetIndex()); + pBM1->GetMarkStart().GetNodeIndex(), + pBM2->GetMarkStart().GetNodeIndex()); CPPUNIT_ASSERT_EQUAL( - pBM2->GetMarkStart().nNode.GetIndex(), - pBM3->GetMarkStart().nNode.GetIndex()); + pBM2->GetMarkStart().GetNodeIndex(), + pBM3->GetMarkStart().GetNodeIndex()); // split the paragraph { @@ -1514,27 +1514,27 @@ void SwDocTest::testMarkMove() CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pBM1->GetMarkStart().nContent.GetIndex()); CPPUNIT_ASSERT_EQUAL(sal_Int32(6), pBM1->GetMarkEnd().nContent.GetIndex()); CPPUNIT_ASSERT_EQUAL( - pBM1->GetMarkStart().nNode.GetIndex(), - pBM1->GetMarkEnd().nNode.GetIndex()); + 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( - pBM2->GetMarkStart().nNode.GetIndex()+1, - pBM2->GetMarkEnd().nNode.GetIndex()); + 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( - pBM3->GetMarkStart().nNode.GetIndex(), - pBM3->GetMarkEnd().nNode.GetIndex()); + pBM3->GetMarkStart().GetNodeIndex(), + pBM3->GetMarkEnd().GetNodeIndex()); CPPUNIT_ASSERT_EQUAL( - pBM1->GetMarkStart().nNode.GetIndex(), - pBM2->GetMarkStart().nNode.GetIndex()); + pBM1->GetMarkStart().GetNodeIndex(), + pBM2->GetMarkStart().GetNodeIndex()); CPPUNIT_ASSERT_EQUAL( - pBM2->GetMarkEnd().nNode.GetIndex(), - pBM3->GetMarkEnd().nNode.GetIndex()); + pBM2->GetMarkEnd().GetNodeIndex(), + pBM3->GetMarkEnd().GetNodeIndex()); } namespace diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index 654eb662786a..a4cf833bbc21 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -1702,7 +1702,7 @@ void Test::testDateFormField() sal_Unicode vEnSpaces[ODF_FORMFIELD_DEFAULT_LENGTH] = {8194, 8194, 8194, 8194, 8194}; CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString(vEnSpaces, 5), sCurrentDate); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), SwNodeOffset(9), pFieldmark->GetMarkStart().nNode.GetIndex()); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), SwNodeOffset(9), pFieldmark->GetMarkStart().GetNodeIndex()); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(5), pFieldmark->GetMarkStart().nContent.GetIndex()); } else if (nIndex == 1) // The second has the default format @@ -1711,7 +1711,7 @@ void Test::testDateFormField() CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString("en-US"), sLang); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString("06/12/19"), sCurrentDate); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), SwNodeOffset(9), pFieldmark->GetMarkStart().nNode.GetIndex()); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), SwNodeOffset(9), pFieldmark->GetMarkStart().GetNodeIndex()); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(20), pFieldmark->GetMarkStart().nContent.GetIndex()); } else if (nIndex == 2) // The third one has special format @@ -1720,7 +1720,7 @@ void Test::testDateFormField() CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString("hu-HU"), sLang); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString("2019. febr. 12."), sCurrentDate); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), SwNodeOffset(9), pFieldmark->GetMarkStart().nNode.GetIndex()); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), SwNodeOffset(9), pFieldmark->GetMarkStart().GetNodeIndex()); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(40), pFieldmark->GetMarkStart().nContent.GetIndex()); } @@ -1730,7 +1730,7 @@ void Test::testDateFormField() CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString("bm-ML"), sLang); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString("[select date]"), sCurrentDate); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), SwNodeOffset(9), pFieldmark->GetMarkStart().nNode.GetIndex()); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), SwNodeOffset(9), pFieldmark->GetMarkStart().GetNodeIndex()); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(62), pFieldmark->GetMarkStart().nContent.GetIndex()); } @@ -1740,7 +1740,7 @@ void Test::testDateFormField() CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString("en-US"), sLang); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString(""), sCurrentDate); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), SwNodeOffset(9), pFieldmark->GetMarkStart().nNode.GetIndex()); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), SwNodeOffset(9), pFieldmark->GetMarkStart().GetNodeIndex()); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(82), pFieldmark->GetMarkStart().nContent.GetIndex()); } diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index e63b5bd6af1d..0e3811fa22fc 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3869,7 +3869,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBtlrCell) SwPosition aCellStart = *pWrtShell->GetCursor()->Start(); // Test that pressing "up" at the start of the cell goes to the next character position. - SwNodeOffset nNodeIndex = pWrtShell->GetCursor()->Start()->nNode.GetIndex(); + SwNodeOffset nNodeIndex = pWrtShell->GetCursor()->Start()->GetNodeIndex(); sal_Int32 nIndex = pWrtShell->GetCursor()->Start()->nContent.GetIndex(); KeyEvent aKeyEvent(0, KEY_UP); SwEditWin& rEditWin = pShell->GetView()->GetEditWin(); @@ -3886,7 +3886,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBtlrCell) Scheduler::ProcessEventsToIdle(); // Without the accompanying fix in place, this test would have failed: the cursor went to the // paragraph after the table. - CPPUNIT_ASSERT_EQUAL(nNodeIndex + 1, pWrtShell->GetCursor()->Start()->nNode.GetIndex()); + CPPUNIT_ASSERT_EQUAL(nNodeIndex + 1, pWrtShell->GetCursor()->Start()->GetNodeIndex()); // 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. @@ -3913,7 +3913,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBtlrCell) aPoint.setY(nSecondParaTop + nSecondParaHeight - 100); SwCursorMoveState aState(CursorMoveState::NONE); pLayout->GetModelPositionForViewPoint(&aPosition, aPoint, &aState); - CPPUNIT_ASSERT_EQUAL(aCellStart.nNode.GetIndex() + 1, aPosition.nNode.GetIndex()); + 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()); @@ -4564,13 +4564,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128399) SwCursorMoveState aState(CursorMoveState::NONE); pLayout->GetModelPositionForViewPoint(&aPosition, aPoint, &aState); // Second row is +3: end node, start node and the first text node in the 2nd row. - SwNodeOffset nExpected = aFirstRow.nNode.GetIndex() + 3; + SwNodeOffset nExpected = aFirstRow.GetNodeIndex() + 3; // Without the accompanying fix in place, this test would have failed with: // - Expected: 14 // - Actual : 11 // i.e. clicking on the center of the 2nd row placed the cursor in the 1st row. - CPPUNIT_ASSERT_EQUAL(nExpected, aPosition.nNode.GetIndex()); + CPPUNIT_ASSERT_EQUAL(nExpected, aPosition.GetNodeIndex()); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf145826) diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index 7f09778e141f..9daf733fe49f 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -559,7 +559,7 @@ DECLARE_SHELL_MAILMERGE_TEST(testTdf92623, "tdf92623.odt", "10-testing-addresses // and it's a TEXT_FIELDMARK CPPUNIT_ASSERT_EQUAL( sal_Int32(IDocumentMarkAccess::MarkType::TEXT_FIELDMARK), sal_Int32(IDocumentMarkAccess::GetType( **mark )) ); - SwNodeOffset src_pos = (*mark)->GetMarkPos().nNode.GetIndex(); + SwNodeOffset src_pos = (*mark)->GetMarkPos().GetNodeIndex(); // Get the size of the document in nodes SwDoc *doc = pTextDoc->GetDocShell()->GetDoc(); @@ -583,7 +583,7 @@ DECLARE_SHELL_MAILMERGE_TEST(testTdf92623, "tdf92623.odt", "10-testing-addresses IDocumentMarkAccess::MarkType markType = IDocumentMarkAccess::GetType( **mark ); if( markType == IDocumentMarkAccess::MarkType::TEXT_FIELDMARK ) { - SwNodeOffset pos = (*mark)->GetMarkPos().nNode.GetIndex() - src_pos; + SwNodeOffset pos = (*mark)->GetMarkPos().GetNodeIndex() - src_pos; CPPUNIT_ASSERT_EQUAL(SwNodeOffset(0), pos % size); CPPUNIT_ASSERT(pages.insert(pos).second); countFieldMarks++; diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 65b8ac90954c..7726fa4e7f0d 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -116,11 +116,11 @@ DECLARE_RTFEXPORT_TEST(testAnchoredAtSamePosition, "anchor.fodt") sal_Int32 const nIndex(mbExported ? 4 : 3); CPPUNIT_ASSERT_EQUAL(RndStdIds::FLY_AT_CHAR, rFlys[0]->GetAnchor().GetAnchorId()); CPPUNIT_ASSERT_EQUAL(SwNodeOffset(12), - rFlys[0]->GetAnchor().GetContentAnchor()->nNode.GetIndex()); + rFlys[0]->GetAnchor().GetContentAnchor()->GetNodeIndex()); CPPUNIT_ASSERT_EQUAL(nIndex, rFlys[0]->GetAnchor().GetContentAnchor()->nContent.GetIndex()); CPPUNIT_ASSERT_EQUAL(RndStdIds::FLY_AT_CHAR, rFlys[1]->GetAnchor().GetAnchorId()); CPPUNIT_ASSERT_EQUAL(SwNodeOffset(12), - rFlys[1]->GetAnchor().GetContentAnchor()->nNode.GetIndex()); + rFlys[1]->GetAnchor().GetContentAnchor()->GetNodeIndex()); CPPUNIT_ASSERT_EQUAL(nIndex, rFlys[1]->GetAnchor().GetContentAnchor()->nContent.GetIndex()); } diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 27c861edf5c0..a07869e1bee1 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -921,13 +921,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()->nNode.GetIndex(); + SwNodeOffset redlineStart0NodeIndex = rTable[ 0 ]->Start()->GetNodeIndex(); sal_Int32 redlineStart0Index = rTable[ 0 ]->Start()->nContent.GetIndex(); - SwNodeOffset redlineEnd0NodeIndex = rTable[ 0 ]->End()->nNode.GetIndex(); + SwNodeOffset redlineEnd0NodeIndex = rTable[ 0 ]->End()->GetNodeIndex(); sal_Int32 redlineEnd0Index = rTable[ 0 ]->End()->nContent.GetIndex(); - SwNodeOffset redlineStart1NodeIndex = rTable[ 1 ]->Start()->nNode.GetIndex(); + SwNodeOffset redlineStart1NodeIndex = rTable[ 1 ]->Start()->GetNodeIndex(); sal_Int32 redlineStart1Index = rTable[ 1 ]->Start()->nContent.GetIndex(); - SwNodeOffset redlineEnd1NodeIndex = rTable[ 1 ]->End()->nNode.GetIndex(); + SwNodeOffset redlineEnd1NodeIndex = rTable[ 1 ]->End()->GetNodeIndex(); sal_Int32 redlineEnd1Index = rTable[ 1 ]->End()->nContent.GetIndex(); // Change the document layout to be 2 columns, and then undo. @@ -943,13 +943,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()->nNode.GetIndex()); + CPPUNIT_ASSERT_EQUAL( redlineStart0NodeIndex, rTable[ 0 ]->Start()->GetNodeIndex()); CPPUNIT_ASSERT_EQUAL( redlineStart0Index, rTable[ 0 ]->Start()->nContent.GetIndex()); - CPPUNIT_ASSERT_EQUAL( redlineEnd0NodeIndex, rTable[ 0 ]->End()->nNode.GetIndex()); + CPPUNIT_ASSERT_EQUAL( redlineEnd0NodeIndex, rTable[ 0 ]->End()->GetNodeIndex()); CPPUNIT_ASSERT_EQUAL( redlineEnd0Index, rTable[ 0 ]->End()->nContent.GetIndex()); - CPPUNIT_ASSERT_EQUAL( redlineStart1NodeIndex, rTable[ 1 ]->Start()->nNode.GetIndex()); + CPPUNIT_ASSERT_EQUAL( redlineStart1NodeIndex, rTable[ 1 ]->Start()->GetNodeIndex()); CPPUNIT_ASSERT_EQUAL( redlineStart1Index, rTable[ 1 ]->Start()->nContent.GetIndex()); - CPPUNIT_ASSERT_EQUAL( redlineEnd1NodeIndex, rTable[ 1 ]->End()->nNode.GetIndex()); + CPPUNIT_ASSERT_EQUAL( redlineEnd1NodeIndex, rTable[ 1 ]->End()->GetNodeIndex()); CPPUNIT_ASSERT_EQUAL( redlineEnd1Index, rTable[ 1 ]->End()->nContent.GetIndex()); } diff --git a/sw/qa/extras/uiwriter/uiwriter5.cxx b/sw/qa/extras/uiwriter/uiwriter5.cxx index 44b6473a7ef8..db54e25e42f9 100644 --- a/sw/qa/extras/uiwriter/uiwriter5.cxx +++ b/sw/qa/extras/uiwriter/uiwriter5.cxx @@ -1471,7 +1471,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testShapePageMove) // Without the accompanying fix in place, this test would have failed with "Expected: 13; // Actual: 12", i.e. the shape was anchored to the last paragraph of the 1st page, not to a // paragraph on the 2nd page. - CPPUNIT_ASSERT_EQUAL(nNodeIndex, pAnchor->nNode.GetIndex()); + CPPUNIT_ASSERT_EQUAL(nNodeIndex, pAnchor->GetNodeIndex()); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testDateFormFieldInsertion) diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index f3c2f5c7d67f..9bdc39536377 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -316,7 +316,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113686) // Remove page 2. SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - while (pWrtShell->GetCursor()->Start()->nNode.GetIndex() < nPage1LastNode) + while (pWrtShell->GetCursor()->Start()->GetNodeIndex() < nPage1LastNode) pWrtShell->Down(/*bSelect=*/false); pWrtShell->EndPara(); for (int i = 0; i < 3; ++i) @@ -430,10 +430,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testSectionInTableInTable4) // Remove page 2. SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - while (pWrtShell->GetCursor()->Start()->nNode.GetIndex() < nPage1LastNode) + while (pWrtShell->GetCursor()->Start()->GetNodeIndex() < nPage1LastNode) pWrtShell->Down(/*bSelect=*/false); pWrtShell->EndPara(); - while (pWrtShell->GetCursor()->End()->nNode.GetIndex() < nPage3FirstNode) + while (pWrtShell->GetCursor()->End()->GetNodeIndex() < nPage3FirstNode) pWrtShell->Down(/*bSelect=*/true); pWrtShell->EndPara(/*bSelect=*/true); pWrtShell->DelLeft(); diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx index 540bfdc55ec3..58c093f05441 100644 --- a/sw/source/core/access/accframebase.cxx +++ b/sw/source/core/access/accframebase.cxx @@ -303,9 +303,9 @@ bool SwAccessibleFrameBase::GetSelectedState( ) { // check whether nHere is 'inside' pCursor SwPosition* pStart = pCursor->Start(); - SwNodeOffset nStartIndex = pStart->nNode.GetIndex(); + SwNodeOffset nStartIndex = pStart->GetNodeIndex(); SwPosition* pEnd = pCursor->End(); - SwNodeOffset nEndIndex = pEnd->nNode.GetIndex(); + SwNodeOffset nEndIndex = pEnd->GetNodeIndex(); if( ( nHere >= nStartIndex ) && (nHere <= nEndIndex) ) { if( rAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR ) diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 16c50deb2cb8..b522d00ad282 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1222,9 +1222,9 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() bMarked = true; // check whether nHere is 'inside' pCursor SwPosition* pStart = rTmpCursor.Start(); - SwNodeOffset nStartIndex = pStart->nNode.GetIndex(); + SwNodeOffset nStartIndex = pStart->GetNodeIndex(); SwPosition* pEnd = rTmpCursor.End(); - SwNodeOffset nEndIndex = pEnd->nNode.GetIndex(); + SwNodeOffset nEndIndex = pEnd->GetNodeIndex(); if ((nStartIndex <= nLastNode) && (nFirstNode <= nEndIndex)) { if( rAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR ) @@ -3280,7 +3280,7 @@ std::unique_ptr<SwAccessibleSelectedParas_Impl> SwAccessibleMap::BuildSelectedPa auto [pStartPos, pEndPos] = pCursor->StartEnd(); // SwPosition* // loop on all text nodes inside the selection SwNodeIndex aIdx( pStartPos->nNode ); - for ( ; aIdx.GetIndex() <= pEndPos->nNode.GetIndex(); ++aIdx ) + for ( ; aIdx.GetIndex() <= pEndPos->GetNodeIndex(); ++aIdx ) { SwTextNode* pTextNode( aIdx.GetNode().GetTextNode() ); if ( pTextNode ) @@ -3296,11 +3296,11 @@ std::unique_ptr<SwAccessibleSelectedParas_Impl> SwAccessibleMap::BuildSelectedPa { xWeakAcc = (*aMapIter).second; SwAccessibleParaSelection aDataEntry( - sw::FrameContainsNode(*pTextFrame, pStartPos->nNode.GetIndex()) + sw::FrameContainsNode(*pTextFrame, pStartPos->GetNodeIndex()) ? pTextFrame->MapModelToViewPos(*pStartPos) : TextFrameIndex(0), - sw::FrameContainsNode(*pTextFrame, pEndPos->nNode.GetIndex()) + sw::FrameContainsNode(*pTextFrame, pEndPos->GetNodeIndex()) ? pTextFrame->MapModelToViewPos(*pEndPos) : TextFrameIndex(COMPLETE_STRING)); if ( !pRetSelectedParas ) diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 8ffde591db74..b9ac98bb9dc0 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -140,7 +140,7 @@ sal_Int32 SwAccessibleParagraph::GetCaretPos() // check whether the point points into 'our' node SwPosition* pPoint = pCaret->GetPoint(); - if (sw::FrameContainsNode(*pTextFrame, pPoint->nNode.GetIndex())) + if (sw::FrameContainsNode(*pTextFrame, pPoint->GetNodeIndex())) { // same node? Then check whether it's also within 'our' part // of the paragraph @@ -233,7 +233,7 @@ void SwAccessibleParagraph::GetStates( sal_Int64& rStateSet ) SwTextFrame const*const pFrame(static_cast<SwTextFrame const*>(GetFrame())); assert(pFrame); if (pCaret != nullptr && - sw::FrameContainsNode(*pFrame, pCaret->GetPoint()->nNode.GetIndex()) && + sw::FrameContainsNode(*pFrame, pCaret->GetPoint()->GetNodeIndex()) && m_nOldCaretPos != -1) { vcl::Window *pWin = GetWindow(); @@ -774,7 +774,7 @@ void SAL_CALL SwAccessibleParagraph::grabFocus() if (pCursorSh != nullptr && ( pCursor == nullptr || - !sw::FrameContainsNode(*pTextFrame, pCursor->GetPoint()->nNode.GetIndex()) || + !sw::FrameContainsNode(*pTextFrame, pCursor->GetPoint()->GetNodeIndex()) || !pTextFrame->IsInside(pTextFrame->MapModelToViewPos(*pCursor->GetPoint())))) { // create pam for selection @@ -2981,9 +2981,9 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getSelectedPortionCount( ) { // check whether frame's node(s) are 'inside' pCursor SwPosition* pStart = rTmpCursor.Start(); - SwNodeOffset nStartIndex = pStart->nNode.GetIndex(); + SwNodeOffset nStartIndex = pStart->GetNodeIndex(); SwPosition* pEnd = rTmpCursor.End(); - SwNodeOffset nEndIndex = pEnd->nNode.GetIndex(); + SwNodeOffset nEndIndex = pEnd->GetNodeIndex(); if ((nStartIndex <= nLastNode) && (nFirstNode <= nEndIndex)) { nSelected++; @@ -3056,9 +3056,9 @@ sal_Bool SAL_CALL SwAccessibleParagraph::removeSelection( sal_Int32 selectionInd { // check whether frame's node(s) are 'inside' pCursor SwPosition* pStart = pCursor->Start(); - SwNodeOffset nStartIndex = pStart->nNode.GetIndex(); + SwNodeOffset nStartIndex = pStart->GetNodeIndex(); SwPosition* pEnd = pCursor->End(); - SwNodeOffset nEndIndex = pEnd->nNode.GetIndex(); + SwNodeOffset nEndIndex = pEnd->GetNodeIndex(); if ((nStartIndex <= nLastNode) && (nFirstNode <= nEndIndex)) { if( nSelected == 0 ) @@ -3361,9 +3361,9 @@ bool SwAccessibleParagraph::GetSelectionAtIndex( { // check whether frame's node(s) are 'inside' pCursor SwPosition* pStart = rTmpCursor.Start(); - SwNodeOffset nStartIndex = pStart->nNode.GetIndex(); + SwNodeOffset nStartIndex = pStart->GetNodeIndex(); SwPosition* pEnd = rTmpCursor.End(); - SwNodeOffset nEndIndex = pEnd->nNode.GetIndex(); + SwNodeOffset nEndIndex = pEnd->GetNodeIndex(); if ((nStartIndex <= nLastNode) && (nFirstNode <= nEndIndex)) { if (!pSelection || *pSelection == 0) diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx index 6f4d249dd22b..682519a6e041 100644 --- a/sw/source/core/crsr/bookmark.cxx +++ b/sw/source/core/crsr/bookmark.cxx @@ -59,8 +59,8 @@ namespace sw::mark SwPosition const& rStartPos(rMark.GetMarkStart()); SwPosition const& rEndPos(rMark.GetMarkEnd()); SwNodes const& rNodes(rStartPos.GetNodes()); - SwNodeOffset const nStartNode(rStartPos.nNode.GetIndex()); - SwNodeOffset const nEndNode(rEndPos.nNode.GetIndex()); + SwNodeOffset const nStartNode(rStartPos.GetNodeIndex()); + SwNodeOffset const nEndNode(rEndPos.GetNodeIndex()); int nFields(0); std::optional<SwPosition> ret; for (SwNodeOffset n = nEndNode; nStartNode <= n; --n) @@ -306,7 +306,7 @@ namespace sw::mark OUString MarkBase::ToString( ) const { return "Mark: ( Name, [ Node1, Index1 ] ): ( " + m_aName + ", [ " - + OUString::number( sal_Int32(GetMarkPos().nNode.GetIndex()) ) + ", " + + OUString::number( sal_Int32(GetMarkPos().GetNodeIndex()) ) + ", " + OUString::number( GetMarkPos().nContent.GetIndex( ) ) + " ] )"; } @@ -519,9 +519,9 @@ namespace sw::mark OUString Fieldmark::ToString( ) const { return "Fieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( " + m_aName + ", " - + m_aFieldname + ", [ " + OUString::number( sal_Int32(GetMarkPos().nNode.GetIndex( )) ) + + m_aFieldname + ", [ " + OUString::number( sal_Int32(GetMarkPos().GetNodeIndex( )) ) + ", " + OUString::number( GetMarkPos( ).nContent.GetIndex( ) ) + " ], [" - + OUString::number( sal_Int32(GetOtherMarkPos().nNode.GetIndex( )) ) + ", " + + OUString::number( sal_Int32(GetOtherMarkPos().GetNodeIndex( )) ) + ", " + OUString::number( GetOtherMarkPos( ).nContent.GetIndex( ) ) + " ] ) "; } diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx index ce1f89e47ad0..cd8f4d8283c3 100644 --- a/sw/source/core/crsr/callnk.cxx +++ b/sw/source/core/crsr/callnk.cxx @@ -132,7 +132,7 @@ SwCallLink::~SwCallLink() COVERITY_NOEXCEPT_FALSE sal_Int32 nCmp, nCurrentContent = pCurrentCursor->GetPoint()->nContent.GetIndex(); SwNodeType nNdWhich = pCNd->GetNodeType(); - SwNodeOffset nCurrentNode = pCurrentCursor->GetPoint()->nNode.GetIndex(); + SwNodeOffset nCurrentNode = pCurrentCursor->GetPoint()->GetNodeIndex(); // Register the Shell as dependent at the current Node. By doing this all // attribute changes can be signaled over the link. diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 7a6a905278b7..0fb667ce0578 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -197,8 +197,8 @@ SwCursor* SwCursorShell::GetCursor( bool bMakeTableCursor ) const if( bMakeTableCursor && m_pTableCursor->IsCursorMovedUpdate() ) { //don't re-create 'parked' cursors - if( m_pTableCursor->GetPoint()->nNode.GetIndex() && - m_pTableCursor->GetMark()->nNode.GetIndex() ) + if( m_pTableCursor->GetPoint()->GetNodeIndex() && + m_pTableCursor->GetMark()->GetNodeIndex() ) { const SwContentNode* pCNd = m_pTableCursor->GetContentNode(); if( pCNd && pCNd->getLayoutFrame( GetLayout() ) ) @@ -1084,7 +1084,7 @@ bool SwCursorShell::IsSelOnePara() const if (GetLayout()->HasMergedParas()) { SwContentFrame const*const pFrame(GetCurrFrame(false)); - auto const n(m_pCurrentCursor->GetMark()->nNode.GetIndex()); + auto const n(m_pCurrentCursor->GetMark()->GetNodeIndex()); return FrameContainsNode(*pFrame, n); } return false; @@ -2553,12 +2553,12 @@ OUString SwCursorShell::GetSelText() const if (GetLayout()->HasMergedParas()) { SwContentFrame const*const pFrame(GetCurrFrame(false)); - if (FrameContainsNode(*pFrame, m_pCurrentCursor->GetMark()->nNode.GetIndex())) + if (FrameContainsNode(*pFrame, m_pCurrentCursor->GetMark()->GetNodeIndex())) { OUStringBuffer buf; SwPosition const*const pStart(m_pCurrentCursor->Start()); SwPosition const*const pEnd(m_pCurrentCursor->End()); - for (SwNodeOffset i = pStart->nNode.GetIndex(); i <= pEnd->nNode.GetIndex(); ++i) + for (SwNodeOffset i = pStart->GetNodeIndex(); i <= pEnd->GetNodeIndex(); ++i) { SwNode const& rNode(*pStart->GetNodes()[i]); assert(!rNode.IsEndNode()); @@ -2568,10 +2568,10 @@ OUString SwCursorShell::GetSelText() const } else if (rNode.IsTextNode()) { - sal_Int32 const nStart(i == pStart->nNode.GetIndex() + sal_Int32 const nStart(i == pStart->GetNodeIndex() ? pStart->nContent.GetIndex() : 0); - sal_Int32 const nEnd(i == pEnd->nNode.GetIndex() + sal_Int32 const nEnd(i == pEnd->GetNodeIndex() ? pEnd->nContent.GetIndex() : rNode.GetTextNode()->Len()); buf.append(rNode.GetTextNode()->GetExpandText( @@ -2584,8 +2584,8 @@ OUString SwCursorShell::GetSelText() const aText = buf.makeStringAndClear(); } } - else if( m_pCurrentCursor->GetPoint()->nNode.GetIndex() == - m_pCurrentCursor->GetMark()->nNode.GetIndex() ) + else if( m_pCurrentCursor->GetPoint()->GetNodeIndex() == + m_pCurrentCursor->GetMark()->GetNodeIndex() ) { SwTextNode* pTextNd = m_pCurrentCursor->GetNode().GetTextNode(); if( pTextNd ) @@ -3063,8 +3063,8 @@ bool SwCursorShell::ShouldWait() const return true; SwPaM* pPam = GetCursor(); - return pPam->Start()->nNode.GetIndex() + SwNodeOffset(10) < - pPam->End()->nNode.GetIndex(); + return pPam->Start()->GetNodeIndex() + SwNodeOffset(10) < + pPam->End()->GetNodeIndex(); } size_t SwCursorShell::UpdateTableSelBoxes() @@ -3406,8 +3406,8 @@ bool SwCursorShell::IsSelFullPara() const { bool bRet = false; - if( m_pCurrentCursor->GetPoint()->nNode.GetIndex() == - m_pCurrentCursor->GetMark()->nNode.GetIndex() && !m_pCurrentCursor->IsMultiSelection() ) + 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(); diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 2de83faccc67..114dccd12d93 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -522,7 +522,7 @@ bool SwCursorShell::GotoNxtPrvTOXMark( bool bNext ) aFndPos.nNode = SwNodeOffset(0); SetGetExpField aFndGEF( aFndPos ), aCurGEF( rPos ); - if( rPos.nNode.GetIndex() < GetDoc()->GetNodes().GetEndOfExtras().GetIndex() ) + if( rPos.GetNodeIndex() < GetDoc()->GetNodes().GetEndOfExtras().GetIndex() ) { // also at collection use only the first frame std::pair<Point, bool> const tmp(aPt, false); @@ -678,7 +678,7 @@ lcl_FindField(bool & o_rFound, SetGetExpFields const& rSrtLst, pSrch.reset(new SetGetExpField(rPos.nNode, pTextField, pIndex.get())); } - if (rPos.nNode.GetIndex() < pTextNode->GetNodes().GetEndOfExtras().GetIndex()) + if (rPos.GetNodeIndex() < pTextNode->GetNodes().GetEndOfExtras().GetIndex()) { // also at collection use only the first frame Point aPt; @@ -1930,7 +1930,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, pTextNd->SwContentNode::GetAttr( aSet ); rContentAtPos.sStr = "Pos: ("; - rContentAtPos.sStr += OUString::number( sal_Int32(aPos.nNode.GetIndex())); + rContentAtPos.sStr += OUString::number( sal_Int32(aPos.GetNodeIndex())); rContentAtPos.sStr += ":"; rContentAtPos.sStr += OUString::number( aPos.nContent.GetIndex()); rContentAtPos.sStr += ")"; diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index 6342416972ad..56ded25b8e62 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -960,8 +960,8 @@ bool FindAttrImpl(SwPaM & rSearchPam, pAttr = iter.NextAttr(&pAttrNode); } while (pAttr - && (pAttrNode->GetIndex() < pPam->GetPoint()->nNode.GetIndex() - || (pAttrNode->GetIndex() == pPam->GetPoint()->nNode.GetIndex() + && (pAttrNode->GetIndex() < pPam->GetPoint()->GetNodeIndex() + || (pAttrNode->GetIndex() == pPam->GetPoint()->GetNodeIndex() && pAttr->GetStart() < pPam->GetPoint()->nContent.GetIndex()) || pAttr->Which() != nWhich)); } @@ -973,8 +973,8 @@ bool FindAttrImpl(SwPaM & rSearchPam, pAttr = iter.PrevAttr(&pAttrNode); } while (pAttr - && (pPam->GetPoint()->nNode.GetIndex() < pAttrNode->GetIndex() - || (pPam->GetPoint()->nNode.GetIndex() == pAttrNode->GetIndex() + && (pPam->GetPoint()->GetNodeIndex() < pAttrNode->GetIndex() + || (pPam->GetPoint()->GetNodeIndex() == pAttrNode->GetIndex() && pPam->GetPoint()->nContent.GetIndex() <= pAttr->GetStart()) || pAttr->Which() != nWhich)); } @@ -1106,8 +1106,8 @@ static bool FindAttrsImpl(SwPaM & rSearchPam, // to find its node items if (pMergedPara->extents.empty()) { - if (rStart.nNode.GetIndex() <= rPropsNode.GetIndex() - && rPropsNode.GetIndex() <= rEnd.nNode.GetIndex()) + if (rStart.GetNodeIndex() <= rPropsNode.GetIndex() + && rPropsNode.GetIndex() <= rEnd.GetNodeIndex()) { SwPaM tmp(rPropsNode, 0, rPropsNode, 0); bFound = (*fnSearch)(*pNode->GetTextNode(), aCmpArr, tmp); @@ -1127,8 +1127,8 @@ static bool FindAttrsImpl(SwPaM & rSearchPam, auto const rExtent(pMergedPara->extents[bSrchForward ? i : pMergedPara->extents.size() - i - 1]); - if (rExtent.pNode->GetIndex() < rStart.nNode.GetIndex() - || rEnd.nNode.GetIndex() < rExtent.pNode->GetIndex()) + if (rExtent.pNode->GetIndex() < rStart.GetNodeIndex() + || rEnd.GetNodeIndex() < rExtent.pNode->GetIndex()) { continue; } diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 8f16efc9ed8f..dbe856ec37cf 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -421,7 +421,7 @@ bool FindTextImpl(SwPaM & rSearchPam, } AmbiguousIndex nEnd; if (pLayout - ? FrameContainsNode(*pFrame, pPam->GetMark()->nNode.GetIndex()) + ? FrameContainsNode(*pFrame, pPam->GetMark()->GetNodeIndex()) : rNdIdx == pPam->GetMark()->nNode) { if (pLayout) @@ -518,8 +518,8 @@ bool FindTextImpl(SwPaM & rSearchPam, { const SwPosition* pPosition = pFrameFormat->GetAnchor().GetContentAnchor(); if (!pPosition || (pLayout - ? !FrameContainsNode(*pFrame, pPosition->nNode.GetIndex()) - : pPosition->nNode.GetIndex() != pNode->GetIndex())) + ? !FrameContainsNode(*pFrame, pPosition->GetNodeIndex()) + : pPosition->GetNodeIndex() != pNode->GetIndex())) pObject = nullptr; } } @@ -899,8 +899,8 @@ bool DoSearch(SwPaM & rSearchPam, if( (bSrchForward || pSttNd != &rNdIdx.GetNode()) && rSearchPam.Move(fnMoveForward, GoInContent) && (!bSrchForward || pSttNd != &rSearchPam.GetPoint()->GetNode()) && - SwNodeOffset(1) == abs(rSearchPam.GetPoint()->nNode.GetIndex() - - rSearchPam.GetMark()->nNode.GetIndex())) + SwNodeOffset(1) == abs(rSearchPam.GetPoint()->GetNodeIndex() - + rSearchPam.GetMark()->GetNodeIndex())) { // if backward search, switch point and mark if( !bSrchForward ) @@ -1129,7 +1129,7 @@ std::optional<OUString> ReplaceBackReferences(const i18nutil::SearchOptions2& rS : nullptr); const bool bParaEnd = rSearchOpt.searchString == "$" || rSearchOpt.searchString == "^$" || rSearchOpt.searchString == "$^"; if (bParaEnd || (pLayout - ? sw::FrameContainsNode(*pFrame, pPam->GetMark()->nNode.GetIndex()) + ? sw::FrameContainsNode(*pFrame, pPam->GetMark()->GetNodeIndex()) : pTextNode == pMarkTextNode)) { utl::TextSearch aSText( utl::TextSearch::UpgradeToSearchOptions2( rSearchOpt) ); diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index efef4aa2dcec..3f42c4c60dc6 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -203,14 +203,14 @@ SwDoc& SwPosition::GetDoc() const void SwPosition::dumpAsXml(xmlTextWriterPtr pWriter) const { (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwPosition")); - (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nNode"), BAD_CAST(OString::number(sal_Int32(nNode.GetIndex())).getStr())); + (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)xmlTextWriterEndElement(pWriter); } std::ostream &operator <<(std::ostream& s, const SwPosition& position) { - return s << "SwPosition (node " << position.nNode.GetIndex() << ", offset " << position.nContent.GetIndex() << ")"; + return s << "SwPosition (node " << position.GetNodeIndex() << ", offset " << position.nContent.GetIndex() << ")"; } namespace { @@ -704,8 +704,8 @@ bool SwPaM::HasReadonlySel( bool bFormView ) const // check for protected section inside the selection if( !bRet ) { - SwNodeOffset nSttIdx = GetMark()->nNode.GetIndex(), - nEndIdx = GetPoint()->nNode.GetIndex(); + SwNodeOffset nSttIdx = GetMark()->GetNodeIndex(), + nEndIdx = GetPoint()->GetNodeIndex(); if( nEndIdx <= nSttIdx ) { SwNodeOffset nTmp = nSttIdx; diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index 2d9cafd2005f..d6ef76de8c61 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -95,8 +95,8 @@ struct PercentHdl else { bNodeIdx = true; - nStt = sal_Int32(rPam.GetMark()->nNode.GetIndex()); - nEnd = sal_Int32(rPam.GetPoint()->nNode.GetIndex()); + nStt = sal_Int32(rPam.GetMark()->GetNodeIndex()); + nEnd = sal_Int32(rPam.GetPoint()->GetNodeIndex()); } nActPos = nStt; bBack = (nStt > nEnd ); @@ -116,7 +116,7 @@ struct PercentHdl { sal_Int32 nPos; if( bNodeIdx ) - nPos = sal_Int32(rPos.nNode.GetIndex()); + nPos = sal_Int32(rPos.GetNodeIndex()); else nPos = rPos.nContent.GetIndex(); ::SetProgressState( bBack ? nActPos - nPos : nPos, pDSh ); @@ -184,7 +184,7 @@ void SwCursor::RestoreState() /// determine if point is outside of the node-array's content area bool SwCursor::IsNoContent() const { - return GetPoint()->nNode.GetIndex() < + return GetPoint()->GetNodeIndex() < GetDoc().GetNodes().GetEndOfExtras().GetIndex(); } @@ -236,7 +236,7 @@ bool SwCursor::IsSelOvr( SwCursorSelOverFlags eFlags ) return true; } - if (m_vSavePos.back().nNode != GetPoint()->nNode.GetIndex() && + if (m_vSavePos.back().nNode != GetPoint()->GetNodeIndex() && // (1997) in UI-ReadOnly everything is allowed ( !rDoc.GetDocShell() || !rDoc.GetDocShell()->IsReadOnlyUI() )) { @@ -301,8 +301,8 @@ bool SwCursor::IsSelOvr( SwCursorSelOverFlags eFlags ) // is there a protected section in the section? if( HasMark() && bSkipOverProtectSections) { - SwNodeOffset nSttIdx = GetMark()->nNode.GetIndex(), - nEndIdx = GetPoint()->nNode.GetIndex(); + SwNodeOffset nSttIdx = GetMark()->GetNodeIndex(), + nEndIdx = GetPoint()->GetNodeIndex(); if( nEndIdx <= nSttIdx ) { SwNodeOffset nTmp = nSttIdx; @@ -454,14 +454,14 @@ bool SwCursor::IsSelOvr( SwCursorSelOverFlags eFlags ) const SwNodeOffset nRefNodeIdx = ( SwCursorSelOverFlags::Toggle & eFlags ) ? m_vSavePos.back().nNode - : GetMark()->nNode.GetIndex(); + : GetMark()->GetNodeIndex(); const sal_Int32 nRefContentIdx = ( SwCursorSelOverFlags::Toggle & eFlags ) ? m_vSavePos.back().nContent : GetMark()->nContent.GetIndex(); const bool bIsForwardSelection = - nRefNodeIdx < GetPoint()->nNode.GetIndex() - || ( nRefNodeIdx == GetPoint()->nNode.GetIndex() + nRefNodeIdx < GetPoint()->GetNodeIndex() + || ( nRefNodeIdx == GetPoint()->GetNodeIndex() && nRefContentIdx < GetPoint()->nContent.GetIndex() ); if ( pInputFieldTextAttrAtPoint != nullptr ) @@ -501,9 +501,9 @@ bool SwCursor::IsSelOvr( SwCursorSelOverFlags eFlags ) // Only Point in Table then go behind/in front of table if (SwCursorSelOverFlags::ChangePos & eFlags) { - bool bSelTop = GetPoint()->nNode.GetIndex() < + bool bSelTop = GetPoint()->GetNodeIndex() < ((SwCursorSelOverFlags::Toggle & eFlags) - ? m_vSavePos.back().nNode : GetMark()->nNode.GetIndex()); + ? m_vSavePos.back().nNode : GetMark()->GetNodeIndex()); do { // loop for table after table SwNodeOffset nSEIdx = pPtNd->EndOfSectionIndex(); @@ -577,7 +577,7 @@ bool SwCursor::IsInProtectTable( bool bMove, bool bChgCursor ) return false; // Current position == last save position? - if (m_vSavePos.back().nNode == GetPoint()->nNode.GetIndex()) + if (m_vSavePos.back().nNode == GetPoint()->GetNodeIndex()) return false; // Check for covered cell: @@ -612,7 +612,7 @@ bool SwCursor::IsInProtectTable( bool bMove, bool bChgCursor ) } // We are in a protected table cell. Traverse top to bottom? - if (m_vSavePos.back().nNode < GetPoint()->nNode.GetIndex()) + if (m_vSavePos.back().nNode < GetPoint()->GetNodeIndex()) { // search next valid box // if there is another StartNode after the EndNode of a cell then @@ -903,8 +903,8 @@ static bool lcl_MakeSelFwrd( const SwNode& rSttNd, const SwNode& rEndNd, return false; pCNd->MakeStartIndex( &rPam.GetPoint()->nContent ); } - else if( rSttNd.GetIndex() > rPam.GetPoint()->nNode.GetIndex() || - rPam.GetPoint()->nNode.GetIndex() >= rEndNd.GetIndex() ) + else if( rSttNd.GetIndex() > rPam.GetPoint()->GetNodeIndex() || + rPam.GetPoint()->GetNodeIndex() >= rEndNd.GetIndex() ) // not in this section return false; @@ -935,8 +935,8 @@ static bool lcl_MakeSelBkwrd( const SwNode& rSttNd, const SwNode& rEndNd, return false; pCNd->MakeEndIndex( &rPam.GetPoint()->nContent ); } - else if( rEndNd.GetIndex() > rPam.GetPoint()->nNode.GetIndex() || - rPam.GetPoint()->nNode.GetIndex() >= rSttNd.GetIndex() ) + else if( rEndNd.GetIndex() > rPam.GetPoint()->GetNodeIndex() || + rPam.GetPoint()->GetNodeIndex() >= rSttNd.GetIndex() ) return false; // not in this section rPam.SetMark(); @@ -1003,11 +1003,11 @@ sal_Int32 SwCursor::FindAll( SwFindParas& rParas, ? lcl_MakeSelBkwrd( rNds.GetEndOfExtras(), *rNds.GetEndOfPostIts().StartOfSectionNode(), *this, rNds.GetEndOfExtras().GetIndex() >= - GetPoint()->nNode.GetIndex() ) + GetPoint()->GetNodeIndex() ) : lcl_MakeSelFwrd( *rNds.GetEndOfPostIts().StartOfSectionNode(), rNds.GetEndOfExtras(), *this, rNds.GetEndOfExtras().GetIndex() >= - GetPoint()->nNode.GetIndex() )) + GetPoint()->GetNodeIndex() )) { nFound = lcl_FindSelection( rParas, this, fnMove, pFndRing, aRegion, eFndRngs, bInReadOnly, bCancel ); @@ -2588,8 +2588,8 @@ bool SwTableCursor::IsCursorMovedUpdate() if( !IsCursorMoved() ) return false; - m_nTableMkNd = GetMark()->nNode.GetIndex(); - m_nTablePtNd = GetPoint()->nNode.GetIndex(); + m_nTableMkNd = GetMark()->GetNodeIndex(); + m_nTablePtNd = GetPoint()->GetNodeIndex(); m_nTableMkCnt = GetMark()->nContent.GetIndex(); m_nTablePtCnt = GetPoint()->nContent.GetIndex(); return true; diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx index 47bcf5b903e0..d1fa10b9efa4 100644 --- a/sw/source/core/crsr/trvlfnfl.cxx +++ b/sw/source/core/crsr/trvlfnfl.cxx @@ -213,7 +213,7 @@ bool SwCursor::GotoNextFootnoteAnchor() // there is a footnote with this index, so search also for the next one if( nPos < rFootnoteArr.size() ) { - SwNodeOffset nNdPos = GetPoint()->nNode.GetIndex(); + SwNodeOffset nNdPos = GetPoint()->GetNodeIndex(); const sal_Int32 nCntPos = GetPoint()->nContent.GetIndex(); pTextFootnote = rFootnoteArr[ nPos ]; @@ -284,7 +284,7 @@ bool SwCursor::GotoPrevFootnoteAnchor() if( rFootnoteArr.SeekEntry( GetPoint()->nNode, &nPos ) ) { // there is a footnote with this index, so search also for the next one - SwNodeOffset nNdPos = GetPoint()->nNode.GetIndex(); + SwNodeOffset nNdPos = GetPoint()->GetNodeIndex(); const sal_Int32 nCntPos = GetPoint()->nContent.GetIndex(); pTextFootnote = rFootnoteArr[ nPos ]; diff --git a/sw/source/core/crsr/trvlreg.cxx b/sw/source/core/crsr/trvlreg.cxx index 7de5695869d7..d87ee41454c0 100644 --- a/sw/source/core/crsr/trvlreg.cxx +++ b/sw/source/core/crsr/trvlreg.cxx @@ -229,7 +229,7 @@ bool SwCursor::MoveRegion( SwWhichRegion fnWhichRegion, SwMoveFnCollection const return !dynamic_cast<SwTableCursor*>(this) && (*fnWhichRegion)( *this, fnPosRegion, IsReadOnlyAvailable() ) && !IsSelOvr() && - (GetPoint()->nNode.GetIndex() != m_vSavePos.back().nNode || + (GetPoint()->GetNodeIndex() != m_vSavePos.back().nNode || GetPoint()->nContent.GetIndex() != m_vSavePos.back().nContent); } diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index abe4a09f55d8..96615c9e115b 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -702,7 +702,7 @@ bool SwCursorShell::MoveTable( SwWhichTable fnWhichTable, SwMoveFnCollection con else { bCheckPos = true; - nPtNd = pCursor->GetPoint()->nNode.GetIndex(); + nPtNd = pCursor->GetPoint()->GetNodeIndex(); nPtCnt = pCursor->GetPoint()->nContent.GetIndex(); } @@ -716,7 +716,7 @@ bool SwCursorShell::MoveTable( SwWhichTable fnWhichTable, SwMoveFnCollection con UpdateCursor(SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE|SwCursorShell::READONLY); if( bCheckPos && - pCursor->GetPoint()->nNode.GetIndex() == nPtNd && + pCursor->GetPoint()->GetNodeIndex() == nPtNd && pCursor->GetPoint()->nContent.GetIndex() == nPtCnt ) bRet = false; } @@ -839,7 +839,7 @@ bool SwCursorShell::CheckTableBoxContent( const SwPosition* pPos ) // cursor not anymore in this section? if( pChkBox && !pPos && ( m_pCurrentCursor->HasMark() || m_pCurrentCursor->GetNext() != m_pCurrentCursor || - pSttNd->GetIndex() + 1 == m_pCurrentCursor->GetPoint()->nNode.GetIndex() )) + pSttNd->GetIndex() + 1 == m_pCurrentCursor->GetPoint()->GetNodeIndex() )) pChkBox = nullptr; // Did the content of a box change at all? This is important if e.g. Undo diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index cb9db2a4364d..a0c2fe47ad03 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -1083,7 +1083,7 @@ void SwShellTableCursor::SaveTableBoxContent( const SwPosition* pPos ) void SwShellTableCursor::FillRects() { // Calculate the new rectangles. If the cursor is still "parked" do nothing - if (m_SelectedBoxes.empty() || m_bParked || !GetPoint()->nNode.GetIndex()) + if (m_SelectedBoxes.empty() || m_bParked || !GetPoint()->GetNodeIndex()) return; bool bStart = true; @@ -1153,7 +1153,7 @@ void SwShellTableCursor::FillStartEnd(SwRect& rStart, SwRect& rEnd) const bool SwShellTableCursor::Contains( const Point& rPt ) const { // Calculate the new rectangles. If the cursor is still "parked" do nothing - if (m_SelectedBoxes.empty() || m_bParked || !GetPoint()->nNode.GetIndex()) + if (m_SelectedBoxes.empty() || m_bParked || !GetPoint()->GetNodeIndex()) return false; SwNodes& rNds = GetDoc().GetNodes(); diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx index 84225d8a5f76..9e54fe4610ad 100644 --- a/sw/source/core/doc/CntntIdxStore.cxx +++ b/sw/source/core/doc/CntntIdxStore.cxx @@ -53,7 +53,7 @@ namespace int lcl_RelativePosition( const SwPosition& rPos, SwNodeOffset nNode, sal_Int32 nContent ) { - SwNodeOffset nIndex = rPos.nNode.GetIndex(); + SwNodeOffset nIndex = rPos.GetNodeIndex(); int nReturn = BEFORE_NODE; if( nIndex == nNode ) { @@ -201,7 +201,7 @@ namespace void lcl_ChkPaM( std::vector<PaMEntry>& rPaMEntries, const SwNodeOffset nNode, const sal_Int32 nContent, SwPaM& rPaM, const bool bGetPoint, bool bSetMark) { const SwPosition* pPos = &rPaM.GetBound(bGetPoint); - if( pPos->nNode.GetIndex() == nNode && pPos->nContent.GetIndex() < nContent ) + if( pPos->GetNodeIndex() == nNode && pPos->nContent.GetIndex() < nContent ) { const PaMEntry aEntry = { &rPaM, bSetMark, pPos->nContent.GetIndex() }; rPaMEntries.push_back(aEntry); @@ -238,7 +238,7 @@ void ContentIdxStoreImpl::SaveBkmks(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 n { const ::sw::mark::IMark* pBkmk = *ppBkmk; bool bMarkPosEqual = false; - if(pBkmk->GetMarkPos().nNode.GetIndex() == nNode + if(pBkmk->GetMarkPos().GetNodeIndex() == nNode && pBkmk->GetMarkPos().nContent.GetIndex() <= nContent) { if(pBkmk->GetMarkPos().nContent.GetIndex() < nContent) @@ -250,7 +250,7 @@ void ContentIdxStoreImpl::SaveBkmks(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 n bMarkPosEqual = true; // has to decide if it is added to the array } if(pBkmk->IsExpanded() - && pBkmk->GetOtherMarkPos().nNode.GetIndex() == nNode + && pBkmk->GetOtherMarkPos().GetNodeIndex() == nNode && pBkmk->GetOtherMarkPos().nContent.GetIndex() <= nContent) { if(bMarkPosEqual) @@ -344,7 +344,7 @@ void ContentIdxStoreImpl::SaveFlys(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 nC { const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); SwPosition const*const pAPos = rAnchor.GetContentAnchor(); - if ( pAPos && ( nNode == pAPos->nNode.GetIndex() ) && + if ( pAPos && ( nNode == pAPos->GetNodeIndex() ) && ( RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId() || RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId() ) ) { diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 05487f9a63fc..3eb119a177ec 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -113,8 +113,8 @@ namespace (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId()) || (RndStdIds::FLY_AT_FLY == pAnchor->GetAnchorId()) || (RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId())) && - nSttNd <= pAPos->nNode.GetIndex() && - pAPos->nNode.GetIndex() < nEndNd ) + nSttNd <= pAPos->GetNodeIndex() && + pAPos->GetNodeIndex() < nEndNd ) { const SwFormatContent& rContent = pFormat->GetContent(); SwStartNode* pSNd; @@ -167,8 +167,8 @@ namespace */ void lcl_NonCopyCount( const SwPaM& rPam, SwNodeIndex& rLastIdx, const SwNodeOffset nNewIdx, SwNodeOffset& rDelCount ) { - SwNodeOffset nStart = rPam.Start()->nNode.GetIndex(); - SwNodeOffset nEnd = rPam.End()->nNode.GetIndex(); + SwNodeOffset nStart = rPam.Start()->GetNodeIndex(); + SwNodeOffset nEnd = rPam.End()->GetNodeIndex(); if( rLastIdx.GetIndex() < nNewIdx ) // Moving forward? { // We never copy the StartOfContent node @@ -206,13 +206,13 @@ namespace SwPosition& rChgPos, SwNodeOffset nDelCount ) { - SwNodeOffset nNdOff = rOrigPos.nNode.GetIndex(); - nNdOff -= rOrigStt.nNode.GetIndex(); + SwNodeOffset nNdOff = rOrigPos.GetNodeIndex(); + nNdOff -= rOrigStt.GetNodeIndex(); nNdOff -= nDelCount; sal_Int32 nContentPos = rOrigPos.nContent.GetIndex(); // Always adjust <nNode> at to be changed <SwPosition> instance <rChgPos> - rChgPos.nNode = nNdOff + rCpyStt.nNode.GetIndex(); + rChgPos.nNode = nNdOff + rCpyStt.GetNodeIndex(); if( !nNdOff ) { // just adapt the content index @@ -284,12 +284,12 @@ namespace sw for(const sw::mark::IMark* const pMark : vMarksToCopy) { SwPaM aTmpPam(*pCpyStt); - lcl_NonCopyCount(rPam, aCorrIdx, pMark->GetMarkPos().nNode.GetIndex(), nDelCount); + lcl_NonCopyCount(rPam, aCorrIdx, pMark->GetMarkPos().GetNodeIndex(), nDelCount); lcl_SetCpyPos( pMark->GetMarkPos(), rStt, *pCpyStt, *aTmpPam.GetPoint(), nDelCount); if(pMark->IsExpanded()) { aTmpPam.SetMark(); - lcl_NonCopyCount(rPam, aCorrIdx, pMark->GetOtherMarkPos().nNode.GetIndex(), nDelCount); + lcl_NonCopyCount(rPam, aCorrIdx, pMark->GetOtherMarkPos().GetNodeIndex(), nDelCount); lcl_SetCpyPos(pMark->GetOtherMarkPos(), rStt, *pCpyStt, *aTmpPam.GetMark(), nDelCount); } @@ -393,7 +393,7 @@ namespace pDelPam.reset(new SwPaM( *pCpyStt, pDelPam.release() )); if( *pStt < *pRStt ) { - lcl_NonCopyCount( rPam, aCorrIdx, pRStt->nNode.GetIndex(), nDelCount ); + lcl_NonCopyCount( rPam, aCorrIdx, pRStt->GetNodeIndex(), nDelCount ); lcl_SetCpyPos( *pRStt, *pStt, *pCpyStt, *pDelPam->GetPoint(), nDelCount ); } @@ -403,7 +403,7 @@ namespace *pDelPam->GetPoint() = *pCpyEnd; else { - lcl_NonCopyCount( rPam, aCorrIdx, pREnd->nNode.GetIndex(), nDelCount ); + lcl_NonCopyCount( rPam, aCorrIdx, pREnd->GetNodeIndex(), nDelCount ); lcl_SetCpyPos( *pREnd, *pStt, *pCpyStt, *pDelPam->GetPoint(), nDelCount ); } @@ -521,8 +521,8 @@ namespace sw void CalcBreaks(std::vector<std::pair<SwNodeOffset, sal_Int32>> & rBreaks, SwPaM const & rPam, bool const isOnlyFieldmarks) { - SwNodeOffset const nStartNode(rPam.Start()->nNode.GetIndex()); - SwNodeOffset const nEndNode(rPam.End()->nNode.GetIndex()); + SwNodeOffset const nStartNode(rPam.Start()->GetNodeIndex()); + SwNodeOffset const nEndNode(rPam.End()->GetNodeIndex()); SwNodes const& rNodes(rPam.GetPoint()->GetNodes()); IDocumentMarkAccess const& rIDMA(*rPam.GetDoc().getIDocumentMarkAccess()); @@ -626,7 +626,7 @@ namespace sw { SwPosition const& rStart(std::get<0>(startedFields.top())->GetMarkStart()); std::pair<SwNodeOffset, sal_Int32> const pos( - rStart.nNode.GetIndex(), rStart.nContent.GetIndex()); + rStart.GetNodeIndex(), rStart.nContent.GetIndex()); auto it = std::lower_bound(rBreaks.begin(), rBreaks.end(), pos); assert(it == rBreaks.end() || *it != pos); rBreaks.insert(it, pos); @@ -682,7 +682,7 @@ namespace if (rStart < rEnd) // check if part is empty { bRet &= (rDocumentContentOperations.*pFunc)(aPam, flags); - nOffset = iter->first - rStart.nNode.GetIndex(); // deleted fly nodes... + nOffset = iter->first - rStart.GetNodeIndex(); // deleted fly nodes... } rEnd = SwPosition(*rNodes[iter->first - nOffset]->GetTextNode(), iter->second); ++iter; @@ -729,11 +729,11 @@ namespace { auto [pStt, pEnd] = pR->StartEnd(); // SwPosition* SwNodeOffset nSttIdx = rSttIdx.GetIndex(); - nStt = pStt->nNode.GetIndex() - nSttIdx; + nStt = pStt->GetNodeIndex() - nSttIdx; nSttCnt = pStt->nContent.GetIndex(); if( pR->HasMark() ) { - nEnd = pEnd->nNode.GetIndex() - nSttIdx; + nEnd = pEnd->GetNodeIndex() - nSttIdx; nEndCnt = pEnd->nContent.GetIndex(); } @@ -749,14 +749,14 @@ namespace , nEndCnt(0) { auto [pStt, pEnd] = pR->StartEnd(); // SwPosition* - SwNodeOffset nSttIdx = rPos.nNode.GetIndex(); - nStt = pStt->nNode.GetIndex() - nSttIdx; + SwNodeOffset nSttIdx = rPos.GetNodeIndex(); + nStt = pStt->GetNodeIndex() - nSttIdx; nSttCnt = pStt->nContent.GetIndex(); if( nStt == SwNodeOffset(0) ) nSttCnt = nSttCnt - rPos.nContent.GetIndex(); if( pR->HasMark() ) { - nEnd = pEnd->nNode.GetIndex() - nSttIdx; + nEnd = pEnd->GetNodeIndex() - nSttIdx; nEndCnt = pEnd->nContent.GetIndex(); if( nEnd == SwNodeOffset(0) ) nEndCnt = nEndCnt - rPos.nContent.GetIndex(); @@ -781,11 +781,11 @@ namespace void SetPos( const SwPosition& aPos ) { - pRedl->GetPoint()->nNode = aPos.nNode.GetIndex() + nStt; + pRedl->GetPoint()->nNode = aPos.GetNodeIndex() + nStt; pRedl->GetPoint()->nContent.Assign( pRedl->GetContentNode(), nSttCnt + ( nStt == SwNodeOffset(0) ? aPos.nContent.GetIndex() : 0 ) ); if( pRedl->HasMark() ) { - pRedl->GetMark()->nNode = aPos.nNode.GetIndex() + nEnd; + pRedl->GetMark()->nNode = aPos.GetNodeIndex() + nEnd; pRedl->GetMark()->nContent.Assign( pRedl->GetContentNode(false), nEndCnt + ( nEnd == SwNodeOffset(0) ? aPos.nContent.GetIndex() : 0 ) ); } } @@ -2027,8 +2027,8 @@ DocumentContentOperationsManager::CopyRange( SwPaM& rPam, SwPosition& rPos, if (&rDoc == &m_rDoc && (flags & SwCopyFlags::CheckPosInFly)) { // Correct the Start-/EndNode - SwNodeOffset nStt = pStt->nNode.GetIndex(), - nEnd = pEnd->nNode.GetIndex(), + SwNodeOffset nStt = pStt->GetNodeIndex(), + nEnd = pEnd->GetNodeIndex(), nDiff = nEnd - nStt +1; SwNode* pNd = m_rDoc.GetNodes()[ nStt ]; if( pNd->IsContentNode() && pStt->nContent.GetIndex() ) @@ -2043,7 +2043,7 @@ DocumentContentOperationsManager::CopyRange( SwPaM& rPam, SwPosition& rPos, --nDiff; } if( nDiff && - lcl_ChkFlyFly( rDoc, nStt, nEnd, rPos.nNode.GetIndex() ) ) + lcl_ChkFlyFly( rDoc, nStt, nEnd, rPos.GetNodeIndex() ) ) { return false; } @@ -2147,11 +2147,11 @@ bool DocumentContentOperationsManager::DelFullPara( SwPaM& rPam ) const SwNode* pNd = &rStt.GetNode(); SwNodeOffset nSectDiff = pNd->StartOfSectionNode()->EndOfSectionIndex() - pNd->StartOfSectionIndex(); - SwNodeOffset nNodeDiff = rEnd.nNode.GetIndex() - rStt.nNode.GetIndex(); + SwNodeOffset nNodeDiff = rEnd.GetNodeIndex() - rStt.GetNodeIndex(); if ( nSectDiff-SwNodeOffset(2) <= nNodeDiff || m_rDoc.getIDocumentRedlineAccess().IsRedlineOn() || /* #i9185# Prevent getting the node after the end node (see below) */ - rEnd.nNode.GetIndex() + 1 == m_rDoc.GetNodes().Count() ) + rEnd.GetNodeIndex() + 1 == m_rDoc.GetNodes().Count() ) { return false; } @@ -2181,7 +2181,7 @@ bool DocumentContentOperationsManager::DelFullPara( SwPaM& rPam ) bool bSavePageBreak = false, bSavePageDesc = false; /* #i9185# This would lead to a segmentation fault if not caught above. */ - SwNodeOffset nNextNd = rEnd.nNode.GetIndex() + 1; + SwNodeOffset nNextNd = rEnd.GetNodeIndex() + 1; SwTableNode *const pTableNd = m_rDoc.GetNodes()[ nNextNd ]->GetTableNode(); if( pTableNd && pNd->IsContentNode() ) @@ -2415,14 +2415,14 @@ bool DocumentContentOperationsManager::MoveRange( SwPaM& rPaM, SwPosition& rPos, const sal_Int32 nMkContent = rPaM.GetMark()->nContent.GetIndex(); const std::shared_ptr<sw::mark::ContentIdxStore> pContentStore(sw::mark::ContentIdxStore::Create()); - pContentStore->Save( m_rDoc, rPos.nNode.GetIndex(), rPos.nContent.GetIndex(), true ); + pContentStore->Save( m_rDoc, rPos.GetNodeIndex(), rPos.nContent.GetIndex(), true ); SwTextNode * pOrigNode = pTNd; assert(*aSavePam.GetPoint() == *aSavePam.GetMark() && *aSavePam.GetPoint() == rPos); assert(aSavePam.GetPoint()->nContent.GetContentNode() == pOrigNode); - assert(aSavePam.GetPoint()->nNode == rPos.nNode.GetIndex()); - assert(rPos.nNode.GetIndex() == pOrigNode->GetIndex()); + assert(aSavePam.GetPoint()->nNode == rPos.GetNodeIndex()); + assert(rPos.GetNodeIndex() == pOrigNode->GetIndex()); std::function<void (SwTextNode *, sw::mark::RestoreMode, bool)> restoreFunc( [&](SwTextNode *const, sw::mark::RestoreMode const eMode, bool) @@ -2447,15 +2447,15 @@ bool DocumentContentOperationsManager::MoveRange( SwPaM& rPaM, SwPosition& rPos, assert(*aSavePam.GetPoint() == *aSavePam.GetMark() && *aSavePam.GetPoint() == rPos); assert(aSavePam.GetPoint()->nContent.GetContentNode() == pOrigNode); - assert(aSavePam.GetPoint()->nNode == rPos.nNode.GetIndex()); - assert(rPos.nNode.GetIndex() == pOrigNode->GetIndex()); + assert(aSavePam.GetPoint()->nNode == rPos.GetNodeIndex()); + assert(rPos.GetNodeIndex() == pOrigNode->GetIndex()); aSavePam.GetPoint()->nContent.Assign(pOrigNode, 0); rPos = *aSavePam.GetMark() = *aSavePam.GetPoint(); // correct the PaM! if( rPos.nNode == rPaM.GetMark()->nNode ) { - rPaM.GetMark()->nNode = rPos.nNode.GetIndex()-SwNodeOffset(1); + rPaM.GetMark()->nNode = rPos.GetNodeIndex()-SwNodeOffset(1); rPaM.GetMark()->nContent.Assign( pTNd, nMkContent ); } } @@ -2958,8 +2958,8 @@ void DocumentContentOperationsManager::TransliterateText( pUndo.reset(new SwUndoTransliterate( rPaM, rTrans )); auto [pStt, pEnd] = rPaM.StartEnd(); // SwPosition* - SwNodeOffset nSttNd = pStt->nNode.GetIndex(), - nEndNd = pEnd->nNode.GetIndex(); + SwNodeOffset nSttNd = pStt->GetNodeIndex(), + nEndNd = pEnd->GetNodeIndex(); sal_Int32 nSttCnt = pStt->nContent.GetIndex(); sal_Int32 nEndCnt = pEnd->nContent.GetIndex(); @@ -3157,7 +3157,7 @@ void DocumentContentOperationsManager::ReRead( SwPaM& rPam, const OUString& rGrf { SwGrfNode *pGrfNd; if( !(( !rPam.HasMark() - || rPam.GetPoint()->nNode.GetIndex() == rPam.GetMark()->nNode.GetIndex() ) + || rPam.GetPoint()->GetNodeIndex() == rPam.GetMark()->GetNodeIndex() ) && nullptr != ( pGrfNd = rPam.GetPoint()->GetNode().GetGrfNode() )) ) return; @@ -3325,7 +3325,7 @@ bool DocumentContentOperationsManager::SplitNode( const SwPosition &rPos, bool b // then insert a paragraph before it. if( bChkTableStart && !rPos.nContent.GetIndex() && pNode->IsTextNode() ) { - SwNodeOffset nPrevPos = rPos.nNode.GetIndex() - 1; + SwNodeOffset nPrevPos = rPos.GetNodeIndex() - 1; const SwTableNode* pTableNd; const SwNode* pNd = m_rDoc.GetNodes()[ nPrevPos ]; if( pNd->IsStartNode() && @@ -3392,14 +3392,14 @@ bool DocumentContentOperationsManager::SplitNode( const SwPosition &rPos, bool b } const std::shared_ptr<sw::mark::ContentIdxStore> pContentStore(sw::mark::ContentIdxStore::Create()); - pContentStore->Save( m_rDoc, rPos.nNode.GetIndex(), rPos.nContent.GetIndex(), true ); + pContentStore->Save( m_rDoc, rPos.GetNodeIndex(), rPos.nContent.GetIndex(), true ); assert(pNode->IsTextNode()); std::function<void (SwTextNode *, sw::mark::RestoreMode, bool bAtStart)> restoreFunc( [&](SwTextNode *const, sw::mark::RestoreMode const eMode, bool const bAtStart) { if (!pContentStore->Empty()) { // move all bookmarks, TOXMarks, FlyAtCnt - pContentStore->Restore(m_rDoc, rPos.nNode.GetIndex()-SwNodeOffset(1), 0, true, bAtStart && (eMode & sw::mark::RestoreMode::Flys), eMode); + pContentStore->Restore(m_rDoc, rPos.GetNodeIndex()-SwNodeOffset(1), 0, true, bAtStart && (eMode & sw::mark::RestoreMode::Flys), eMode); } if (eMode & sw::mark::RestoreMode::NonFlys) { @@ -3486,7 +3486,7 @@ bool DocumentContentOperationsManager::ReplaceRange( SwPaM& rPam, const OUString sw::CalcBreaks(Breaks, aPam); while (!Breaks.empty() // skip over prefix of dummy chars - && (aPam.GetMark()->nNode.GetIndex() == Breaks.begin()->first) + && (aPam.GetMark()->GetNodeIndex() == Breaks.begin()->first) && (aPam.GetMark()->nContent.GetIndex() == Breaks.begin()->second)) { // skip! @@ -3529,7 +3529,7 @@ bool DocumentContentOperationsManager::ReplaceRange( SwPaM& rPam, const OUString bRet &= (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn()) ? DeleteAndJoinWithRedlineImpl(aPam, SwDeleteFlags::Default) : DeleteAndJoinImpl(aPam, SwDeleteFlags::Default); - nOffset = iter->first - rStart.nNode.GetIndex(); // deleted fly nodes... + nOffset = iter->first - rStart.GetNodeIndex(); // deleted fly nodes... } rEnd = SwPosition(*rNodes[iter->first - nOffset]->GetTextNode(), iter->second); ++iter; @@ -3821,7 +3821,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( if ( !pAPos ) continue; bool bAdd = false; - SwNodeOffset nSkipAfter = pAPos->nNode.GetIndex(); + SwNodeOffset nSkipAfter = pAPos->GetNodeIndex(); SwNodeOffset nStart = rRg.aStart.GetIndex(); switch ( pAnchor->GetAnchorId() ) { @@ -3963,7 +3963,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( } else { - SwNodeOffset nOffset = newPos.nNode.GetIndex() - rRg.aStart.GetIndex(); + SwNodeOffset nOffset = newPos.GetNodeIndex() - rRg.aStart.GetIndex(); SwNodeIndex aIdx( rStartIdx, nOffset ); newPos.nNode = aIdx; } @@ -4434,7 +4434,7 @@ bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam, SwDelet } // if the end is not a content node, delete it as well - SwNodeOffset nEnd = pEnd->nNode.GetIndex(); + SwNodeOffset nEnd = pEnd->GetNodeIndex(); if( pCNd == nullptr ) nEnd++; @@ -4645,7 +4645,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt else { assert((pStt->nNode == pEnd->nNode || - ( pStt->nNode.GetIndex() + 1 == pEnd->nNode.GetIndex() && + ( pStt->GetNodeIndex() + 1 == pEnd->GetNodeIndex() && !pEnd->nContent.GetIndex() )) && "invalid range: Point and Mark on different nodes" ); @@ -4846,7 +4846,7 @@ bool DocumentContentOperationsManager::CopyImpl(SwPaM& rPam, SwPosition& rPos, { // pass in copyRange member as rPos; should work ... bRet &= CopyImplImpl(aPam, *copyRange.Start(), flags & ~SwCopyFlags::IsMoveToFly, ©Range); - nOffset = iter->first - rStart.nNode.GetIndex(); // fly nodes... + nOffset = iter->first - rStart.GetNodeIndex(); // fly nodes... if (pCopyRange) { if (bFirst) @@ -4917,7 +4917,7 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo } else { - pFlys = sw::GetFlysAnchoredAt(rDoc, rPos.nNode.GetIndex()); + pFlys = sw::GetFlysAnchoredAt(rDoc, rPos.GetNodeIndex()); pFlysAtInsPos = pFlys ? &*pFlys : nullptr; } @@ -4930,7 +4930,7 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo bool bCanMoveBack = pCopyPam->Move(fnMoveBackward, GoInContent); // If the position was shifted from more than one node, an end node has been skipped bool bAfterTable = false; - if ((rPos.nNode.GetIndex() - pCopyPam->GetPoint()->nNode.GetIndex()) > SwNodeOffset(1)) + if ((rPos.GetNodeIndex() - pCopyPam->GetPoint()->GetNodeIndex()) > SwNodeOffset(1)) { // First go back to the original place pCopyPam->GetPoint()->nNode = rPos.nNode; @@ -5264,7 +5264,7 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo { // Put the breaks back into the first node if( aBrkSet.Count() && nullptr != ( pDestTextNd = rDoc.GetNodes()[ - pCopyPam->GetPoint()->nNode.GetIndex()+1 ]->GetTextNode())) + pCopyPam->GetPoint()->GetNodeIndex()+1 ]->GetTextNode())) { pDestTextNd->SetAttr( aBrkSet ); bCopyPageSource = true; diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx index f2d936f4b094..f045f014273a 100644 --- a/sw/source/core/doc/DocumentLayoutManager.cxx +++ b/sw/source/core/doc/DocumentLayoutManager.cxx @@ -259,7 +259,7 @@ void DocumentLayoutManager::DelLayoutFormat( SwFrameFormat *pFormat ) SwFrameFormat* pTmpFormat = (*pTable)[i]; const SwFormatAnchor &rAnch = pTmpFormat->GetAnchor(); if ( rAnch.GetAnchorId() == RndStdIds::FLY_AT_FLY && - rAnch.GetContentAnchor()->nNode.GetIndex() == nNodeIdxOfFlyFormat ) + rAnch.GetContentAnchor()->GetNodeIndex() == nNodeIdxOfFlyFormat ) { aToDeleteFrameFormats.push_back( pTmpFormat ); } diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index d5c3f70114b6..6eb566b78e95 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -240,7 +240,7 @@ void UpdateFramesForAddDeleteRedline(SwDoc & rDoc, SwPaM const& rPam) // skip over hidden sections! pNode = static_cast<SwTextNode*>(pLast->GetNodes().GoNextSection(&tmp, /*bSkipHidden=*/true, /*bSkipProtect=*/false)); } - while (pNode && pNode->GetIndex() <= rPam.End()->nNode.GetIndex()); + while (pNode && pNode->GetIndex() <= rPam.End()->GetNodeIndex()); } // fields last - SwGetRefField::UpdateField requires up-to-date frames UpdateFieldsForRedline(rDoc.getIDocumentFieldsAccess()); // after footnotes @@ -368,7 +368,7 @@ void UpdateFramesForRemoveDeleteRedline(SwDoc & rDoc, SwPaM const& rPam) // skip over hidden sections! pNode = static_cast<SwTextNode*>(pLast->GetNodes().GoNextSection(&tmp, /*bSkipHidden=*/true, /*bSkipProtect=*/false)); } - while (pNode && pNode->GetIndex() <= rPam.End()->nNode.GetIndex()); + while (pNode && pNode->GetIndex() <= rPam.End()->GetNodeIndex()); } if (!isAppendObjsCalled) @@ -399,7 +399,7 @@ namespace const SwContentNode* pCNd; if( 0 != rPos2.nContent.GetIndex() ) return false; - if( rPos2.nNode.GetIndex() - 1 != rPos1.nNode.GetIndex() ) + if( rPos2.GetNodeIndex() - 1 != rPos1.GetNodeIndex() ) return false; pCNd = rPos1.GetNode().GetContentNode(); return pCNd && rPos1.nContent.GetIndex() == pCNd->Len(); @@ -1026,27 +1026,27 @@ namespace auto [pStt, pEnd] = rPam.StartEnd(); // SwPosition* SwDoc& rDoc = rPam.GetDoc(); if( !pStt->nContent.GetIndex() && - !rDoc.GetNodes()[ pStt->nNode.GetIndex() - 1 ]->IsContentNode() ) + !rDoc.GetNodes()[ pStt->GetNodeIndex() - 1 ]->IsContentNode() ) { const SwRangeRedline* pRedl = rDoc.getIDocumentRedlineAccess().GetRedline( *pStt, nullptr ); if( pRedl ) { const SwPosition* pRStt = pRedl->Start(); - if( !pRStt->nContent.GetIndex() && pRStt->nNode.GetIndex() == - pStt->nNode.GetIndex() - 1 ) + if( !pRStt->nContent.GetIndex() && pRStt->GetNodeIndex() == + pStt->GetNodeIndex() - 1 ) *pStt = *pRStt; } } if( pEnd->GetNode().IsContentNode() && - !rDoc.GetNodes()[ pEnd->nNode.GetIndex() + 1 ]->IsContentNode() && + !rDoc.GetNodes()[ pEnd->GetNodeIndex() + 1 ]->IsContentNode() && pEnd->nContent.GetIndex() == pEnd->GetNode().GetContentNode()->Len() ) { const SwRangeRedline* pRedl = rDoc.getIDocumentRedlineAccess().GetRedline( *pEnd, nullptr ); if( pRedl ) { const SwPosition* pREnd = pRedl->End(); - if( !pREnd->nContent.GetIndex() && pREnd->nNode.GetIndex() == - pEnd->nNode.GetIndex() + 1 ) + if( !pREnd->nContent.GetIndex() && pREnd->GetNodeIndex() == + pEnd->GetNodeIndex() + 1 ) *pEnd = *pREnd; } } @@ -2693,14 +2693,14 @@ SwRedlineTable::size_type DocumentRedlineManager::GetRedlinePos( const SwNode& r auto it = std::lower_bound(maRedlineTable.begin(), maRedlineTable.end(), rNd, [&nNdIdx](const SwRangeRedline* lhs, const SwNode& /*rhs*/) { - return lhs->End()->nNode.GetIndex() < nNdIdx; + return lhs->End()->GetNodeIndex() < nNdIdx; }); for( ; it != maRedlineTable.end(); ++it) { const SwRangeRedline* pTmp = *it; auto [pStart, pEnd] = pTmp->StartEnd(); // SwPosition* - SwNodeOffset nStart = pStart->nNode.GetIndex(), - nEnd = pEnd->nNode.GetIndex(); + SwNodeOffset nStart = pStart->GetNodeIndex(), + nEnd = pEnd->GetNodeIndex(); if( ( RedlineType::Any == nType || nType == pTmp->GetType()) && nStart <= nNdIdx && nNdIdx <= nEnd ) @@ -2715,8 +2715,8 @@ SwRedlineTable::size_type DocumentRedlineManager::GetRedlinePos( const SwNode& r for( SwRedlineTable::size_type n = 0; n < maRedlineTable.size() ; ++n ) { const SwRangeRedline* pTmp = maRedlineTable[ n ]; - SwNodeOffset nPt = pTmp->GetPoint()->nNode.GetIndex(), - nMk = pTmp->GetMark()->nNode.GetIndex(); + SwNodeOffset nPt = pTmp->GetPoint()->GetNodeIndex(), + nMk = pTmp->GetMark()->GetNodeIndex(); if( nPt < nMk ) { SwNodeOffset nTmp = nMk; nMk = nPt; nPt = nTmp; } if( ( RedlineType::Any == nType || nType == pTmp->GetType()) && @@ -2951,14 +2951,14 @@ void DocumentRedlineManager::AcceptRedlineParagraphFormatting( const SwPaM &rPam { auto [pStt, pEnd] = rPam.StartEnd(); // SwPosition* - const SwNodeOffset nSttIdx = pStt->nNode.GetIndex(); - const SwNodeOffset nEndIdx = pEnd->nNode.GetIndex(); + const SwNodeOffset nSttIdx = pStt->GetNodeIndex(); + const SwNodeOffset nEndIdx = pEnd->GetNodeIndex(); for( SwRedlineTable::size_type n = 0; n < maRedlineTable.size() ; ++n ) { const SwRangeRedline* pTmp = maRedlineTable[ n ]; - SwNodeOffset nPt = pTmp->GetPoint()->nNode.GetIndex(), - nMk = pTmp->GetMark()->nNode.GetIndex(); + SwNodeOffset nPt = pTmp->GetPoint()->GetNodeIndex(), + nMk = pTmp->GetMark()->GetNodeIndex(); if( nPt < nMk ) { SwNodeOffset nTmp = nMk; nMk = nPt; nPt = nTmp; } if( RedlineType::ParagraphFormat == pTmp->GetType() && diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx index b7956df30cc9..d95ea954fe73 100644 --- a/sw/source/core/doc/dbgoutsw.cxx +++ b/sw/source/core/doc/dbgoutsw.cxx @@ -317,7 +317,7 @@ static OUString lcl_dbg_out(const SwPosition & rPos) { OUString aStr = "( " + - OUString::number(sal_Int32(rPos.nNode.GetIndex())) + + OUString::number(sal_Int32(rPos.GetNodeIndex())) + ", " + OUString::number(rPos.nContent.GetIndex()) + ": " + diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index e2c15c188d7c..2f56cba64c53 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -459,9 +459,9 @@ namespace const SwPosition* const pStPos = &pMark->GetMarkStart(); const SwPosition* const pEndPos = &pMark->GetMarkEnd(); SAL_INFO("sw.core", - sal_Int32(pStPos->nNode.GetIndex()) << "," << + sal_Int32(pStPos->GetNodeIndex()) << "," << pStPos->nContent.GetIndex() << " " << - sal_Int32(pEndPos->nNode.GetIndex()) << "," << + sal_Int32(pEndPos->GetNodeIndex()) << "," << pEndPos->nContent.GetIndex() << " " << typeid(*pMark).name() << " " << pMark->GetName()); @@ -553,9 +553,9 @@ namespace sw::mark pPos2 = rPaM.GetMark(); SAL_INFO("sw.core", rName << " " << - sal_Int32(pPos1->nNode.GetIndex() )<< "," << + sal_Int32(pPos1->GetNodeIndex() )<< "," << pPos1->nContent.GetIndex() << " " << - sal_Int32(pPos2->nNode.GetIndex()) << "," << + sal_Int32(pPos2->GetNodeIndex()) << "," << pPos2->nContent.GetIndex()); } #endif @@ -1817,7 +1817,7 @@ SaveBookmark::SaveBookmark( m_pMetadataUndo = pMetadatable->CreateUndo(); } } - m_nNode1 = rBkmk.GetMarkPos().nNode.GetIndex(); + m_nNode1 = rBkmk.GetMarkPos().GetNodeIndex(); m_nContent1 = rBkmk.GetMarkPos().nContent.GetIndex(); m_nNode1 -= rMvPos.GetIndex(); @@ -1826,7 +1826,7 @@ SaveBookmark::SaveBookmark( if(rBkmk.IsExpanded()) { - m_nNode2 = rBkmk.GetOtherMarkPos().nNode.GetIndex(); + m_nNode2 = rBkmk.GetOtherMarkPos().GetNodeIndex(); m_nContent2 = rBkmk.GetOtherMarkPos().nContent.GetIndex(); m_nNode2 -= rMvPos.GetIndex(); diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 97e1aa362117..560c0dceb5a4 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -1746,7 +1746,7 @@ void CompareData::SetRedlinesToDoc( bool bUseDocInfo ) const SwContentNode* pCNd; if( rSttEnd == rEndStt || (!rEndStt.nContent.GetIndex() && - rEndStt.nNode.GetIndex() - 1 == rSttEnd.nNode.GetIndex() && + rEndStt.GetNodeIndex() - 1 == rSttEnd.GetNodeIndex() && nullptr != ( pCNd = rSttEnd.GetNode().GetContentNode() ) && rSttEnd.nContent.GetIndex() == pCNd->Len())) { @@ -1931,8 +1931,8 @@ SaveMergeRedline::SaveMergeRedline( const SwNode& rDstNd, const SwPosition* pEnd = rSrcRedl.End(); pDestRedl->SetMark(); - pDestRedl->GetPoint()->nNode += pEnd->nNode.GetIndex() - - pStt->nNode.GetIndex(); + pDestRedl->GetPoint()->nNode += pEnd->GetNodeIndex() - + pStt->GetNodeIndex(); pDestRedl->GetPoint()->nContent.Assign( pDestRedl->GetContentNode(), pEnd->nContent.GetIndex() ); } @@ -2104,7 +2104,7 @@ tools::Long SwDoc::MergeDoc( const SwDoc& rDoc ) SwNodeOffset nMyEndOfExtra = GetNodes().GetEndOfExtras().GetIndex(); for(const SwRangeRedline* pRedl : rSrcRedlTable) { - SwNodeOffset nNd = pRedl->GetPoint()->nNode.GetIndex(); + SwNodeOffset nNd = pRedl->GetPoint()->GetNodeIndex(); RedlineType eType = pRedl->GetType(); if( nEndOfExtra < nNd && ( RedlineType::Insert == eType || RedlineType::Delete == eType )) diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index e63d85050f11..4e545432acb6 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -86,7 +86,7 @@ void RestFlyInRange( SaveFlyArr & rArr, const SwPosition& rStartPos, } else { - aPos.nNode = rStartPos.nNode.GetIndex() + rSave.nNdDiff; + aPos.nNode = rStartPos.GetNodeIndex() + rSave.nNdDiff; assert(aPos.GetNode().GetContentNode()); aPos.nContent.Assign(aPos.GetNode().GetContentNode(), rSave.nNdDiff == SwNodeOffset(0) @@ -118,7 +118,7 @@ void SaveFlyInRange( const SwNodeRange& rRg, SaveFlyArr& rArr ) (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) && rRg.aStart <= pAPos->nNode && pAPos->nNode < rRg.aEnd ) { - SaveFly aSave( pAPos->nNode.GetIndex() - rRg.aStart.GetIndex(), + SaveFly aSave( pAPos->GetNodeIndex() - rRg.aStart.GetIndex(), (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId()) ? pAPos->nContent.GetIndex() : 0, @@ -186,7 +186,7 @@ void SaveFlyInRange( const SwPaM& rPam, const SwPosition& rInsPos, { pHistory->AddChangeFlyAnchor(*pFormat); } - SaveFly aSave( pAPos->nNode.GetIndex() - rSttNdIdx.GetIndex(), + SaveFly aSave( pAPos->GetNodeIndex() - rSttNdIdx.GetIndex(), (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId()) ? (pAPos->nNode == rSttNdIdx) ? pAPos->nContent.GetIndex() - rPam.Start()->nContent.GetIndex() @@ -538,8 +538,8 @@ uno::Any SwDoc::Spell( SwPaM& rPaM, pEndPos->GetNode().GetTextNode(), pEndPos->nContent, bGrammarCheck )); - SwNodeOffset nCurrNd = pSttPos->nNode.GetIndex(); - SwNodeOffset nEndNd = pEndPos->nNode.GetIndex(); + SwNodeOffset nCurrNd = pSttPos->GetNodeIndex(); + SwNodeOffset nEndNd = pEndPos->GetNodeIndex(); uno::Any aRet; if( nCurrNd <= nEndNd ) @@ -737,7 +737,7 @@ SwHyphArgs::SwHyphArgs( const SwPaM *pPam, const Point &rCursorPos, "SwDoc::Hyphenate: New York, New York"); const SwPosition *pPoint = pPam->GetPoint(); - m_nNode = pPoint->nNode.GetIndex(); + m_nNode = pPoint->GetNodeIndex(); // Set start m_pStart = pPoint->GetNode().GetTextNode(); @@ -846,8 +846,8 @@ void SwDoc::CountWords( const SwPaM& rPaM, SwDocStat& rStat ) // This is a modified version of SwDoc::TransliterateText auto [pStt, pEnd] = rPaM.StartEnd(); // SwPosition* - const SwNodeOffset nSttNd = pStt->nNode.GetIndex(); - const SwNodeOffset nEndNd = pEnd->nNode.GetIndex(); + const SwNodeOffset nSttNd = pStt->GetNodeIndex(); + const SwNodeOffset nEndNd = pEnd->GetNodeIndex(); const sal_Int32 nSttCnt = pStt->nContent.GetIndex(); const sal_Int32 nEndCnt = pEnd->nContent.GetIndex(); diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 10d8361aeaf7..ddab1366b4a3 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -103,7 +103,7 @@ SetGetExpField::SetGetExpField( const SwSectionNode& rSectNd, if( pPos ) { - m_nNode = pPos->nNode.GetIndex(); + m_nNode = pPos->GetNodeIndex(); m_nContent = pPos->nContent.GetIndex(); } else @@ -123,12 +123,12 @@ SetGetExpField::SetGetExpField(::sw::mark::IBookmark const& rBookmark, if (pPos) { - m_nNode = pPos->nNode.GetIndex(); + m_nNode = pPos->GetNodeIndex(); m_nContent = pPos->nContent.GetIndex(); } else { - m_nNode = rBookmark.GetMarkStart().nNode.GetIndex(); + m_nNode = rBookmark.GetMarkStart().GetNodeIndex(); m_nContent = rBookmark.GetMarkStart().nContent.GetIndex();; } } @@ -162,7 +162,7 @@ SetGetExpField::SetGetExpField( const SwPosition& rPos ) { m_eSetGetExpFieldType = CRSRPOS; m_CNTNT.pPos = &rPos; - m_nNode = rPos.nNode.GetIndex(); + m_nNode = rPos.GetNodeIndex(); m_nContent = rPos.nContent.GetIndex(); } @@ -173,7 +173,7 @@ SetGetExpField::SetGetExpField( const SwFlyFrameFormat& rFlyFormat, m_CNTNT.pFlyFormat = &rFlyFormat; if( pPos ) { - m_nNode = pPos->nNode.GetIndex(); + m_nNode = pPos->GetNodeIndex(); m_nContent = pPos->nContent.GetIndex(); } else @@ -213,7 +213,7 @@ void SetGetExpField::SetBodyPos( const SwContentFrame& rFrame ) SwPosition aPos( aIdx ); bool const bResult = ::GetBodyTextNode( rDoc, aPos, rFrame ); OSL_ENSURE(bResult, "Where is the field?"); - m_nNode = aPos.nNode.GetIndex(); + m_nNode = aPos.GetNodeIndex(); m_nContent = aPos.nContent.GetIndex(); } } diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index d5fc46715b08..8434ebc53355 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -1052,7 +1052,7 @@ SwChainRet SwDoc::Chainable( const SwFrameFormat &rSource, const SwFrameFormat & continue; if ( nullptr == rAnchor.GetContentAnchor() ) continue; - SwNodeOffset nTstSttNd = rAnchor.GetContentAnchor()->nNode.GetIndex(); + SwNodeOffset nTstSttNd = rAnchor.GetContentAnchor()->GetNodeIndex(); if( nFlySttNd <= nTstSttNd && nTstSttNd < nFlySttNd + SwNodeOffset(2) ) { return SwChainRet::NOT_EMPTY; @@ -1073,7 +1073,7 @@ SwChainRet SwDoc::Chainable( const SwFrameFormat &rSource, const SwFrameFormat & { if ( (RndStdIds::FLY_AT_PAGE == rDstAnchor.GetAnchorId()) || ( rDstAnchor.GetContentAnchor() && - rDstAnchor.GetContentAnchor()->nNode.GetIndex() > nEndOfExtras )) + rDstAnchor.GetContentAnchor()->GetNodeIndex() > nEndOfExtras )) bAllowed = true; } else if( rSrcAnchor.GetContentAnchor() && rDstAnchor.GetContentAnchor() ) diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index d9208ff38da6..24ce692c2568 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -234,7 +234,7 @@ void SwDoc::RstTextAttrs(const SwPaM &rRg, bool bInclRefToxMark, pStt, pEnd, pHst, nullptr, pLayout ); aPara.bInclRefToxMark = bInclRefToxMark; aPara.bExactRange = bExactRange; - GetNodes().ForEach( pStt->nNode.GetIndex(), pEnd->nNode.GetIndex()+1, + GetNodes().ForEach( pStt->GetNodeIndex(), pEnd->GetNodeIndex()+1, sw::DocumentContentOperationsManager::lcl_RstTextAttr, &aPara ); getIDocumentState().SetModified(); } @@ -1106,7 +1106,7 @@ bool SwDoc::SetTextFormatColl(const SwPaM &rRg, // #i62675# aPara.bResetListAttrs = bResetListAttrs; - GetNodes().ForEach( pStt->nNode.GetIndex(), pEnd->nNode.GetIndex()+1, + GetNodes().ForEach( pStt->GetNodeIndex(), pEnd->GetNodeIndex()+1, lcl_SetTextFormatColl, &aPara ); if( !aPara.nWhich ) bRet = false; // didn't find a valid Node diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index d9e955619916..cdc13e4284de 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -436,9 +436,9 @@ bool SwDoc::SetCurFootnote( const SwPaM& rPam, const OUString& rNumStr, SwRootFrame* pTmpRoot = getIDocumentLayoutAccess().GetCurrentLayout(); auto [pStt, pEnd] = rPam.StartEnd(); // SwPosition* - const SwNodeOffset nSttNd = pStt->nNode.GetIndex(); + const SwNodeOffset nSttNd = pStt->GetNodeIndex(); const sal_Int32 nSttCnt = pStt->nContent.GetIndex(); - const SwNodeOffset nEndNd = pEnd->nNode.GetIndex(); + const SwNodeOffset nEndNd = pEnd->GetNodeIndex(); const sal_Int32 nEndCnt = pEnd->nContent.GetIndex(); size_t nPos = 0; diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 04acd5a5e121..5c1297a48ccb 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -276,7 +276,7 @@ SwFlyFrameFormat* SwDoc::MakeFlySection_( const SwPosition& rAnchPos, if (GetIDocumentUndoRedo().DoesUndo()) { - SwNodeOffset nNodeIdx = rAnchPos.nNode.GetIndex(); + SwNodeOffset nNodeIdx = rAnchPos.GetNodeIndex(); const sal_Int32 nCntIdx = rAnchPos.nContent.GetIndex(); GetIDocumentUndoRedo().AppendUndo( std::make_unique<SwUndoInsLayFormat>( pFormat, nNodeIdx, nCntIdx )); @@ -469,10 +469,10 @@ static bool lcl_TstFlyRange( const SwPaM* pPam, const SwPosition* pFlyPos, bool bOk = false; const SwPaM* pTmp = pPam; do { - const SwNodeOffset nFlyIndex = pFlyPos->nNode.GetIndex(); + const SwNodeOffset nFlyIndex = pFlyPos->GetNodeIndex(); auto [pPaMStart, pPaMEnd] = pTmp->StartEnd(); // SwPosition* - const SwNodeOffset nPamStartIndex = pPaMStart->nNode.GetIndex(); - const SwNodeOffset nPamEndIndex = pPaMEnd->nNode.GetIndex(); + const SwNodeOffset nPamStartIndex = pPaMStart->GetNodeIndex(); + const SwNodeOffset nPamEndIndex = pPaMEnd->GetNodeIndex(); if (RndStdIds::FLY_AT_PARA == nAnchorId) bOk = (nPamStartIndex < nFlyIndex && nPamEndIndex > nFlyIndex) || (((nPamStartIndex == nFlyIndex) && (pPaMStart->nContent.GetIndex() == 0)) && diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 25efba75a672..a40919ff04cd 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -1197,9 +1197,9 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, sal_uInt16 const nStartPageNu // Update the rsid of each pasted text node SwNodes &rDestNodes = GetNodes(); - SwNodeOffset const nEndIdx = aPaM.End()->nNode.GetIndex(); + SwNodeOffset const nEndIdx = aPaM.End()->GetNodeIndex(); - for (SwNodeOffset nIdx = aPaM.Start()->nNode.GetIndex(); + for (SwNodeOffset nIdx = aPaM.Start()->GetNodeIndex(); nIdx <= nEndIdx; ++nIdx) { SwTextNode *const pTextNode = rDestNodes[nIdx]->GetTextNode(); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index dc9284daa82b..239a534264de 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -454,8 +454,8 @@ bool SwDoc::MoveOutlinePara( const SwPaM& rPam, SwOutlineNodes::difference_type ... etc. - the rest is truncated