diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-19 09:08:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-21 15:25:56 +0200 |
commit | 5f9ffc31cd1b5433c354c7d39ce1d80fa0e57fc8 (patch) | |
tree | 8736f233563535eb3aa5fa019bb92a9970970428 /sw/source/core/text/txtfrm.cxx | |
parent | 81debfba86b1d67d1c2e0ecd9c10ca35c3e7de5e (diff) |
introduce SwNodeOffset strong typedef
for indexing into node children. Replaces various usage
of sal_uLong, tools::Long, sal_uInt32 with an underlying
type of sal_Int32.
Also add a NODE_OFFSET_MAX constant to replace usage
of ULONG_MAX
Change-Id: I2f466922e1ebc19029bb2883d2b29aa4c0614170
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123892
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/text/txtfrm.cxx')
-rw-r--r-- | sw/source/core/text/txtfrm.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index ebc777ee5219..eda5507c1ef7 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -285,15 +285,15 @@ namespace sw { } } - bool FrameContainsNode(SwContentFrame const& rFrame, sal_uLong const nNodeIndex) + bool FrameContainsNode(SwContentFrame const& rFrame, SwNodeOffset const nNodeIndex) { if (rFrame.IsTextFrame()) { SwTextFrame const& rTextFrame(static_cast<SwTextFrame const&>(rFrame)); if (sw::MergedPara const*const pMerged = rTextFrame.GetMergedPara()) { - sal_uLong const nFirst(pMerged->pFirstNode->GetIndex()); - sal_uLong const nLast(pMerged->pLastNode->GetIndex()); + SwNodeOffset const nFirst(pMerged->pFirstNode->GetIndex()); + SwNodeOffset const nLast(pMerged->pLastNode->GetIndex()); return (nFirst <= nNodeIndex && nNodeIndex <= nLast); } else @@ -812,7 +812,7 @@ void RemoveFootnotesForNode( } const SwFootnoteIdxs &rFootnoteIdxs = rTextNode.GetDoc().GetFootnoteIdxs(); size_t nPos = 0; - sal_uLong const nIndex = rTextNode.GetIndex(); + SwNodeOffset const nIndex = rTextNode.GetIndex(); rFootnoteIdxs.SeekEntry( rTextNode, &nPos ); if (nPos < rFootnoteIdxs.size()) { @@ -2116,7 +2116,7 @@ void SwTextFrame::SwClientNotify(SwModify const& rModify, SfxHint const& rHint) && m_pMergedPara->pFirstNode->GetIndex() <= pMoveText->pDestNode->GetIndex() && pMoveText->pDestNode->GetIndex() <= m_pMergedPara->pLastNode->GetIndex()) { // if it's not 2 nodes in merged frame, assume the target node doesn't have frames at all - assert(std::abs(static_cast<tools::Long>(rNode.GetIndex()) - static_cast<tools::Long>(pMoveText->pDestNode->GetIndex())) == 1); + assert(abs(rNode.GetIndex() - pMoveText->pDestNode->GetIndex()) == SwNodeOffset(1)); UpdateMergedParaForMove(*m_pMergedPara, *this, bRecalcFootnoteFlag, @@ -2608,7 +2608,7 @@ void SwTextFrame::SwClientNotify(SwModify const& rModify, SfxHint const& rHint) } // switch if( bSetFieldsDirty ) - GetDoc().getIDocumentFieldsAccess().SetFieldsDirty( true, &rNode, 1 ); + GetDoc().getIDocumentFieldsAccess().SetFieldsDirty( true, &rNode, SwNodeOffset(1) ); if ( bRecalcFootnoteFlag ) CalcFootnoteFlag(); |