Kaydet (Commit) 733f9f92 authored tarafından Julien Nabet's avatar Julien Nabet

Use const_iterator instead of iterator

Change-Id: Iaacbbfb4d97d7081e5a0b520b4037d4988604e0b
üst 278d036b
...@@ -179,8 +179,7 @@ MSHORT SwWrongList::GetWrongPos( xub_StrLen nValue ) const ...@@ -179,8 +179,7 @@ MSHORT SwWrongList::GetWrongPos( xub_StrLen nValue ) const
// position of the first smart tag which coveres nValue // position of the first smart tag which coveres nValue
if ( !maList[0].maType.isEmpty() || maList[0].mpSubList ) if ( !maList[0].maType.isEmpty() || maList[0].mpSubList )
{ {
std::vector<SwWrongArea>::const_iterator aIter = maList.begin(); for (std::vector<SwWrongArea>::const_iterator aIter(maList.begin()), aEnd(maList.end()); aIter != aEnd; ++aIter)
while ( aIter != maList.end() )
{ {
const xub_StrLen nSTPos = (*aIter).mnPos; const xub_StrLen nSTPos = (*aIter).mnPos;
const xub_StrLen nSTLen = (*aIter).mnLen; const xub_StrLen nSTLen = (*aIter).mnLen;
...@@ -189,7 +188,6 @@ MSHORT SwWrongList::GetWrongPos( xub_StrLen nValue ) const ...@@ -189,7 +188,6 @@ MSHORT SwWrongList::GetWrongPos( xub_StrLen nValue ) const
else if ( nSTPos > nValue ) else if ( nSTPos > nValue )
break; break;
++aIter;
++nUnten; ++nUnten;
} }
return nUnten; return nUnten;
...@@ -553,15 +551,15 @@ void SwWrongList::Remove(sal_uInt16 nIdx, sal_uInt16 nLen ) ...@@ -553,15 +551,15 @@ void SwWrongList::Remove(sal_uInt16 nIdx, sal_uInt16 nLen )
void SwWrongList::RemoveEntry( xub_StrLen nBegin, xub_StrLen nEnd ) { void SwWrongList::RemoveEntry( xub_StrLen nBegin, xub_StrLen nEnd ) {
sal_uInt16 nDelPos = 0; sal_uInt16 nDelPos = 0;
sal_uInt16 nDel = 0; sal_uInt16 nDel = 0;
std::vector<SwWrongArea>::iterator aIter = maList.begin(); std::vector<SwWrongArea>::const_iterator aIter(maList.begin()), aEnd(maList.end());
while( aIter != maList.end() && (*aIter).mnPos < nBegin ) while( aIter != aEnd && (*aIter).mnPos < nBegin )
{ {
++aIter; ++aIter;
++nDelPos; ++nDelPos;
} }
if( WRONGLIST_GRAMMAR == GetWrongListType() ) if( WRONGLIST_GRAMMAR == GetWrongListType() )
{ {
while( aIter != maList.end() && nBegin < nEnd && nEnd > (*aIter).mnPos ) while( aIter != aEnd && nBegin < nEnd && nEnd > (*aIter).mnPos )
{ {
++aIter; ++aIter;
++nDel; ++nDel;
...@@ -569,7 +567,7 @@ void SwWrongList::RemoveEntry( xub_StrLen nBegin, xub_StrLen nEnd ) { ...@@ -569,7 +567,7 @@ void SwWrongList::RemoveEntry( xub_StrLen nBegin, xub_StrLen nEnd ) {
} }
else 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; ++aIter;
++nDel; ++nDel;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment