[Libreoffice-commits] .: 2 commits - basegfx/source comphelper/source cppcanvas/source i18npool/source toolkit/test
Julien Nabet
serval2412 at kemper.freedesktop.org
Wed May 4 13:59:38 PDT 2011
basegfx/source/polygon/b2dpolygon.cxx | 16 ++++++------
basegfx/source/polygon/b2dpolypolygon.cxx | 2 -
basegfx/source/polygon/b3dpolygon.cxx | 6 ++--
comphelper/source/eventattachermgr/eventattachermgr.cxx | 20 ++++++++--------
comphelper/source/xml/attributelist.cxx | 6 ++--
cppcanvas/source/mtfrenderer/implrenderer.cxx | 3 +-
i18npool/source/calendar/calendar_hijri.cxx | 3 --
i18npool/source/search/levdis.cxx | 2 -
toolkit/test/accessibility/HelpWindow.java | 2 -
9 files changed, 30 insertions(+), 30 deletions(-)
New commits:
commit c613baad6ff5850c603432629b71b3beab7b7a62
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Wed May 4 22:58:22 2011 +0200
Some cppcheck cleaning
diff --git a/basegfx/source/polygon/b2dpolygon.cxx b/basegfx/source/polygon/b2dpolygon.cxx
index 4e578a9..b8f23f5 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 5c14997..998c348 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 684717b..8e21ef7 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 943900e..807e554 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 09ce2b6..23b0535 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 292df3a..fa08bad 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 b38eaf9..3bec4e2 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 5acfb39..0142307 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
commit be1f288f0ac4b37a868bf2d52281cf786af1076e
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Tue May 3 22:58:12 2011 +0200
Change <file>.toURL() to <file>.toURI().toURL()
diff --git a/toolkit/test/accessibility/HelpWindow.java b/toolkit/test/accessibility/HelpWindow.java
index 80b206f..b66875c 100644
--- a/toolkit/test/accessibility/HelpWindow.java
+++ b/toolkit/test/accessibility/HelpWindow.java
@@ -30,7 +30,7 @@ class HelpWindow
File aFile = new File (sFilename);
try
{
- loadURL (aFile.toURL());
+ loadURL (aFile.toURI().toURL());
}
catch (MalformedURLException e)
{
More information about the Libreoffice-commits
mailing list