summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2011-05-04 22:58:22 +0200
committerJulien Nabet <serval2412@yahoo.fr>2011-05-04 22:58:22 +0200
commitdc135ac4c097ef286de8a5ef4eff94e793567346 (patch)
treec3291fe104693a01227d56c3fc9df904215e8a5d
parentdd1041f12687d9735d55b09bab81165989d9044d (diff)
Some cppcheck cleaning
-rw-r--r--basegfx/source/polygon/b2dpolygon.cxx16
-rw-r--r--basegfx/source/polygon/b2dpolypolygon.cxx2
-rw-r--r--basegfx/source/polygon/b3dpolygon.cxx6
-rw-r--r--comphelper/source/eventattachermgr/eventattachermgr.cxx20
-rw-r--r--comphelper/source/xml/attributelist.cxx6
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx3
-rw-r--r--i18npool/source/calendar/calendar_hijri.cxx3
-rw-r--r--i18npool/source/search/levdis.cxx2
8 files changed, 29 insertions, 29 deletions
diff --git a/basegfx/source/polygon/b2dpolygon.cxx b/basegfx/source/polygon/b2dpolygon.cxx
index 928902090b66..a7524ddcf5fe 100644
--- a/basegfx/source/polygon/b2dpolygon.cxx
+++ b/basegfx/source/polygon/b2dpolygon.cxx
@@ -168,8 +168,8 @@ public:
for(sal_uInt32 a(0); a < nHalfSize; a++)
{
::std::swap(*aStart, *aEnd);
- aStart++;
- aEnd--;
+ ++aStart;
+ --aEnd;
}
}
}
@@ -210,7 +210,7 @@ public:
CoordinateData2DVector::iterator aStart(maVector.begin());
CoordinateData2DVector::iterator aEnd(maVector.end());
- for(; aStart != aEnd; aStart++)
+ for(; aStart != aEnd; ++aStart)
{
aStart->transform(rMatrix);
}
@@ -317,7 +317,7 @@ public:
aEnd += nCount;
maVector.reserve(nCount);
- for(; aStart != aEnd; aStart++)
+ for(; aStart != aEnd; ++aStart)
{
if(!aStart->getPrevVector().equalZero())
mnUsedVectors++;
@@ -449,7 +449,7 @@ public:
ControlVectorPair2DVector::const_iterator aEnd(rSource.maVector.end());
maVector.insert(aIndex, aStart, aEnd);
- for(; aStart != aEnd; aStart++)
+ for(; aStart != aEnd; ++aStart)
{
if(!aStart->getPrevVector().equalZero())
mnUsedVectors++;
@@ -468,7 +468,7 @@ public:
const ControlVectorPair2DVector::iterator aDeleteEnd(aDeleteStart + nCount);
ControlVectorPair2DVector::const_iterator aStart(aDeleteStart);
- for(; mnUsedVectors && aStart != aDeleteEnd; aStart++)
+ for(; mnUsedVectors && aStart != aDeleteEnd; ++aStart)
{
if(!aStart->getPrevVector().equalZero())
mnUsedVectors--;
@@ -501,8 +501,8 @@ public:
// swap entries
::std::swap(*aStart, *aEnd);
- aStart++;
- aEnd--;
+ ++aStart;
+ --aEnd;
}
if(aStart == aEnd)
diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx b/basegfx/source/polygon/b2dpolypolygon.cxx
index af337a5bcc75..4c8ab7b44a45 100644
--- a/basegfx/source/polygon/b2dpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dpolypolygon.cxx
@@ -105,7 +105,7 @@ public:
for(sal_uInt32 a(0L); a < nCount; a++)
{
aIndex = maPolygons.insert(aIndex, rPolyPolygon.getB2DPolygon(a));
- aIndex++;
+ ++aIndex;
}
}
}
diff --git a/basegfx/source/polygon/b3dpolygon.cxx b/basegfx/source/polygon/b3dpolygon.cxx
index 019ed0fff970..06d01fc4cc29 100644
--- a/basegfx/source/polygon/b3dpolygon.cxx
+++ b/basegfx/source/polygon/b3dpolygon.cxx
@@ -242,8 +242,8 @@ public:
for(sal_uInt32 a(0); a < nHalfSize; a++)
{
::std::swap(*aStart, *aEnd);
- aStart++;
- aEnd--;
+ ++aStart;
+ --aEnd;
}
}
}
@@ -253,7 +253,7 @@ public:
CoordinateData3DVector::iterator aStart(maVector.begin());
CoordinateData3DVector::iterator aEnd(maVector.end());
- for(; aStart != aEnd; aStart++)
+ for(; aStart != aEnd; ++aStart)
{
aStart->transform(rMatrix);
}
diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx
index acbb962ea4d7..9ed3c77381b0 100644
--- a/comphelper/source/eventattachermgr/eventattachermgr.cxx
+++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx
@@ -470,7 +470,7 @@ void detachAll_Impl
while( aObjIt != aObjEnd )
{
pMgr->detach( nIdx, (*aObjIt).xTarget );
- aObjIt++;
+ ++aObjIt;
}
}
@@ -487,7 +487,7 @@ void attachAll_Impl
while( aObjIt != aObjEnd )
{
pMgr->attach( nIdx, (*aObjIt).xTarget, (*aObjIt).aHelper );
- aObjIt++;
+ ++aObjIt;
}
}
@@ -541,7 +541,7 @@ void SAL_CALL ImplEventAttacherManager::registerScriptEvent
{
}
- aObjIt++;
+ ++aObjIt;
}
}
@@ -605,7 +605,7 @@ void SAL_CALL ImplEventAttacherManager::revokeScriptEvent
break;
}
- aEvtIt++;
+ ++aEvtIt;
}
#else
Sequence< ScriptEventDescriptor >& rEventList = (*aIt).aEventList;
@@ -698,7 +698,7 @@ Sequence< ScriptEventDescriptor > SAL_CALL ImplEventAttacherManager::getScriptEv
while( aEvtIt != aEvtEnd )
{
pArray[i++] = *aEvtIt;
- aEvtIt++;
+ ++aEvtIt;
}
return aSeq;
#else
@@ -763,7 +763,7 @@ void SAL_CALL ImplEventAttacherManager::attach(sal_Int32 nIndex, const Reference
}
pArray[i++] = xAdapter;
- aEvtIt++;
+ ++aEvtIt;
}
#else
sal_Int32 nLen = aCurrentPosition->aEventList.getLength();
@@ -824,7 +824,7 @@ void SAL_CALL ImplEventAttacherManager::detach(sal_Int32 nIndex, const Reference
}
}
i++;
- aEvtIt++;
+ ++aEvtIt;
}
#else
sal_Int32 nLen = aCurrentPosition->aEventList.getLength();
@@ -847,7 +847,7 @@ void SAL_CALL ImplEventAttacherManager::detach(sal_Int32 nIndex, const Reference
aCurrentPosition->aObjList.erase( aObjIt );
break;
}
- aObjIt++;
+ ++aObjIt;
}
}
@@ -910,7 +910,7 @@ void SAL_CALL ImplEventAttacherManager::write(const Reference< XObjectOutputStre
OutStream->writeUTF( rDesc.ScriptType );
OutStream->writeUTF( rDesc.ScriptCode );
- aEvtIt++;
+ ++aEvtIt;
}
#else
sal_Int32 nLen = (*aIt).aEventList.getLength();
@@ -927,7 +927,7 @@ void SAL_CALL ImplEventAttacherManager::write(const Reference< XObjectOutputStre
OutStream->writeUTF( rDesc.ScriptCode );
}
#endif
- aIt++;
+ ++aIt;
}
// Die jetzt bekannte Laenge eintragen
diff --git a/comphelper/source/xml/attributelist.cxx b/comphelper/source/xml/attributelist.cxx
index 2c956623fcb7..2442fd69f106 100644
--- a/comphelper/source/xml/attributelist.cxx
+++ b/comphelper/source/xml/attributelist.cxx
@@ -93,7 +93,7 @@ OUString SAL_CALL AttributeList::getTypeByName( const OUString& sName ) throw( :
{
::std::vector<struct TagAttribute_Impl>::iterator ii = m_pImpl->vecAttribute.begin();
- for( ; ii != m_pImpl->vecAttribute.end() ; ii ++ ) {
+ for( ; ii != m_pImpl->vecAttribute.end() ; ++ii ) {
if( (*ii).sName == sName ) {
return (*ii).sType;
}
@@ -105,7 +105,7 @@ OUString SAL_CALL AttributeList::getValueByName(const OUString& sName) throw( ::
{
::std::vector<struct TagAttribute_Impl>::iterator ii = m_pImpl->vecAttribute.begin();
- for( ; ii != m_pImpl->vecAttribute.end() ; ii ++ ) {
+ for( ; ii != m_pImpl->vecAttribute.end() ; ++ii ) {
if( (*ii).sName == sName ) {
return (*ii).sValue;
}
@@ -144,7 +144,7 @@ void AttributeList::RemoveAttribute( const OUString sName )
{
::std::vector<struct TagAttribute_Impl>::iterator ii = m_pImpl->vecAttribute.begin();
- for( ; ii != m_pImpl->vecAttribute.end() ; ii ++ ) {
+ for( ; ii != m_pImpl->vecAttribute.end() ; ++ii ) {
if( (*ii).sName == sName ) {
m_pImpl->vecAttribute.erase( ii );
break;
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index c71c09863234..116748d38d10 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -1076,7 +1076,6 @@ namespace cppcanvas
aStrikeoutText += pChars[0];
- sal_Int32 nStartPos = 0;
xub_StrLen nLen = aStrikeoutText.Len();
if( nLen )
@@ -1095,6 +1094,8 @@ namespace cppcanvas
pStrikeoutCharWidths[ i ] += pStrikeoutCharWidths[ i-1 ];
}
+ sal_Int32 nStartPos = 0;
+
pStrikeoutTextAction =
TextActionFactory::createTextAction(
rStartPoint,
diff --git a/i18npool/source/calendar/calendar_hijri.cxx b/i18npool/source/calendar/calendar_hijri.cxx
index 4921c90f2223..ec0e86baf24e 100644
--- a/i18npool/source/calendar/calendar_hijri.cxx
+++ b/i18npool/source/calendar/calendar_hijri.cxx
@@ -269,12 +269,11 @@ Calendar_hijri::getGregorianDay(sal_Int32 lJulianDay, sal_Int32 *pnDay, sal_Int3
{
/* working variables */
long lFactorA, lFactorB, lFactorC, lFactorD, lFactorE;
- long lAdjust;
/* test whether to adjust for the Gregorian calendar crossover */
if (lJulianDay >= GREGORIAN_CROSSOVER) {
/* calculate a small adjustment */
- lAdjust = (long) (((float) (lJulianDay - 1867216) - 0.25) / 36524.25);
+ long lAdjust = (long) (((float) (lJulianDay - 1867216) - 0.25) / 36524.25);
lFactorA = lJulianDay + 1 + lAdjust - ((long) (0.25 * lAdjust));
diff --git a/i18npool/source/search/levdis.cxx b/i18npool/source/search/levdis.cxx
index 252421fa25ce..fe1d1833e944 100644
--- a/i18npool/source/search/levdis.cxx
+++ b/i18npool/source/search/levdis.cxx
@@ -307,12 +307,12 @@ int WLevDistance::WLD( const sal_Unicode* cString, sal_Int32 nStringLen )
// aus Userwerten nOtherX, nShorterY, nLongerZ, bRelaxed
int WLevDistance::CalcLPQR( int nX, int nY, int nZ, bool bRelaxed )
{
- int nMid, nMax;
if ( nX < 0 ) nX = 0; // nur positive Werte
if ( nY < 0 ) nY = 0;
if ( nZ < 0 ) nZ = 0;
if (0 == Min3( nX, nY, nZ )) // mindestens einer 0
{
+ int nMid, nMax;
nMax = Max3( nX, nY, nZ ); // entweder 0 bei drei 0 oder Max
if ( 0 == (nMid = Mid3( nX, nY, nZ )) ) // sogar zwei 0
nLimit = nMax; // entweder 0 oder einziger >0