[Libreoffice-commits] core.git: 2 commits - filter/source sw/source
Julien Nabet
serval2412 at yahoo.fr
Thu Mar 28 23:09:11 PDT 2013
filter/source/xsltdialog/typedetectionimport.cxx | 5 +----
sw/source/core/text/wrong.cxx | 12 +++++-------
2 files changed, 6 insertions(+), 11 deletions(-)
New commits:
commit 733f9f92783db8447fa2d586ace6fe3a57f58806
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Fri Mar 29 07:06:50 2013 +0100
Use const_iterator instead of iterator
Change-Id: Iaacbbfb4d97d7081e5a0b520b4037d4988604e0b
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index 0e4cfe9..4dabc00 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;
commit 278d036b83d1493c2c9c9eaedee70871a3026fed
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Fri Mar 29 06:54:16 2013 +0100
Prefer prefix ++/-- operators for non-primitive types
+ transform while loop in for loop
+ use const_iterator instead of iterator
Change-Id: I13bee5d941e3c64813f34b219fc07f41866b8d3f
diff --git a/filter/source/xsltdialog/typedetectionimport.cxx b/filter/source/xsltdialog/typedetectionimport.cxx
index bb6be3e..ffce4d9 100644
--- a/filter/source/xsltdialog/typedetectionimport.cxx
+++ b/filter/source/xsltdialog/typedetectionimport.cxx
@@ -135,13 +135,10 @@ static OUString getSubdata( int index, sal_Unicode delimeter, const OUString& rD
Node* TypeDetectionImporter::findTypeNode( const OUString& rType )
{
// now delete type nodes
- NodeVector::iterator aIter = maTypeNodes.begin();
- while( aIter != maTypeNodes.end() )
+ for (NodeVector::const_iterator aIter(maTypeNodes.begin()), aEnd(maTypeNodes.end()); aIter != aEnd; ++aIter)
{
if( (*aIter)->maName == rType )
return (*aIter);
-
- ++aIter;
}
return NULL;
More information about the Libreoffice-commits
mailing list