summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-10-06 11:24:33 +0200
committerNoel Grandin <noel@peralex.com>2015-10-07 08:27:24 +0200
commit857ff93895eb0e64922bdb938d2175261c05fcb9 (patch)
tree959e12b2a9a87d75e2a625c4949a2f08519d6553 /sw/source/core
parent9887118e1977e603d2103701c5d82bb799a729c7 (diff)
loplugin:mergeclasses
Change-Id: I9b5f35ac3a491bcf0bb5bb1b04f749321fc9f72b
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/edit/edattr.cxx2
-rw-r--r--sw/source/core/edit/ednumber.cxx44
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx4
-rw-r--r--sw/source/core/unocore/unoobj.cxx2
4 files changed, 26 insertions, 26 deletions
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(),