summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2012-01-21 19:57:19 +0100
committerThomas Arnhold <thomas@arnhold.org>2012-01-21 19:58:46 +0100
commit22da27d9ddcdacaef21d667b0777052b7e817b9a (patch)
treee72e427eb7b6934b796179ed3e49ca4a8c8734a6
parentcfc2f1919f8cf856c0c884dac7e4eb83bece4a7f (diff)
Improve checking for emptiness
-rw-r--r--animations/source/animcore/animcore.cxx2
-rw-r--r--basegfx/inc/basegfx/curve/b2dbeziertools.hxx2
-rw-r--r--basegfx/source/polygon/b2dpolygoncutandtouch.cxx10
-rw-r--r--basegfx/source/polygon/b2dpolygontriangulator.cxx2
-rw-r--r--basegfx/source/polygon/b2dtrapezoid.cxx2
-rw-r--r--basegfx/source/raster/rasterconvert3d.cxx4
-rw-r--r--connectivity/source/drivers/mozab/MPreparedStatement.cxx2
-rw-r--r--cui/source/dialogs/SpellDialog.cxx4
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx4
-rw-r--r--drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx6
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx2
-rw-r--r--drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx2
-rw-r--r--drawinglayer/source/primitive3d/sdrprimitive3d.cxx2
-rw-r--r--drawinglayer/source/processor2d/canvasprocessor.cxx2
-rw-r--r--drawinglayer/source/processor2d/vclhelpergradient.cxx6
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx2
-rw-r--r--svtools/bmpmaker/bmpcore.cxx2
-rw-r--r--svtools/source/filter/wmf/winmtf.cxx2
-rw-r--r--svx/source/engine3d/helperhittest3d.cxx2
-rw-r--r--sw/source/core/docnode/ndtbl.cxx2
-rw-r--r--sw/source/core/unocore/unoportenum.cxx4
21 files changed, 33 insertions, 33 deletions
diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx
index 9a837f60bc70..e85b80642d7c 100644
--- a/animations/source/animcore/animcore.cxx
+++ b/animations/source/animcore/animcore.cxx
@@ -1178,7 +1178,7 @@ Reference< XCloneable > SAL_CALL AnimationNode::createClone() throw (RuntimeExce
{
xNewNode = new AnimationNode( *this );
- if( maChildren.size() )
+ if( !maChildren.empty() )
{
Reference< XTimeContainer > xContainer( xNewNode, UNO_QUERY );
if( xContainer.is() )
diff --git a/basegfx/inc/basegfx/curve/b2dbeziertools.hxx b/basegfx/inc/basegfx/curve/b2dbeziertools.hxx
index 2279cb9a8f24..821cc33c723f 100644
--- a/basegfx/inc/basegfx/curve/b2dbeziertools.hxx
+++ b/basegfx/inc/basegfx/curve/b2dbeziertools.hxx
@@ -54,7 +54,7 @@ namespace basegfx
public:
B2DCubicBezierHelper(const B2DCubicBezier& rBase, sal_uInt32 nDivisions = 9);
- double getLength() const { if(maLengthArray.size()) return maLengthArray[maLengthArray.size() - 1]; else return 0.0; }
+ double getLength() const { if(!maLengthArray.empty()) return maLengthArray[maLengthArray.size() - 1]; else return 0.0; }
double distanceToRelative(double fDistance) const;
};
} // end of namespace basegfx
diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
index 011ecff8ad10..d4d075bfc9bf 100644
--- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
+++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
@@ -437,7 +437,7 @@ namespace basegfx
// #i76891# using findCuts recursively is not sufficient here
findCutsAndTouchesAndCommonForBezier(aTempPolygonA, aTempPolygonEdge, aTempPointVectorA, aTempPointVectorEdge);
- if(aTempPointVectorA.size())
+ if(!aTempPointVectorA.empty())
{
// adapt tempVector entries to segment
adaptAndTransferCutsWithBezierSegment(aTempPointVectorA, aTempPolygonA, nIndA, rTempPointsA);
@@ -479,13 +479,13 @@ namespace basegfx
// #i76891# using findCuts recursively is not sufficient here
findCutsAndTouchesAndCommonForBezier(aTempPolygonA, aTempPolygonB, aTempPointVectorA, aTempPointVectorB);
- if(aTempPointVectorA.size())
+ if(!aTempPointVectorA.empty())
{
// adapt tempVector entries to segment
adaptAndTransferCutsWithBezierSegment(aTempPointVectorA, aTempPolygonA, nIndA, rTempPointsA);
}
- if(aTempPointVectorB.size())
+ if(!aTempPointVectorB.empty())
{
// adapt tempVector entries to segment
adaptAndTransferCutsWithBezierSegment(aTempPointVectorB, aTempPolygonB, nIndB, rTempPointsB);
@@ -518,7 +518,7 @@ namespace basegfx
rCubicA.adaptiveSubdivideByCount(aTempPolygon, SUBDIVIDE_FOR_CUT_TEST_COUNT);
findCuts(aTempPolygon, aTempPointVector);
- if(aTempPointVector.size())
+ if(!aTempPointVector.empty())
{
// adapt tempVector entries to segment
adaptAndTransferCutsWithBezierSegment(aTempPointVector, aTempPolygon, nInd, rTempPoints);
@@ -715,7 +715,7 @@ namespace basegfx
rCubicA.adaptiveSubdivideByCount(aTempPolygon, SUBDIVIDE_FOR_CUT_TEST_COUNT);
findTouches(aTempPolygon, rPointPolygon, aTempPointVector);
- if(aTempPointVector.size())
+ if(!aTempPointVector.empty())
{
// adapt tempVector entries to segment
adaptAndTransferCutsWithBezierSegment(aTempPointVector, aTempPolygon, nInd, rTempPoints);
diff --git a/basegfx/source/polygon/b2dpolygontriangulator.cxx b/basegfx/source/polygon/b2dpolygontriangulator.cxx
index 66666e55a563..121211d2501b 100644
--- a/basegfx/source/polygon/b2dpolygontriangulator.cxx
+++ b/basegfx/source/polygon/b2dpolygontriangulator.cxx
@@ -261,7 +261,7 @@ namespace basegfx
}
}
- if(maStartEntries.size())
+ if(!maStartEntries.empty())
{
// sort initial list
::std::sort(maStartEntries.begin(), maStartEntries.end());
diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx
index 8c43bfecda9d..fc2a43ba81da 100644
--- a/basegfx/source/polygon/b2dtrapezoid.cxx
+++ b/basegfx/source/polygon/b2dtrapezoid.cxx
@@ -550,7 +550,7 @@ namespace basegfx
}
}
- if(maTrDeEdgeEntries.size())
+ if(!maTrDeEdgeEntries.empty())
{
// single and initial sort of traversing edges
maTrDeEdgeEntries.sort();
diff --git a/basegfx/source/raster/rasterconvert3d.cxx b/basegfx/source/raster/rasterconvert3d.cxx
index 3ff9486d37ac..9c9c8e01b4b3 100644
--- a/basegfx/source/raster/rasterconvert3d.cxx
+++ b/basegfx/source/raster/rasterconvert3d.cxx
@@ -66,7 +66,7 @@ namespace basegfx
void RasterConverter3D::rasterconvertB3DArea(sal_Int32 nStartLine, sal_Int32 nStopLine)
{
- if(maLineEntries.size())
+ if(!maLineEntries.empty())
{
OSL_ENSURE(nStopLine >= nStartLine, "nStopLine is bigger than nStartLine (!)");
@@ -317,7 +317,7 @@ namespace basegfx
}
}
- if(maLineEntries.size())
+ if(!maLineEntries.empty())
{
rasterconvertB3DArea(nStartLine, nStopLine);
}
diff --git a/connectivity/source/drivers/mozab/MPreparedStatement.cxx b/connectivity/source/drivers/mozab/MPreparedStatement.cxx
index 2aa2dddb9750..e21ec2f803df 100644
--- a/connectivity/source/drivers/mozab/MPreparedStatement.cxx
+++ b/connectivity/source/drivers/mozab/MPreparedStatement.cxx
@@ -486,7 +486,7 @@ void OPreparedStatement::describeParameter()
{
::std::vector< OSQLParseNode*> aParseNodes;
scanParameter(m_pParseTree,aParseNodes);
- if(aParseNodes.size())
+ if(!aParseNodes.empty())
{
m_xParamColumns = new OSQLColumns();
const OSQLTables& xTabs = m_pSQLIterator->getTables();
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 2f66b410919e..a336a4b89658 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1181,7 +1181,7 @@ bool SpellDialog::GetNextSentence_Impl(bool bUseSavedSentence, bool bRecheck)
if(!bUseSavedSentence)
m_aSavedSentence = aSentence;
bool bHasReplaced = false;
- while(aSentence.size())
+ while(!aSentence.empty())
{
//apply all changes that are already part of the "ChangeAllList"
//returns true if the list still contains errors after the changes have been applied
@@ -1195,7 +1195,7 @@ bool SpellDialog::GetNextSentence_Impl(bool bUseSavedSentence, bool bRecheck)
break;
}
- if(aSentence.size())
+ if(!aSentence.empty())
{
SpellPortions::iterator aStart = aSentence.begin();
rtl::OUString sText;
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 47d3ba82d1a5..ba841629ec99 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -1217,7 +1217,7 @@ IMPL_LINK( TPGalleryThemeProperties, SelectFoundHdl, void *, EMPTYARG )
else
aCbxPreview.Disable();
- if( aFoundList.size() )
+ if( !aFoundList.empty() )
aBtnTakeAll.Enable();
else
aBtnTakeAll.Disable();
@@ -1258,7 +1258,7 @@ IMPL_LINK( TPGalleryThemeProperties, PreviewTimerHdl, void *, EMPTYARG )
IMPL_LINK( TPGalleryThemeProperties, EndSearchProgressHdl, SearchProgress *, EMPTYARG )
{
- if( aFoundList.size() )
+ if( !aFoundList.empty() )
{
aLbxFound.SelectEntryPos( 0 );
aBtnTakeAll.Enable();
diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
index b2f1bb5aab2e..25afcfe365ce 100644
--- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
@@ -128,7 +128,7 @@ namespace drawinglayer
Primitive2DSequence aRetval(rColors.size() ? rMatrices.size() + 1 : rMatrices.size());
// create solid fill with start color
- if(rColors.size())
+ if(!rColors.empty())
{
// create primitive
const Primitive2DReference xRef(
@@ -175,7 +175,7 @@ namespace drawinglayer
aRetval.realloc(nEntryCount);
- if(rColors.size())
+ if(!rColors.empty())
{
basegfx::B2DRange aOuterPolyRange(aOuterPoly.getB2DRange());
aOuterPolyRange.expand(getObjectRange());
@@ -193,7 +193,7 @@ namespace drawinglayer
aCombinedPolyPoly = basegfx::B2DPolyPolygon(aInnerPoly);
}
- if(rColors.size())
+ if(!rColors.empty())
{
aRetval[nIndex] = Primitive2DReference(new PolyPolygonColorPrimitive2D(
aCombinedPolyPoly, rColors[rColors.size() - 1]));
diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
index 0b6447c4101b..8b676cdef929 100644
--- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
@@ -55,7 +55,7 @@ namespace drawinglayer
// get slices
const Slice3DVector& rSliceVector = getSlices();
- if(rSliceVector.size())
+ if(!rSliceVector.empty())
{
sal_uInt32 a;
diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
index cc9cb8bc43ea..1639308f4d9c 100644
--- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
@@ -55,7 +55,7 @@ namespace drawinglayer
// get slices
const Slice3DVector& rSliceVector = getSlices();
- if(rSliceVector.size())
+ if(!rSliceVector.empty())
{
const bool bBackScale(!basegfx::fTools::equal(getBackScale(), 1.0));
const bool bClosedRotation(!bBackScale && getHorizontalSegments() && basegfx::fTools::equal(getRotation(), F_2PI));
diff --git a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
index b2a098cc8ad8..e4ee45f2a8cb 100644
--- a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
@@ -64,7 +64,7 @@ namespace drawinglayer
{
basegfx::B3DRange aRetval;
- if(rSlices.size())
+ if(!rSlices.empty())
{
for(sal_uInt32 a(0L); a < rSlices.size(); a++)
{
diff --git a/drawinglayer/source/processor2d/canvasprocessor.cxx b/drawinglayer/source/processor2d/canvasprocessor.cxx
index e916b293da9f..6dcdd99cb813 100644
--- a/drawinglayer/source/processor2d/canvasprocessor.cxx
+++ b/drawinglayer/source/processor2d/canvasprocessor.cxx
@@ -539,7 +539,7 @@ namespace drawinglayer
aStrokeAttribute.MiterLimit = 15.0; // degrees; maybe here (15.0 * F_PI180) is needed, not clear in the documentation
const ::std::vector< double >& rDotDashArray = rStrokeAttribute.getDotDashArray();
- if(rDotDashArray.size())
+ if(!rDotDashArray.empty())
{
aStrokeAttribute.DashArray = uno::Sequence< double >(&rDotDashArray[0], rDotDashArray.size());
}
diff --git a/drawinglayer/source/processor2d/vclhelpergradient.cxx b/drawinglayer/source/processor2d/vclhelpergradient.cxx
index 7564f000acbd..da7995a79c45 100644
--- a/drawinglayer/source/processor2d/vclhelpergradient.cxx
+++ b/drawinglayer/source/processor2d/vclhelpergradient.cxx
@@ -140,7 +140,7 @@ namespace drawinglayer
}
// draw last poly in last color
- if(rColors.size())
+ if(!rColors.empty())
{
const basegfx::BColor aFillColor(rColors[rColors.size() - 1L]);
rOutDev.SetFillColor(Color(aFillColor));
@@ -179,7 +179,7 @@ namespace drawinglayer
}
// draw last poly in last color
- if(rColors.size())
+ if(!rColors.empty())
{
const basegfx::BColor aFillColor(rColors[rColors.size() - 1L]);
rOutDev.SetFillColor(Color(aFillColor));
@@ -265,7 +265,7 @@ namespace drawinglayer
}
// paint them with mask using the XOR method
- if(aMatrices.size())
+ if(!aMatrices.empty())
{
if(bSimple)
{
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index d27826bd388b..c554eb818cb2 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -277,7 +277,7 @@ namespace drawinglayer
nLen = nChars;
}
- if(aTransformedDXArray.size())
+ if(!aTransformedDXArray.empty())
{
mpOutputDevice->DrawTextArray(
aStartPoint,
diff --git a/svtools/bmpmaker/bmpcore.cxx b/svtools/bmpmaker/bmpcore.cxx
index fd438ce980cb..5209a923d160 100644
--- a/svtools/bmpmaker/bmpcore.cxx
+++ b/svtools/bmpmaker/bmpcore.cxx
@@ -91,7 +91,7 @@ void BmpCreator::ImplCreate( const ::std::vector< DirEntry >& rInDirs,
if( pCollectStm )
pCollectStm->Seek( STREAM_SEEK_TO_END );
- if( rInDirs.size() )
+ if( !rInDirs.empty() )
{
ByteString aLine;
String aInfo, aPrefix, aName( rName ), aString;
diff --git a/svtools/source/filter/wmf/winmtf.cxx b/svtools/source/filter/wmf/winmtf.cxx
index 3ae1dff17dc3..090886e82678 100644
--- a/svtools/source/filter/wmf/winmtf.cxx
+++ b/svtools/source/filter/wmf/winmtf.cxx
@@ -2178,7 +2178,7 @@ void WinMtfOutput::Push() // !! to be able to access the o
void WinMtfOutput::Pop()
{
// Die aktuellen Daten vom Stack holen
- if( vSaveStack.size() )
+ if( !vSaveStack.empty() )
{
// Die aktuelle Daten auf dem Stack sichern
SaveStructPtr pSave( vSaveStack.back() );
diff --git a/svx/source/engine3d/helperhittest3d.cxx b/svx/source/engine3d/helperhittest3d.cxx
index 1a6e41ccbeba..c83cae99556e 100644
--- a/svx/source/engine3d/helperhittest3d.cxx
+++ b/svx/source/engine3d/helperhittest3d.cxx
@@ -279,7 +279,7 @@ bool checkHitSingle3DObject(
::std::vector< basegfx::B3DPoint > aHitsWithObject;
getAllHit3DObjectWithRelativePoint(aFront, aBack, rCandidate, aViewInfo3D, aHitsWithObject, true);
- if(aHitsWithObject.size())
+ if(!aHitsWithObject.empty())
{
return true;
}
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index f759441830c1..0817150b20f8 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -2933,7 +2933,7 @@ const SwTableBox* SwCollectTblLineBoxes::GetBoxOfPos( const SwTableBox& rBox )
const SwTableBox* pRet = 0;
sal_uInt16 n;
- if( aPosArr.size() )
+ if( !aPosArr.empty() )
{
for( n = 0; n < aPosArr.size(); ++n )
if( aPosArr[ n ] == nWidth )
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 33697fc8bce8..fdfe3c698b1f 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -1020,7 +1020,7 @@ lcl_GetNextIndex(
SwSoftPageBreakList const & rBreakArr )
{
sal_Int32 nRet = -1;
- if(rBkmArr.size())
+ if(!rBkmArr.empty())
{
SwXBookmarkPortion_ImplSharedPtr pPtr = (*rBkmArr.begin());
nRet = pPtr->getIndex();
@@ -1032,7 +1032,7 @@ lcl_GetNextIndex(
if(nRet < 0 || nTmp < nRet)
nRet = nTmp;
}
- if(rBreakArr.size())
+ if(!rBreakArr.empty())
{
if(nRet < 0 || *rBreakArr.begin() < static_cast<sal_uInt32>(nRet))
nRet = *rBreakArr.begin();