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/filter/html | |
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/filter/html')
-rw-r--r-- | sw/source/filter/html/htmlatr.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmlfld.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmlflywriter.cxx | 26 | ||||
-rw-r--r-- | sw/source/filter/html/htmlforw.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/html/htmlnumwriter.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/htmlplug.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmlsect.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmltab.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/html/htmltabw.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 18 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.hxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.cxx | 30 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.hxx | 10 |
14 files changed, 71 insertions, 71 deletions
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index ae2e4bb69611..856148d9e115 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -2120,7 +2120,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode ) 40 == static_cast<const SvxFontHeightItem *>(pItem)->GetHeight() ) { // ... moreover, the 2pt font is set ... - sal_uLong nNdPos = rWrt.m_pCurrentPam->GetPoint()->nNode.GetIndex(); + SwNodeOffset nNdPos = rWrt.m_pCurrentPam->GetPoint()->nNode.GetIndex(); const SwNode *pNextNd = rWrt.m_pDoc->GetNodes()[nNdPos+1]; const SwNode *pPrevNd = rWrt.m_pDoc->GetNodes()[nNdPos-1]; bool bStdColl = nPoolId == RES_POOLCOLL_STANDARD; diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx index 001e8bca5dd5..6677b620f8d9 100644 --- a/sw/source/filter/html/htmlfld.cxx +++ b/sw/source/filter/html/htmlfld.cxx @@ -617,7 +617,7 @@ void SwHTMLParser::InsertComment( const OUString& rComment, const char *pTag ) { bMoveFwd = true; - sal_uLong nNodeIdx = m_pPam->GetPoint()->nNode.GetIndex(); + SwNodeOffset nNodeIdx = m_pPam->GetPoint()->nNode.GetIndex(); const sal_Int32 nIdx = m_pPam->GetPoint()->nContent.GetIndex(); for( auto i = m_aSetAttrTab.size(); i > 0; ) { diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index fc7bf6edbc80..73ab34c60616 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -194,7 +194,7 @@ sal_uInt16 SwHTMLWriter::GuessFrameType( const SwFrameFormat& rFrameFormat, eType = HTML_FRMTYPE_TEXT; const SwFormatContent& rFlyContent = rFrameFormat.GetContent(); - sal_uLong nStt = rFlyContent.GetContentIdx()->GetIndex()+1; + SwNodeOffset nStt = rFlyContent.GetContentIdx()->GetIndex()+1; const SwNode* pNd = m_pDoc->GetNodes()[ nStt ]; if( pNd->IsGrfNode() ) @@ -209,7 +209,7 @@ sal_uInt16 SwHTMLWriter::GuessFrameType( const SwFrameFormat& rFrameFormat, } else { - sal_uLong nEnd = m_pDoc->GetNodes()[nStt-1]->EndOfSectionIndex(); + SwNodeOffset nEnd = m_pDoc->GetNodes()[nStt-1]->EndOfSectionIndex(); const SfxPoolItem* pItem; const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet(); @@ -223,7 +223,7 @@ sal_uInt16 SwHTMLWriter::GuessFrameType( const SwFrameFormat& rFrameFormat, else if( pNd->IsTableNode() ) { const SwTableNode *pTableNd = pNd->GetTableNode(); - sal_uLong nTableEnd = pTableNd->EndOfSectionIndex(); + SwNodeOffset nTableEnd = pTableNd->EndOfSectionIndex(); if( nTableEnd+1 == nEnd ) { @@ -250,7 +250,7 @@ sal_uInt16 SwHTMLWriter::GuessFrameType( const SwFrameFormat& rFrameFormat, { for( auto & pHTMLPosFlyFrame : *m_pHTMLPosFlyFrames ) { - sal_uLong nIdx = pHTMLPosFlyFrame->GetNdIndex().GetIndex(); + SwNodeOffset nIdx = pHTMLPosFlyFrame->GetNdIndex().GetIndex(); bEmpty = (nIdx != nStt) && (nIdx != nStt-1); if( !bEmpty || nIdx > nStt ) break; @@ -355,7 +355,7 @@ void SwHTMLWriter::CollectFlyFrames() } } -bool SwHTMLWriter::OutFlyFrame( sal_uLong nNdIdx, sal_Int32 nContentIdx, HtmlPosition nPos, +bool SwHTMLWriter::OutFlyFrame( SwNodeOffset nNdIdx, sal_Int32 nContentIdx, HtmlPosition nPos, HTMLOutContext *pContext ) { bool bFlysLeft = false; // Are there still Flys left at the current node position? @@ -1540,8 +1540,8 @@ static Writer& OutHTML_FrameFormatTableNode( Writer& rWrt, const SwFrameFormat& SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); const SwFormatContent& rFlyContent = rFrameFormat.GetContent(); - sal_uLong nStt = rFlyContent.GetContentIdx()->GetIndex()+1; - sal_uLong nEnd = rHTMLWrt.m_pDoc->GetNodes()[nStt-1]->EndOfSectionIndex(); + SwNodeOffset nStt = rFlyContent.GetContentIdx()->GetIndex()+1; + SwNodeOffset nEnd = rHTMLWrt.m_pDoc->GetNodes()[nStt-1]->EndOfSectionIndex(); OUString aCaption; bool bTopCaption = false; @@ -1559,7 +1559,7 @@ static Writer& OutHTML_FrameFormatTableNode( Writer& rWrt, const SwFrameFormat& OSL_ENSURE( pTableNd, "Frame does not contain a table" ); if( pTableNd ) { - sal_uLong nTableEnd = pTableNd->EndOfSectionIndex(); + SwNodeOffset nTableEnd = pTableNd->EndOfSectionIndex(); OSL_ENSURE( nTableEnd == nEnd - 1 || (nTableEnd == nEnd - 2 && !bTopCaption), "Invalid frame content for a table" ); @@ -1641,7 +1641,7 @@ static Writer & OutHTML_FrameFormatAsMulticol( Writer& rWrt, rHTMLWrt.IncIndentLevel(); // indent the content of Multicol const SwFormatContent& rFlyContent = rFrameFormat.GetContent(); - sal_uLong nStt = rFlyContent.GetContentIdx()->GetIndex(); + SwNodeOffset nStt = rFlyContent.GetContentIdx()->GetIndex(); const SwStartNode* pSttNd = rWrt.m_pDoc->GetNodes()[nStt]->GetStartNode(); OSL_ENSURE( pSttNd, "Where is the start node" ); @@ -1724,7 +1724,7 @@ static Writer& OutHTML_FrameFormatAsDivOrSpan( Writer& rWrt, rHTMLWrt.m_bLFPossible = true; const SwFormatContent& rFlyContent = rFrameFormat.GetContent(); - sal_uLong nStt = rFlyContent.GetContentIdx()->GetIndex(); + SwNodeOffset nStt = rFlyContent.GetContentIdx()->GetIndex(); // Output frame-anchored frames that are anchored to the start node rHTMLWrt.OutFlyFrame( nStt, 0, HtmlPosition::Any ); @@ -1899,7 +1899,7 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rF return rWrt; const SwFormatContent& rFlyContent = rFrameFormat.GetContent(); - sal_uLong nStt = rFlyContent.GetContentIdx()->GetIndex()+1; + SwNodeOffset nStt = rFlyContent.GetContentIdx()->GetIndex()+1; SwGrfNode *pGrfNd = rHTMLWrt.m_pDoc->GetNodes()[ nStt ]->GetGrfNode(); OSL_ENSURE( pGrfNd, "Grf node expected" ); if( !pGrfNd ) @@ -2097,7 +2097,7 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrameFormat& rFrameFormat, } const SwFormatContent& rFlyContent = rFrameFormat.GetContent(); - sal_uLong nStt = rFlyContent.GetContentIdx()->GetIndex(); + SwNodeOffset nStt = rFlyContent.GetContentIdx()->GetIndex(); const SwStartNode* pSttNd = rWrt.m_pDoc->GetNodes()[nStt]->GetStartNode(); OSL_ENSURE( pSttNd, "Where is the start node" ); @@ -2199,7 +2199,7 @@ void SwHTMLWriter::AddLinkTarget( const OUString& rURL ) SwPosition aPos( *m_pCurrentPam->GetPoint() ); if( m_pDoc->GotoOutline( aPos, aOutline ) ) { - sal_uInt32 nIdx = aPos.nNode.GetIndex(); + SwNodeOffset nIdx = aPos.nNode.GetIndex(); decltype(m_aOutlineMarkPoss)::size_type nIns=0; while( nIns < m_aOutlineMarkPoss.size() && diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index 3e30352f326b..eaf475ceb603 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -214,7 +214,7 @@ static bool lcl_html_isHTMLControl( sal_Int16 nClassId ) bool SwHTMLWriter::HasControls() const { - sal_uInt32 nStartIdx = m_pCurrentPam->GetPoint()->nNode.GetIndex(); + SwNodeOffset nStartIdx = m_pCurrentPam->GetPoint()->nNode.GetIndex(); size_t i = 0; // Skip all controls in front of the current paragraph @@ -242,7 +242,7 @@ void SwHTMLWriter::OutForm( bool bTag_On, const SwStartNode *pStartNd ) } uno::Reference< container::XIndexContainer > xNewFormComps; - sal_uInt32 nStartIdx = pStartNd ? pStartNd->GetIndex() + SwNodeOffset nStartIdx = pStartNd ? pStartNd->GetIndex() : m_pCurrentPam->GetPoint()->nNode.GetIndex(); // skip controls before the interesting area @@ -267,7 +267,7 @@ void SwHTMLWriter::OutForm( bool bTag_On, const SwStartNode *pStartNd ) uno::Reference< container::XIndexContainer > xCurrentFormComps;// current form in table const SwStartNode *pCurrentStNd = nullptr; // and the start node of a Control sal_Int32 nCurrentCtrls = 0; // and the found controls in it - sal_uInt32 nEndIdx = pStartNd->EndOfSectionIndex(); + SwNodeOffset nEndIdx = pStartNd->EndOfSectionIndex(); for( ; i < m_aHTMLControls.size() && m_aHTMLControls[i]->nNdIdx <= nEndIdx; i++ ) { @@ -1282,7 +1282,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, */ static void AddControl( HTMLControls& rControls, const SdrUnoObj& rFormObj, - sal_uInt32 nNodeIdx ) + SwNodeOffset nNodeIdx ) { const uno::Reference< awt::XControlModel >& xControlModel = rFormObj.GetUnoControlModel(); @@ -1358,7 +1358,7 @@ void SwHTMLWriter::GetControls() HTMLControl::HTMLControl( const uno::Reference< container::XIndexContainer > & rFormComps, - sal_uInt32 nIdx ) : + SwNodeOffset nIdx ) : xFormComps( rFormComps ), nNdIdx( nIdx ), nCount( 1 ) {} diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 592475dfa3cd..5c47810c4c59 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -113,8 +113,8 @@ void SwHTMLParser::ConnectImageMaps() { SwNodes& rNds = m_xDoc->GetNodes(); // on the first node of section #1 - sal_uLong nIdx = rNds.GetEndOfAutotext().StartOfSectionIndex() + 1; - sal_uLong nEndIdx = rNds.GetEndOfAutotext().GetIndex(); + SwNodeOffset nIdx = rNds.GetEndOfAutotext().StartOfSectionIndex() + 1; + SwNodeOffset nEndIdx = rNds.GetEndOfAutotext().GetIndex(); SwGrfNode* pGrfNd; while( m_nMissingImgMaps > 0 && nIdx < nEndIdx ) @@ -1357,7 +1357,7 @@ void SwHTMLParser::InsertBookmark( const OUString& rName ) bool SwHTMLParser::HasCurrentParaBookmarks( bool bIgnoreStack ) const { bool bHasMarks = false; - sal_uLong nNodeIdx = m_pPam->GetPoint()->nNode.GetIndex(); + SwNodeOffset nNodeIdx = m_pPam->GetPoint()->nNode.GetIndex(); // first step: are there still bookmark in the attribute-stack? // bookmarks are added to the end of the stack - thus we only have @@ -1386,7 +1386,7 @@ bool SwHTMLParser::HasCurrentParaBookmarks( bool bIgnoreStack ) const { const ::sw::mark::IMark* pBookmark = *ppMark; - const sal_uLong nBookNdIdx = pBookmark->GetMarkPos().nNode.GetIndex(); + const SwNodeOffset nBookNdIdx = pBookmark->GetMarkPos().nNode.GetIndex(); if( nBookNdIdx==nNodeIdx ) { bHasMarks = true; @@ -1407,7 +1407,7 @@ void SwHTMLParser::StripTrailingPara() bool bSetSmallFont = false; SwContentNode* pCNd = m_pPam->GetContentNode(); - sal_uLong nNodeIdx = m_pPam->GetPoint()->nNode.GetIndex(); + SwNodeOffset nNodeIdx = m_pPam->GetPoint()->nNode.GetIndex(); if( !m_pPam->GetPoint()->nContent.GetIndex() ) { if( pCNd && pCNd->StartOfSectionIndex() + 2 < @@ -1451,7 +1451,7 @@ void SwHTMLParser::StripTrailingPara() { ::sw::mark::IMark* pMark = *ppMark; - sal_uLong nBookNdIdx = pMark->GetMarkPos().nNode.GetIndex(); + SwNodeOffset nBookNdIdx = pMark->GetMarkPos().nNode.GetIndex(); if(nBookNdIdx==nNodeIdx) { SwNodeIndex nNewNdIdx(m_pPam->GetPoint()->nNode); diff --git a/sw/source/filter/html/htmlnumwriter.cxx b/sw/source/filter/html/htmlnumwriter.cxx index 7fe8ec110661..7df3402dda35 100644 --- a/sw/source/filter/html/htmlnumwriter.cxx +++ b/sw/source/filter/html/htmlnumwriter.cxx @@ -37,7 +37,7 @@ void SwHTMLWriter::FillNextNumInfo() { m_pNextNumRuleInfo = nullptr; - sal_uLong nPos = m_pCurrentPam->GetPoint()->nNode.GetIndex() + 1; + SwNodeOffset nPos = m_pCurrentPam->GetPoint()->nNode.GetIndex() + 1; bool bTable = false; do @@ -98,7 +98,7 @@ Writer& OutHTML_NumberBulletListStart( SwHTMLWriter& rWrt, { // If the list only consists of non-numbered text nodes, then don't start the list. bool bAtLeastOneNumbered = false; - sal_uLong nPos = rWrt.m_pCurrentPam->GetPoint()->nNode.GetIndex() + 1; + SwNodeOffset nPos = rWrt.m_pCurrentPam->GetPoint()->nNode.GetIndex() + 1; SwNumRule* pNumRule = nullptr; while (true) { @@ -147,7 +147,7 @@ Writer& OutHTML_NumberBulletListStart( SwHTMLWriter& rWrt, bStartValue = true; if( rInfo.GetDepth() > 1 ) { - sal_uLong nPos = + SwNodeOffset nPos = rWrt.m_pCurrentPam->GetPoint()->nNode.GetIndex() + 1; do { @@ -340,7 +340,7 @@ Writer& OutHTML_NumberBulletListEnd( SwHTMLWriter& rWrt, { // If the list only consisted of non-numbered text nodes, then don't end the list. bool bAtLeastOneNumbered = false; - sal_uLong nPos = rWrt.m_pCurrentPam->GetPoint()->nNode.GetIndex() - 1; + SwNodeOffset nPos = rWrt.m_pCurrentPam->GetPoint()->nNode.GetIndex() - 1; SwNumRule* pNumRule = nullptr; while (true) { diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index cc10834228e9..fdd7bd675954 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -1195,7 +1195,7 @@ Writer& OutHTML_FrameFormatOLENode( Writer& rWrt, const SwFrameFormat& rFrameFor SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); const SwFormatContent& rFlyContent = rFrameFormat.GetContent(); - sal_uLong nStt = rFlyContent.GetContentIdx()->GetIndex()+1; + SwNodeOffset nStt = rFlyContent.GetContentIdx()->GetIndex()+1; SwOLENode *pOLENd = rHTMLWrt.m_pDoc->GetNodes()[ nStt ]->GetOLENode(); OSL_ENSURE( pOLENd, "OLE-Node expected" ); @@ -1457,7 +1457,7 @@ Writer& OutHTML_FrameFormatOLENodeGrf( Writer& rWrt, const SwFrameFormat& rFrame SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); const SwFormatContent& rFlyContent = rFrameFormat.GetContent(); - sal_uLong nStt = rFlyContent.GetContentIdx()->GetIndex()+1; + SwNodeOffset nStt = rFlyContent.GetContentIdx()->GetIndex()+1; SwOLENode *pOLENd = rHTMLWrt.m_pDoc->GetNodes()[ nStt ]->GetOLENode(); OSL_ENSURE( pOLENd, "OLE-Node expected" ); diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index 99600517a0d4..9b212c0c5f4b 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -436,7 +436,7 @@ void SwHTMLParser::FixHeaderFooterDistance( bool bHeader, const SwFormatContent& rFlyContent = pHdFtFormat->GetContent(); const SwNodeIndex& rContentStIdx = *rFlyContent.GetContentIdx(); - sal_uLong nPrvNxtIdx; + SwNodeOffset nPrvNxtIdx; if( bHeader ) { nPrvNxtIdx = rContentStIdx.GetNode().EndOfSectionIndex()-1; @@ -794,7 +794,7 @@ void SwHTMLParser::InsertFlyFrame( const SfxItemSet& rItemSet, } void SwHTMLParser::MovePageDescAttrs( SwNode *pSrcNd, - sal_uLong nDestIdx, + SwNodeOffset nDestIdx, bool bFormatBreak ) { SwContentNode* pDestContentNd = diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index cbba52c6f119..7f39463b0fd6 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -5126,11 +5126,11 @@ std::shared_ptr<HTMLTable> SwHTMLParser::BuildTable(SvxAdjust eParentAdjust, // The last paragraph of the section is never part of the copy. // That's why the section needs to contain at least two paragraphs - if( pCapStNd->EndOfSectionIndex() - pCapStNd->GetIndex() > 2 ) + if( pCapStNd->EndOfSectionIndex() - pCapStNd->GetIndex() > SwNodeOffset(2) ) { // Don't copy start node and the last paragraph - SwNodeRange aSrcRg( *pCapStNd, 1, - *pCapStNd->EndOfSectionNode(), -1 ); + SwNodeRange aSrcRg( *pCapStNd, SwNodeOffset(1), + *pCapStNd->EndOfSectionNode(), SwNodeOffset(-1) ); bool bTop = m_xTable->IsTopCaption(); SwStartNode *pTableStNd = pTCntxt->GetTableNode(); diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx index c083af828ba2..de0501203a92 100644 --- a/sw/source/filter/html/htmltabw.cxx +++ b/sw/source/filter/html/htmltabw.cxx @@ -269,7 +269,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt, bool bHead = false; if( pSttNd ) { - sal_uLong nNdPos = pSttNd->GetIndex()+1; + SwNodeOffset nNdPos = pSttNd->GetIndex()+1; // determine the type of cell (TD/TH) SwNode* pNd; diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 25627a3f2d82..7250fb8e841d 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -610,7 +610,7 @@ SvParserState SwHTMLParser::CallParser() return eRet; } -bool SwHTMLParser::CanRemoveNode(sal_uLong nNodeIdx) const +bool SwHTMLParser::CanRemoveNode(SwNodeOffset nNodeIdx) const { const SwNode *pPrev = m_xDoc->GetNodes()[nNodeIdx - 1]; return pPrev->IsContentNode() || (pPrev->IsEndNode() && pPrev->StartOfSectionNode()->IsSectionNode()); @@ -805,7 +805,7 @@ void SwHTMLParser::Continue( HtmlTokenId nToken ) if( !pPos->nContent.GetIndex() && !bLFStripped ) { SwTextNode* pCurrentNd; - sal_uLong nNodeIdx = pPos->nNode.GetIndex(); + SwNodeOffset nNodeIdx = pPos->nNode.GetIndex(); bool bHasFlysOrMarks = HasCurrentParaFlys() || HasCurrentParaBookmarks( true ); @@ -2497,7 +2497,7 @@ void SwHTMLParser::AddParSpace() m_bNoParSpace = false; - sal_uLong nNdIdx = m_pPam->GetPoint()->nNode.GetIndex() - 1; + SwNodeOffset nNdIdx = m_pPam->GetPoint()->nNode.GetIndex() - 1; SwTextNode *pTextNode = m_xDoc->GetNodes()[nNdIdx]->GetTextNode(); if( !pTextNode ) @@ -2758,7 +2758,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, pAttr = m_aSetAttrTab[ --n ]; sal_uInt16 nWhich = pAttr->m_pItem->Which(); - sal_uLong nEndParaIdx = pAttr->GetEndParagraphIdx(); + SwNodeOffset nEndParaIdx = pAttr->GetEndParagraphIdx(); bool bSetAttr; if( bChkEnd ) { @@ -2782,7 +2782,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, { // Attributes in body nodes array section shouldn't be set if we are in a // special nodes array section, but vice versa it's possible. - sal_uLong nEndOfIcons = m_xDoc->GetNodes().GetEndOfExtras().GetIndex(); + SwNodeOffset nEndOfIcons = m_xDoc->GetNodes().GetEndOfExtras().GetIndex(); bSetAttr = nEndParaIdx < rEndIdx.GetIndex() || rEndIdx.GetIndex() > nEndOfIcons || nEndParaIdx <= nEndOfIcons; @@ -3014,7 +3014,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, OSL_ENSURE( RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId(), "Only At-Para flys need special handling" ); const SwPosition *pFlyPos = rAnchor.GetContentAnchor(); - sal_uLong nFlyParaIdx = pFlyPos->nNode.GetIndex(); + SwNodeOffset nFlyParaIdx = pFlyPos->nNode.GetIndex(); bool bMoveFly; if( bChkEnd ) { @@ -3024,7 +3024,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, } else { - sal_uLong nEndOfIcons = m_xDoc->GetNodes().GetEndOfExtras().GetIndex(); + SwNodeOffset nEndOfIcons = m_xDoc->GetNodes().GetEndOfExtras().GetIndex(); bMoveFly = nFlyParaIdx < rEndIdx.GetIndex() || rEndIdx.GetIndex() > nEndOfIcons || nFlyParaIdx <= nEndOfIcons; @@ -3366,8 +3366,8 @@ void SwHTMLParser::SplitAttrTab( std::shared_ptr<HTMLAttrTable> const & rNewAttr if( bMoveEndBack ) { - sal_uLong nOldEnd = nEndIdx.GetIndex(); - sal_uLong nTmpIdx; + SwNodeOffset nOldEnd = nEndIdx.GetIndex(); + SwNodeOffset nTmpIdx; if( ( nTmpIdx = m_xDoc->GetNodes().GetEndOfExtras().GetIndex()) >= nOldEnd || ( nTmpIdx = m_xDoc->GetNodes().GetEndOfAutotext().GetIndex()) >= nOldEnd ) { diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index 6ed83640bad5..023a796b5f5c 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -157,8 +157,8 @@ public: HTMLAttr **pHd, const std::shared_ptr<HTMLAttrTable>& rAttrTab ); inline void SetStart( const SwPosition& rPos ); - sal_uInt32 GetStartParagraphIdx() const { return m_nStartPara.GetIndex(); } - sal_uInt32 GetEndParagraphIdx() const { return m_nEndPara.GetIndex(); } + SwNodeOffset GetStartParagraphIdx() const { return m_nStartPara.GetIndex(); } + SwNodeOffset GetEndParagraphIdx() const { return m_nEndPara.GetIndex(); } const SwNodeIndex& GetStartParagraph() const { return m_nStartPara; } const SwNodeIndex& GetEndParagraph() const { return m_nEndPara; } @@ -584,7 +584,7 @@ class SwHTMLParser : public SfxHTMLParser, public SvtListener short& nIndent ) const; void GetULSpaceFromContext( sal_uInt16 &rUpper, sal_uInt16 &rLower ) const; - void MovePageDescAttrs( SwNode *pSrcNd, sal_uLong nDestIdx, bool bFormatBreak ); + void MovePageDescAttrs( SwNode *pSrcNd, SwNodeOffset nDestIdx, bool bFormatBreak ); // Handling of tags at paragraph level @@ -868,7 +868,7 @@ private: // Remove empty paragraph at the PaM position void StripTrailingPara(); // If removing an empty node would corrupt the document - bool CanRemoveNode(sal_uLong nNodeIdx) const; + bool CanRemoveNode(SwNodeOffset nNodeIdx) const; // Are there fly frames in the current paragraph? bool HasCurrentParaFlys( bool bNoSurroundOnly = false, diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index a329b5c74f89..db4a0baad396 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -350,7 +350,7 @@ ErrCode SwHTMLWriter::WriteStream() } if( m_bShowProgress ) - ::StartProgress( STR_STATSTR_W4WWRITE, 0, m_pDoc->GetNodes().Count(), + ::StartProgress( STR_STATSTR_W4WWRITE, 0, sal_Int32(m_pDoc->GetNodes().Count()), m_pDoc->GetDocShell()); m_xDfltColor.reset(); @@ -588,7 +588,7 @@ static const SwFormatCol *lcl_html_GetFormatCol( const SwSection& rSection, return pCol; } -static bool lcl_html_IsMultiColStart( const SwHTMLWriter& rHTMLWrt, sal_uLong nIndex ) +static bool lcl_html_IsMultiColStart( const SwHTMLWriter& rHTMLWrt, SwNodeOffset nIndex ) { bool bRet = false; const SwSectionNode *pSectNd = @@ -604,7 +604,7 @@ static bool lcl_html_IsMultiColStart( const SwHTMLWriter& rHTMLWrt, sal_uLong nI return bRet; } -static bool lcl_html_IsMultiColEnd( const SwHTMLWriter& rHTMLWrt, sal_uLong nIndex ) +static bool lcl_html_IsMultiColEnd( const SwHTMLWriter& rHTMLWrt, SwNodeOffset nIndex ) { bool bRet = false; const SwEndNode *pEndNd = rHTMLWrt.m_pDoc->GetNodes()[nIndex]->GetEndNode(); @@ -743,8 +743,8 @@ static Writer& OutHTML_Section( Writer& rWrt, const SwSectionNode& rSectNd ) const SwSection *pSurrSection = nullptr; const SwFormatCol *pSurrCol = nullptr; - sal_uInt32 nSectSttIdx = rSectNd.GetIndex(); - sal_uInt32 nSectEndIdx = rSectNd.EndOfSectionIndex(); + SwNodeOffset nSectSttIdx = rSectNd.GetIndex(); + SwNodeOffset nSectEndIdx = rSectNd.EndOfSectionIndex(); const SwFormatCol *pCol = lcl_html_GetFormatCol( rSection, *pFormat ); if( pCol ) { @@ -781,7 +781,7 @@ static Writer& OutHTML_Section( Writer& rWrt, const SwSectionNode& rSectNd ) // The surrounding section must be closed before the current one is // opened, except that it start immediately before the current one or // another end immediately before the current one - if( pSurrCol && nSectSttIdx - pSurrSectNd->GetIndex() > 1 && + if( pSurrCol && nSectSttIdx - pSurrSectNd->GetIndex() > SwNodeOffset(1) && !lcl_html_IsMultiColEnd( rHTMLWrt, nSectSttIdx-1 ) ) lcl_html_OutSectionEndTag( rHTMLWrt ); @@ -804,7 +804,7 @@ static Writer& OutHTML_Section( Writer& rWrt, const SwSectionNode& rSectNd ) // The surrounding section must be started again, except that it ends // immediately behind the current one. if( pSurrCol && - pSurrSectNd->EndOfSectionIndex() - nSectEndIdx > 1 && + pSurrSectNd->EndOfSectionIndex() - nSectEndIdx > SwNodeOffset(1) && !lcl_html_IsMultiColStart( rHTMLWrt, nSectEndIdx+1 ) ) lcl_html_OutSectionStartTag( rHTMLWrt, *pSurrSection, *pSurrFormat, pSurrCol, true ); @@ -858,10 +858,10 @@ void SwHTMLWriter::Out_SwDoc( SwPaM* pPam ) break; ++m_pCurrentPam->GetPoint()->nNode; // move - sal_uInt32 nPos = m_pCurrentPam->GetPoint()->nNode.GetIndex(); + SwNodeOffset nPos = m_pCurrentPam->GetPoint()->nNode.GetIndex(); if( m_bShowProgress ) - ::SetProgressState( nPos, m_pDoc->GetDocShell() ); // How far ? + ::SetProgressState( sal_Int32(nPos), m_pDoc->GetDocShell() ); // How far ? /* If only the selected area should be saved, so only the complete * nodes should be saved, this means the first and n-th node @@ -946,8 +946,8 @@ static void OutBodyColor( const char* pTag, const SwFormat *pFormat, sal_uInt16 SwHTMLWriter::OutHeaderAttrs() { - sal_uLong nIdx = m_pCurrentPam->GetPoint()->nNode.GetIndex(); - sal_uLong nEndIdx = m_pCurrentPam->GetMark()->nNode.GetIndex(); + SwNodeOffset nIdx = m_pCurrentPam->GetPoint()->nNode.GetIndex(); + SwNodeOffset nEndIdx = m_pCurrentPam->GetMark()->nNode.GetIndex(); SwTextNode *pTextNd = nullptr; while( nIdx<=nEndIdx && @@ -1036,7 +1036,7 @@ const SwPageDesc *SwHTMLWriter::MakeHeader( sal_uInt16 &rHeaderAttrs ) // In none HTML documents the first set template will be exported // and if none is set the default template - sal_uLong nNodeIdx = m_pCurrentPam->GetPoint()->nNode.GetIndex(); + SwNodeOffset nNodeIdx = m_pCurrentPam->GetPoint()->nNode.GetIndex(); while( nNodeIdx < m_pDoc->GetNodes().Count() ) { @@ -1153,7 +1153,7 @@ void SwHTMLWriter::OutBookmarks() pBookmark = pMarkAccess->getAllMarksBegin()[m_nBkmkTabPos]; // Output all bookmarks in this paragraph. The content position // for the moment isn't considered! - sal_uInt32 nNode = m_pCurrentPam->GetPoint()->nNode.GetIndex(); + SwNodeOffset nNode = m_pCurrentPam->GetPoint()->nNode.GetIndex(); while( m_nBkmkTabPos != -1 && pBookmark->GetMarkPos().nNode.GetIndex() == nNode ) { @@ -1497,8 +1497,8 @@ OString SwHTMLWriter::GetNamespace() const // Structure caches the current data of the writer to output a // other part of the document, like e.g. header/footer -HTMLSaveData::HTMLSaveData(SwHTMLWriter& rWriter, sal_uLong nStt, - sal_uLong nEnd, bool bSaveNum, +HTMLSaveData::HTMLSaveData(SwHTMLWriter& rWriter, SwNodeOffset nStt, + SwNodeOffset nEnd, bool bSaveNum, const SwFrameFormat *pFrameFormat) : rWrt(rWriter) , pOldPam(rWrt.m_pCurrentPam) diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx index 5365214b504d..bf6806b1ae95 100644 --- a/sw/source/filter/html/wrthtml.hxx +++ b/sw/source/filter/html/wrthtml.hxx @@ -191,10 +191,10 @@ struct HTMLControl { // the form to which the control belongs css::uno::Reference<css::container::XIndexContainer> xFormComps; - sal_uLong nNdIdx; // the node in which it's anchored + SwNodeOffset nNdIdx; // the node in which it's anchored sal_Int32 nCount; // how many controls are on the node - HTMLControl( const css::uno::Reference<css::container::XIndexContainer>& rForm, sal_uInt32 nIdx ); + HTMLControl( const css::uno::Reference<css::container::XIndexContainer>& rForm, SwNodeOffset nIdx ); ~HTMLControl(); // operators for the sort array @@ -284,7 +284,7 @@ public: std::set<OUString> m_aScriptParaStyles; // script dependent para styles std::set<OUString> m_aScriptTextStyles; // script dependent text styles std::vector<OUString> m_aOutlineMarks; - std::vector<sal_uInt32> m_aOutlineMarkPoss; + std::vector<SwNodeOffset> m_aOutlineMarkPoss; HTMLControls m_aHTMLControls; // the forms to be written SwHTMLFormatInfos m_CharFormatInfos; SwHTMLFormatInfos m_TextCollInfos; @@ -433,7 +433,7 @@ public: void OutHyperlinkHRefValue( const OUString& rURL ); // output the FlyFrame anchored at current position - bool OutFlyFrame( sal_uLong nNdIdx, sal_Int32 nContentIdx, + bool OutFlyFrame( SwNodeOffset nNdIdx, sal_Int32 nContentIdx, HtmlPosition nPos, HTMLOutContext *pContext = nullptr ); void OutFrameFormat( AllHtmlFlags nType, const SwFrameFormat& rFormat, const SdrObject *pSdrObj ); @@ -646,7 +646,7 @@ struct HTMLSaveData bool bOldOutFooter : 1; bool bOldOutFlyFrame : 1; - HTMLSaveData( SwHTMLWriter&, sal_uLong nStt, sal_uLong nEnd, + HTMLSaveData( SwHTMLWriter&, SwNodeOffset nStt, SwNodeOffset nEnd, bool bSaveNum=true, const SwFrameFormat *pFrameFormat=nullptr ); ~HTMLSaveData(); |