summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-08-20 13:59:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-08-20 14:42:50 +0200
commit2533faa1dcb5c2319f05992380cff0d3dc317b11 (patch)
tree2214f717e2dd68898edba4ac8b09fafdf65835c3
parentc8f905fda1da4a3a58ab9bf4930cfaa7b7a04640 (diff)
use more SwPosition::GetNode
Change-Id: Ib09191384e0ae3175a564edf9387e4de00ce851d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138583 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/core/unocore/unoframe.cxx2
-rw-r--r--sw/source/core/unocore/unoportenum.cxx4
-rw-r--r--sw/source/core/unocore/unotext.cxx20
-rw-r--r--sw/source/filter/ascii/parasc.cxx2
-rw-r--r--sw/source/filter/basflt/shellio.cxx2
-rw-r--r--sw/source/filter/html/htmlgrin.cxx2
-rw-r--r--sw/source/filter/html/htmltab.cxx6
7 files changed, 19 insertions, 19 deletions
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index dacfa4114b3f..6a1460beca63 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -2703,7 +2703,7 @@ uno::Reference< text::XTextRange > SwXFrame::getAnchor()
const SwPosition &rPos = *(rAnchor.GetContentAnchor());
if (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA)
{ // ensure that SwXTextRange has SwContentIndex
- aRef = SwXTextRange::CreateXTextRange(*pFormat->GetDoc(), SwPosition(rPos.nNode), nullptr);
+ aRef = SwXTextRange::CreateXTextRange(*pFormat->GetDoc(), SwPosition(rPos.GetNode()), nullptr);
}
else
{
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index a30a492afd0c..a74d95437c65 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -248,7 +248,7 @@ namespace
pMarkAccess->findFirstAnnotationStartsAfter(aEndOfPara);
// search for all annotation marks that have its start position in this paragraph
- const SwNodeIndex nOwnNode = rUnoCursor.GetPoint()->nNode;
+ const SwNode& rOwnNode = rUnoCursor.GetPoint()->GetNode();
for( IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getAnnotationMarksBegin();
ppMark != pCandidatesEnd;
++ppMark )
@@ -260,7 +260,7 @@ namespace
continue;
const SwPosition& rStartPos = pAnnotationMark->GetMarkStart();
- if (rStartPos.nNode != nOwnNode)
+ if (rStartPos.GetNode() != rOwnNode)
continue;
const SwFormatField* pAnnotationFormatField = pAnnotationMark->GetAnnotationFormatField();
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index b3f91651bcc9..b2822157407e 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1160,13 +1160,13 @@ SwXText::getPropertyValue(
if (nRedTableCount > 0)
{
SwStartNode const*const pStartNode = GetStartNode();
- const SwNodeOffset nOwnIndex = pStartNode->EndOfSectionIndex();
+ const SwNode& rOwnIndex = *pStartNode->EndOfSectionNode();
for (size_t nRed = 0; nRed < nRedTableCount; ++nRed)
{
SwRangeRedline const*const pRedline = rRedTable[nRed];
SwPosition const*const pRedStart = pRedline->Start();
- const SwNodeIndex nRedNode = pRedStart->nNode;
- if (nOwnIndex == nRedNode.GetIndex())
+ const SwNode& rRedNode = pRedStart->GetNode();
+ if (rOwnIndex == rRedNode)
{
aRet <<= SwXRedlinePortion::CreateRedlineProperties(
*pRedline, true);
@@ -1718,8 +1718,8 @@ SwXText::convertToTextFrame(
// added nodes
if (!isGraphicNode(pFrameFormat)
&& ( (RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()
- && ( oAnchorCheckPam->Start()->nNode.GetIndex() == rAnchor.GetContentAnchor()->nNode.GetIndex()
- || oAnchorCheckPam->End()->nNode.GetIndex() == rAnchor.GetContentAnchor()->nNode.GetIndex()))
+ && ( oAnchorCheckPam->Start()->GetNode() == rAnchor.GetContentAnchor()->GetNode()
+ || oAnchorCheckPam->End()->GetNode() == rAnchor.GetContentAnchor()->GetNode()))
|| (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId()
&& ( *oAnchorCheckPam->Start() == *rAnchor.GetContentAnchor()
|| *oAnchorCheckPam->End() == *rAnchor.GetContentAnchor()))))
@@ -1923,8 +1923,8 @@ void SwXText::Impl::ConvertCell(
uno::Reference< text::XTextCopy >( &m_rThis ), sal_Int16( 2 ) );
}
- SwNodeRange aTmpRange(aStartCellPam.Start()->nNode,
- aEndCellPam.End()->nNode);
+ SwNodeRange aTmpRange(aStartCellPam.Start()->GetNode(),
+ aEndCellPam.End()->GetNode());
std::optional<SwNodeRange> oCorrectedRange;
m_pDoc->GetNodes().ExpandRangeForTableBox(aTmpRange, oCorrectedRange);
@@ -1952,7 +1952,7 @@ void SwXText::Impl::ConvertCell(
// increment on each StartNode and decrement on each EndNode
// we must reach zero at the end and must not go below zero
tools::Long nOpenNodeBlock = 0;
- SwNodeIndex aCellIndex = aStartCellPam.Start()->nNode;
+ SwNodeIndex aCellIndex(aStartCellPam.Start()->GetNode());
while (aCellIndex < aEndCellPam.End()->GetNodeIndex())
{
if (aCellIndex.GetNode().IsStartNode())
@@ -2051,8 +2051,8 @@ void SwXText::Impl::ConvertCell(
assert(aStartCellPam.Start()->GetContentIndex() == 0);
assert(aEndCellPam.End()->GetContentIndex() == aEndCellPam.End()->GetNode().GetTextNode()->Len());
- SwNodeRange aCellRange(aStartCellPam.Start()->nNode,
- aEndCellPam.End()->nNode);
+ SwNodeRange aCellRange(aStartCellPam.Start()->GetNode(),
+ aEndCellPam.End()->GetNode());
rRowNodes.push_back(aCellRange); // note: invalidates pLastCell!
// tdf#149649 delete any fieldmarks overlapping the cell
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index 0b05173369ff..b29251bcbd8b 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -160,7 +160,7 @@ ErrCode SwASCIIParser::CallParser()
sal_Int32 nSttContent = 0;
if (!m_bNewDoc)
{
- const SwNodeIndex& rTmp = m_oPam->GetPoint()->nNode;
+ const SwNode& rTmp = m_oPam->GetPoint()->GetNode();
pInsPam.emplace( rTmp, rTmp, SwNodeOffset(0), SwNodeOffset(-1) );
nSttContent = m_oPam->GetPoint()->GetContentIndex();
}
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index 9c37a082cf58..cf45397a58de 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -169,7 +169,7 @@ ErrCode SwReader::Read( const Reader& rOptions )
if( bDocUndo || mpCursor )
{
// set Pam to the previous node, so that it is not also moved
- const SwNodeIndex& rTmp = pPam->GetPoint()->nNode;
+ const SwNode& rTmp = pPam->GetPoint()->GetNode();
pUndoPam.emplace( rTmp, rTmp, SwNodeOffset(0), SwNodeOffset(-1) );
}
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 4f9572d93dae..9d0ee1011427 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -851,7 +851,7 @@ IMAGE_SETEVENT:
if ((RndStdIds::FLY_AS_CHAR == pFlyFormat->GetAnchor().GetAnchorId()) &&
m_xAttrTab->pINetFormat->GetStartParagraph() ==
- m_pPam->GetPoint()->nNode &&
+ m_pPam->GetPoint()->GetNode() &&
m_xAttrTab->pINetFormat->GetStartContent() ==
m_pPam->GetPoint()->GetContentIndex() - 1 )
{
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 5d3d56dec7e7..c0ec29da8e4d 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -3159,7 +3159,7 @@ std::unique_ptr<HTMLTableCnts> SwHTMLParser::InsertTableContents(
}
// Reset attributation start
- const SwNodeIndex& rSttPara = m_pPam->GetPoint()->nNode;
+ const SwNode& rSttPara = m_pPam->GetPoint()->GetNode();
sal_Int32 nSttCnt = m_pPam->GetPoint()->GetContentIndex();
HTMLAttr** pHTMLAttributes = reinterpret_cast<HTMLAttr**>(m_xAttrTab.get());
@@ -3843,7 +3843,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
{
HTMLTableContext* pTableContext = m_xTable ? m_xTable->GetContext() : nullptr;
SwPosition* pSavedPos = pTableContext ? pTableContext->GetPos() : nullptr;
- const bool bDeleteSafe = !pSavedPos || pSavedPos->nNode != m_pPam->GetPoint()->GetNode();
+ const bool bDeleteSafe = !pSavedPos || pSavedPos->GetNode() != m_pPam->GetPoint()->GetNode();
if (bDeleteSafe)
StripTrailingPara();
}
@@ -4926,7 +4926,7 @@ void SwHTMLParser::ClearFootnotesMarksInRange(const SwNodeIndex& rMkNdIdx, const
(rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR)) &&
( rMkNdIdx < pAPos->GetNode() && pAPos->GetNode() <= rPtNdIdx.GetNode() ))
{
- if( rPtNdIdx != pAPos->nNode )
+ if( rPtNdIdx != pAPos->GetNode() )
{
// If the Fly is deleted, all Flys in its content have to be deleted too.
const SwFormatContent &rContent = pFormat->GetContent();