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/access/accpara.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/access/accpara.cxx')
-rw-r--r-- | sw/source/core/access/accpara.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 6be041d8c585..9ac2fa8bfc89 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -2968,8 +2968,8 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getSelectedPortionCount( ) { // get SwPosition for my node SwTextFrame const*const pFrame(static_cast<SwTextFrame const*>(GetFrame())); - sal_uLong nFirstNode(pFrame->GetTextNodeFirst()->GetIndex()); - sal_uLong nLastNode; + SwNodeOffset nFirstNode(pFrame->GetTextNodeFirst()->GetIndex()); + SwNodeOffset nLastNode; if (sw::MergedPara const*const pMerged = pFrame->GetMergedPara()) { nLastNode = pMerged->pLastNode->GetIndex(); @@ -2987,9 +2987,9 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getSelectedPortionCount( ) { // check whether frame's node(s) are 'inside' pCursor SwPosition* pStart = rTmpCursor.Start(); - sal_uLong nStartIndex = pStart->nNode.GetIndex(); + SwNodeOffset nStartIndex = pStart->nNode.GetIndex(); SwPosition* pEnd = rTmpCursor.End(); - sal_uLong nEndIndex = pEnd->nNode.GetIndex(); + SwNodeOffset nEndIndex = pEnd->nNode.GetIndex(); if ((nStartIndex <= nLastNode) && (nFirstNode <= nEndIndex)) { nSelected++; @@ -3042,8 +3042,8 @@ sal_Bool SAL_CALL SwAccessibleParagraph::removeSelection( sal_Int32 selectionInd // get SwPosition for my node SwTextFrame const*const pFrame(static_cast<SwTextFrame const*>(GetFrame())); - sal_uLong nFirstNode(pFrame->GetTextNodeFirst()->GetIndex()); - sal_uLong nLastNode; + SwNodeOffset nFirstNode(pFrame->GetTextNodeFirst()->GetIndex()); + SwNodeOffset nLastNode; if (sw::MergedPara const*const pMerged = pFrame->GetMergedPara()) { nLastNode = pMerged->pLastNode->GetIndex(); @@ -3062,9 +3062,9 @@ sal_Bool SAL_CALL SwAccessibleParagraph::removeSelection( sal_Int32 selectionInd { // check whether frame's node(s) are 'inside' pCursor SwPosition* pStart = pCursor->Start(); - sal_uLong nStartIndex = pStart->nNode.GetIndex(); + SwNodeOffset nStartIndex = pStart->nNode.GetIndex(); SwPosition* pEnd = pCursor->End(); - sal_uLong nEndIndex = pEnd->nNode.GetIndex(); + SwNodeOffset nEndIndex = pEnd->nNode.GetIndex(); if ((nStartIndex <= nLastNode) && (nFirstNode <= nEndIndex)) { if( nSelected == 0 ) @@ -3348,8 +3348,8 @@ bool SwAccessibleParagraph::GetSelectionAtIndex( { // get SwPosition for my node SwTextFrame const*const pFrame(static_cast<SwTextFrame const*>(GetFrame())); - sal_uLong nFirstNode(pFrame->GetTextNodeFirst()->GetIndex()); - sal_uLong nLastNode; + SwNodeOffset nFirstNode(pFrame->GetTextNodeFirst()->GetIndex()); + SwNodeOffset nLastNode; if (sw::MergedPara const*const pMerged = pFrame->GetMergedPara()) { nLastNode = pMerged->pLastNode->GetIndex(); @@ -3367,9 +3367,9 @@ bool SwAccessibleParagraph::GetSelectionAtIndex( { // check whether frame's node(s) are 'inside' pCursor SwPosition* pStart = rTmpCursor.Start(); - sal_uLong nStartIndex = pStart->nNode.GetIndex(); + SwNodeOffset nStartIndex = pStart->nNode.GetIndex(); SwPosition* pEnd = rTmpCursor.End(); - sal_uLong nEndIndex = pEnd->nNode.GetIndex(); + SwNodeOffset nEndIndex = pEnd->nNode.GetIndex(); if ((nStartIndex <= nLastNode) && (nFirstNode <= nEndIndex)) { if (!pSelection || *pSelection == 0) |