diff options
-rw-r--r-- | compilerplugins/clang/mergeclasses.results | 1 | ||||
-rw-r--r-- | sw/inc/edimp.hxx | 19 | ||||
-rw-r--r-- | sw/source/core/edit/edattr.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/ednumber.cxx | 44 | ||||
-rw-r--r-- | sw/source/core/unocore/unocrsrhelper.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj.cxx | 2 |
6 files changed, 35 insertions, 37 deletions
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results index 44861baa9361..d377c46b2b0c 100644 --- a/compilerplugins/clang/mergeclasses.results +++ b/compilerplugins/clang/mergeclasses.results @@ -97,7 +97,6 @@ merge XMLTransformer with XMLTransformerBase merge XclDebugObjCounter with XclRootData merge _LibreOfficeKit with LibLibreOffice_Impl merge _LibreOfficeKitDocument with LibLODocument_Impl -merge _SwPamRanges with SwPamRanges merge _SwRedlineTable with SwRedlineTable merge _uno_ExtEnvironment with (anonymous namespace)::uno_DefaultEnvironment merge abp::OModuleResourceClient with abp::OABSPilotUno diff --git a/sw/inc/edimp.hxx b/sw/inc/edimp.hxx index f43e8579849e..67991490ff43 100644 --- a/sw/inc/edimp.hxx +++ b/sw/inc/edimp.hxx @@ -39,21 +39,20 @@ struct SwPamRange { return nStart < rRg.nStart; } }; -class _SwPamRanges : public o3tl::sorted_vector<SwPamRange> {}; - -class SwPamRanges : private _SwPamRanges +class SwPamRanges { public: SwPamRanges( const SwPaM& rRing ); - using _SwPamRanges::size_type; void Insert( const SwNodeIndex& rIdx1, const SwNodeIndex& rIdx2 ); - SwPaM& SetPam( size_type nArrPos, SwPaM& rPam ); - - size_type Count() const - { return _SwPamRanges::size(); } - SwPamRange operator[]( size_type nPos ) const - { return _SwPamRanges::operator[](nPos); } + SwPaM& SetPam( size_t nArrPos, SwPaM& rPam ); + + size_t Count() const + { return maVector.size(); } + SwPamRange operator[]( size_t nPos ) const + { return maVector[nPos]; } +private: + o3tl::sorted_vector<SwPamRange> maVector; }; #endif diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index f7d0438167a5..d62793c27196 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -529,7 +529,7 @@ void SwEditShell::MoveLeftMargin( bool bRight, bool bModulus ) { SwPamRanges aRangeArr( *pCrsr ); SwPaM aPam( *pCrsr->GetPoint() ); - for( SwPamRanges::size_type n = 0; n < aRangeArr.Count(); ++n ) + for( size_t n = 0; n < aRangeArr.Count(); ++n ) GetDoc()->MoveLeftMargin( aRangeArr.SetPam( n, aPam ), bRight, bModulus ); } diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx index 847747b4709f..2d1d92a8a116 100644 --- a/sw/source/core/edit/ednumber.cxx +++ b/sw/source/core/edit/ednumber.cxx @@ -40,16 +40,16 @@ void SwPamRanges::Insert( const SwNodeIndex& rIdx1, const SwNodeIndex& rIdx2 ) if( aRg.nEnd < aRg.nStart ) { aRg.nStart = aRg.nEnd; aRg.nEnd = rIdx1.GetIndex(); } - _SwPamRanges::const_iterator it = lower_bound(aRg); //search Insert Position - size_type nPos = it - begin(); - if (!empty() && (it != end()) && (*it) == aRg) + o3tl::sorted_vector<SwPamRange>::const_iterator it = maVector.lower_bound(aRg); //search Insert Position + size_t nPos = it - maVector.begin(); + if (!maVector.empty() && (it != maVector.end()) && (*it) == aRg) { // is the one in the Array smaller? - SwPamRange const& rTmp = _SwPamRanges::operator[](nPos); + SwPamRange const& rTmp = maVector[nPos]; if( rTmp.nEnd < aRg.nEnd ) { aRg.nEnd = rTmp.nEnd; - erase(begin() + nPos); // combine + maVector.erase(maVector.begin() + nPos); // combine } else return; // done, because by precondition everything is combined @@ -62,28 +62,28 @@ void SwPamRanges::Insert( const SwNodeIndex& rIdx1, const SwNodeIndex& rIdx2 ) // combine with predecessor? if( nPos > 0 ) { - SwPamRange const& rTmp = _SwPamRanges::operator[](nPos-1); + SwPamRange const& rTmp = maVector[nPos-1]; if( rTmp.nEnd == aRg.nStart || rTmp.nEnd+1 == aRg.nStart ) { aRg.nStart = rTmp.nStart; bEnd = false; - erase( begin() + --nPos ); // combine + maVector.erase( maVector.begin() + --nPos ); // combine } // range contained in rTmp? else if( rTmp.nStart <= aRg.nStart && aRg.nEnd <= rTmp.nEnd ) return; } // combine with successor? - if( nPos < size() ) + if( nPos < maVector.size() ) { - SwPamRange const& rTmp = _SwPamRanges::operator[](nPos); + SwPamRange const& rTmp = maVector[nPos]; if( rTmp.nStart == aRg.nEnd || rTmp.nStart == aRg.nEnd+1 ) { aRg.nEnd = rTmp.nEnd; bEnd = false; - erase( begin() + nPos ); // combine + maVector.erase( maVector.begin() + nPos ); // combine } // range contained in rTmp? @@ -92,13 +92,13 @@ void SwPamRanges::Insert( const SwNodeIndex& rIdx1, const SwNodeIndex& rIdx2 ) } } while( !bEnd ); - _SwPamRanges::insert( aRg ); + maVector.insert( aRg ); } -SwPaM& SwPamRanges::SetPam( size_type nArrPos, SwPaM& rPam ) +SwPaM& SwPamRanges::SetPam( size_t nArrPos, SwPaM& rPam ) { OSL_ASSERT( nArrPos < Count() ); - const SwPamRange& rTmp = (*this)[ nArrPos ]; + const SwPamRange& rTmp = maVector[ nArrPos ]; rPam.GetPoint()->nNode = rTmp.nStart; rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), 0 ); rPam.SetMark(); @@ -136,7 +136,7 @@ bool SwEditShell::NoNum() GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( *pCrsr ); SwPaM aPam( *pCrsr->GetPoint() ); - for( SwPamRanges::size_type n = 0; n < aRangeArr.Count(); ++n ) + for( size_t n = 0; n < aRangeArr.Count(); ++n ) bRet = bRet && GetDoc()->NoNum( aRangeArr.SetPam( n, aPam )); GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); } @@ -155,7 +155,7 @@ bool SwEditShell::SelectionHasNumber() const if (!bResult && pTextNd && pTextNd->Len()==0 && !pTextNd->GetNumRule()) { SwPamRanges aRangeArr( *GetCrsr() ); SwPaM aPam( *GetCrsr()->GetPoint() ); - for( SwPamRanges::size_type n = 0; n < aRangeArr.Count(); ++n ) + for( size_t n = 0; n < aRangeArr.Count(); ++n ) { aRangeArr.SetPam( n, aPam ); { @@ -201,7 +201,7 @@ bool SwEditShell::SelectionHasBullet() const if (!bResult && pTextNd && pTextNd->Len()==0 && !pTextNd->GetNumRule()) { SwPamRanges aRangeArr( *GetCrsr() ); SwPaM aPam( *GetCrsr()->GetPoint() ); - for( SwPamRanges::size_type n = 0; n < aRangeArr.Count(); ++n ) + for( size_t n = 0; n < aRangeArr.Count(); ++n ) { aRangeArr.SetPam( n, aPam ); { @@ -281,7 +281,7 @@ void SwEditShell::DelNumRules() GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( *pCrsr ); SwPaM aPam( *pCrsr->GetPoint() ); - for( SwPamRanges::size_type n = 0; n < aRangeArr.Count(); ++n ) + for( size_t n = 0; n < aRangeArr.Count(); ++n ) { GetDoc()->DelNumRules( aRangeArr.SetPam( n, aPam ) ); } @@ -314,7 +314,7 @@ bool SwEditShell::NumUpDown( bool bDown ) GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( *pCrsr ); SwPaM aPam( *pCrsr->GetPoint() ); - for( SwPamRanges::size_type n = 0; n < aRangeArr.Count(); ++n ) + for( size_t n = 0; n < aRangeArr.Count(); ++n ) bRet = bRet && GetDoc()->NumUpDown( aRangeArr.SetPam( n, aPam ), bDown ); GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); } @@ -535,7 +535,7 @@ bool SwEditShell::OutlineUpDown( short nOffset ) GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( *pCrsr ); SwPaM aPam( *pCrsr->GetPoint() ); - for( SwPamRanges::size_type n = 0; n < aRangeArr.Count(); ++n ) + for( size_t n = 0; n < aRangeArr.Count(); ++n ) bRet = bRet && GetDoc()->OutlineUpDown( aRangeArr.SetPam( n, aPam ), nOffset ); GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); @@ -745,7 +745,7 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule, SwPamRanges aRangeArr( *pCrsr ); SwPaM aPam( *pCrsr->GetPoint() ); OUString sContinuedListId(rContinuedListId); - for( SwPamRanges::size_type n = 0; n < aRangeArr.Count(); ++n ) + for( size_t n = 0; n < aRangeArr.Count(); ++n ) { aRangeArr.SetPam( n, aPam ); OUString sListId = GetDoc()->SetNumRule( aPam, rRule, @@ -804,7 +804,7 @@ void SwEditShell::SetNumRuleStart( bool bFlag, SwPaM* pPaM ) GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( *pCrsr ); SwPaM aPam( *pCrsr->GetPoint() ); - for( SwPamRanges::size_type n = 0; n < aRangeArr.Count(); ++n ) + for( size_t n = 0; n < aRangeArr.Count(); ++n ) GetDoc()->SetNumRuleStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), bFlag ); GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); } @@ -831,7 +831,7 @@ void SwEditShell::SetNodeNumStart( sal_uInt16 nStt, SwPaM* pPaM ) GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( *pCrsr ); SwPaM aPam( *pCrsr->GetPoint() ); - for( SwPamRanges::size_type n = 0; n < aRangeArr.Count(); ++n ) + for( size_t n = 0; n < aRangeArr.Count(); ++n ) GetDoc()->SetNodeNumStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), nStt ); GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); } diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index e43aeb62af54..da746b073ca0 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -837,7 +837,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam) pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( rPam ); SwPaM aPam( *rPam.GetPoint() ); - for ( SwPamRanges::size_type n = 0; n < aRangeArr.Count(); ++n ) + for ( size_t n = 0; n < aRangeArr.Count(); ++n ) { // no start of a new list pDoc->SetNumRule( aRangeArr.SetPam( n, aPam ), aRule, false ); @@ -927,7 +927,7 @@ void resetCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPa pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( rPam ); SwPaM aPam( *rPam.GetPoint() ); - for( SwPamRanges::size_type n = 0; n < aRangeArr.Count(); ++n ) + for( size_t n = 0; n < aRangeArr.Count(); ++n ) pDoc->SetNodeNumStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), 1 ); pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); } diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index c3be1b1951e8..6dc51fd6fc3f 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -354,7 +354,7 @@ lcl_SetNodeNumStart(SwPaM & rCrsr, uno::Any const& rValue) pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( rCrsr ); SwPaM aPam( *rCrsr.GetPoint() ); - for( SwPamRanges::size_type n = 0; n < aRangeArr.Count(); ++n ) + for( size_t n = 0; n < aRangeArr.Count(); ++n ) { pDoc->SetNumRuleStart(*aRangeArr.SetPam( n, aPam ).GetPoint()); pDoc->SetNodeNumStart(*aRangeArr.SetPam( n, aPam ).GetPoint(), |