diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2013-03-29 07:06:50 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2013-03-29 07:06:50 +0100 |
commit | 733f9f92783db8447fa2d586ace6fe3a57f58806 (patch) | |
tree | d6b75111ec5009ef2706da27b3d16ad37b4f0e85 /sw | |
parent | 278d036b83d1493c2c9c9eaedee70871a3026fed (diff) |
Use const_iterator instead of iterator
Change-Id: Iaacbbfb4d97d7081e5a0b520b4037d4988604e0b
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/wrong.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx index 0e4cfe94527f..4dabc006fb7c 100644 --- a/sw/source/core/text/wrong.cxx +++ b/sw/source/core/text/wrong.cxx @@ -179,8 +179,7 @@ MSHORT SwWrongList::GetWrongPos( xub_StrLen nValue ) const // position of the first smart tag which coveres nValue if ( !maList[0].maType.isEmpty() || maList[0].mpSubList ) { - std::vector<SwWrongArea>::const_iterator aIter = maList.begin(); - while ( aIter != maList.end() ) + for (std::vector<SwWrongArea>::const_iterator aIter(maList.begin()), aEnd(maList.end()); aIter != aEnd; ++aIter) { const xub_StrLen nSTPos = (*aIter).mnPos; const xub_StrLen nSTLen = (*aIter).mnLen; @@ -189,7 +188,6 @@ MSHORT SwWrongList::GetWrongPos( xub_StrLen nValue ) const else if ( nSTPos > nValue ) break; - ++aIter; ++nUnten; } return nUnten; @@ -553,15 +551,15 @@ void SwWrongList::Remove(sal_uInt16 nIdx, sal_uInt16 nLen ) void SwWrongList::RemoveEntry( xub_StrLen nBegin, xub_StrLen nEnd ) { sal_uInt16 nDelPos = 0; sal_uInt16 nDel = 0; - std::vector<SwWrongArea>::iterator aIter = maList.begin(); - while( aIter != maList.end() && (*aIter).mnPos < nBegin ) + std::vector<SwWrongArea>::const_iterator aIter(maList.begin()), aEnd(maList.end()); + while( aIter != aEnd && (*aIter).mnPos < nBegin ) { ++aIter; ++nDelPos; } if( WRONGLIST_GRAMMAR == GetWrongListType() ) { - while( aIter != maList.end() && nBegin < nEnd && nEnd > (*aIter).mnPos ) + while( aIter != aEnd && nBegin < nEnd && nEnd > (*aIter).mnPos ) { ++aIter; ++nDel; @@ -569,7 +567,7 @@ void SwWrongList::RemoveEntry( xub_StrLen nBegin, xub_StrLen nEnd ) { } else { - while( aIter != maList.end() && nBegin == (*aIter).mnPos && nEnd == (*aIter).mnPos +(*aIter).mnLen ) + while( aIter != aEnd && nBegin == (*aIter).mnPos && nEnd == (*aIter).mnPos +(*aIter).mnLen ) { ++aIter; ++nDel; |