diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-19 08:12:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-19 10:02:39 +0200 |
commit | 2c1b7e8d6a7fa22cb91919238418816671c3a497 (patch) | |
tree | 6f356017d24dffcd25261295ab25a21b738dc835 /drawinglayer | |
parent | ad18bb24d51e4f735085d50c496d28bd637dbb0b (diff) |
clang-tidy readability-container-size-empty
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422
Reviewed-on: https://gerrit.libreoffice.org/61967
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer')
14 files changed, 20 insertions, 20 deletions
diff --git a/drawinglayer/source/attribute/strokeattribute.cxx b/drawinglayer/source/attribute/strokeattribute.cxx index 547f4dd97ebe..34324b6e0fda 100644 --- a/drawinglayer/source/attribute/strokeattribute.cxx +++ b/drawinglayer/source/attribute/strokeattribute.cxx @@ -51,7 +51,7 @@ namespace drawinglayer const std::vector< double >& getDotDashArray() const { return maDotDashArray; } double getFullDotDashLen() const { - if(0.0 == mfFullDotDashLen && maDotDashArray.size()) + if(0.0 == mfFullDotDashLen && !maDotDashArray.empty()) { // calculate length on demand const double fAccumulated(std::accumulate(maDotDashArray.begin(), maDotDashArray.end(), 0.0)); diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx index a890288e5e30..1e890358c25b 100644 --- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx @@ -187,7 +187,7 @@ namespace drawinglayer basegfx::B2DRange aOutmostRange(getOutputRange()); basegfx::B2DPolyPolygon aCombinedPolyPoly; - if(rEntries.size()) + if(!rEntries.empty()) { // extend aOutmostRange with first polygon basegfx::B2DPolygon aFirstPoly(rUnitPolygon); @@ -204,7 +204,7 @@ namespace drawinglayer aCombinedPolyPoly, rOuterColor)); - if(rEntries.size()) + if(!rEntries.empty()) { // reuse first polygon, it's the second one aCombinedPolyPoly.remove(0); diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx index 35ac0366a0fa..50aa48efe333 100644 --- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx @@ -110,7 +110,7 @@ namespace drawinglayer aTransformedGraphic, aTransform); - if(!aRetval.size()) + if(aRetval.empty()) { // content is invisible, done return; @@ -131,7 +131,7 @@ namespace drawinglayer o3tl::clamp(aSuppressGraphicAttr.GetGamma(), 0.0, 10.0), aSuppressGraphicAttr.IsInvert()); - if(!aRetval.size()) + if(aRetval.empty()) { // content is invisible, done return; diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx index bb0430d3fa68..9487ddbad0b7 100644 --- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx @@ -177,7 +177,7 @@ namespace drawinglayer if (mbBufferingAllowed) { // all frames buffered - if (mbBufferingAllowed && maBufferedPrimitives.size() && nIndex < maBufferedPrimitives.size()) + if (mbBufferingAllowed && !maBufferedPrimitives.empty() && nIndex < maBufferedPrimitives.size()) { if (!maBufferedPrimitives[nIndex].is()) { @@ -300,7 +300,7 @@ namespace drawinglayer if (mbBufferingAllowed) { // all frames buffered, check if available - if (maBufferedPrimitives.size() && nIndex < maBufferedPrimitives.size()) + if (!maBufferedPrimitives.empty() && nIndex < maBufferedPrimitives.size()) { if (maBufferedPrimitives[nIndex].is()) { @@ -574,7 +574,7 @@ namespace drawinglayer { Primitive2DContainer aRetval; - if(!rChildren.size()) + if(rChildren.empty()) { // no child content, done return aRetval; diff --git a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx index d9865d100e4a..9b6b9774ba82 100644 --- a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx @@ -96,7 +96,7 @@ namespace drawinglayer { basegfx::B2DRange aRetval; - if(getPositions().size()) + if(!getPositions().empty()) { // get the basic range from the position vector for (auto const& pos : getPositions()) diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx index 52f5137824dc..1b1052fd649c 100644 --- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx @@ -140,7 +140,7 @@ namespace drawinglayer const double fShadowSlant(getSdrSceneAttribute().getShadowSlant()); const basegfx::B3DRange aScene3DRange(getChildren3D().getB3DRange(getViewInformation3D())); - if(maSdrLightingAttribute.getLightVector().size()) + if(!maSdrLightingAttribute.getLightVector().empty()) { // get light normal from first light and normalize aLightNormal = maSdrLightingAttribute.getLightVector()[0].getDirection(); diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx index d155e75c46cc..d5e8a23ddd47 100644 --- a/drawinglayer/source/primitive2d/textprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx @@ -122,7 +122,7 @@ namespace drawinglayer // When getting outlines from stretched text (aScale.getX() != 1.0) it // is necessary to inverse-scale the DXArray (if used) to not get the // outlines already aligned to given, but wrong DXArray - if(getDXArray().size() && !basegfx::fTools::equal(aScale.getX(), 1.0)) + if(!getDXArray().empty() && !basegfx::fTools::equal(aScale.getX(), 1.0)) { std::vector< double > aScaledDXArray = getDXArray(); const double fDXArrayScale(1.0 / aScale.getX()); diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx index dcea2f877543..cbcbfda8b649 100644 --- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx +++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx @@ -172,7 +172,7 @@ namespace drawinglayer { Primitive3DContainer aRetval; - if(r3DPolyPolygonVector.size()) + if(!r3DPolyPolygonVector.empty()) { // create list of simple fill primitives aRetval.resize(r3DPolyPolygonVector.size()); diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx index 057dbe127fdb..4a22113bb8cd 100644 --- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx @@ -377,7 +377,7 @@ namespace drawinglayer { // This can be made dependent of getSdrLFSAttribute().getFill() and getSdrLFSAttribute().getLine() // again when no longer geometry is needed for non-visible 3D objects as it is now for chart - if(getPolyPolygon().count() && !maSlices.size()) + if(getPolyPolygon().count() && maSlices.empty()) { ::osl::MutexGuard aGuard( m_aMutex ); diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx index e0a9bc3adc80..363f174b3494 100644 --- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx @@ -229,7 +229,7 @@ namespace drawinglayer { // This can be made dependent of getSdrLFSAttribute().getFill() and getSdrLFSAttribute().getLine() // again when no longer geometry is needed for non-visible 3D objects as it is now for chart - if(getPolyPolygon().count() && !maSlices.size()) + if(getPolyPolygon().count() && maSlices.empty()) { ::osl::MutexGuard aGuard( m_aMutex ); diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx index d0d428370d41..17f740587931 100644 --- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx +++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx @@ -199,7 +199,7 @@ namespace drawinglayer true); aCutFindProcessor.process(rPrimitives); - mbHit = (0 != aCutFindProcessor.getCutPoints().size()); + mbHit = (!aCutFindProcessor.getCutPoints().empty()); } } } diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 206ff787b40a..de94ac307120 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -230,7 +230,7 @@ namespace drawinglayer // create transformed integer DXArray in view coordinate system std::vector< long > aTransformedDXArray; - if(rTextCandidate.getDXArray().size()) + if(!rTextCandidate.getDXArray().empty()) { aTransformedDXArray.reserve(rTextCandidate.getDXArray().size()); const basegfx::B2DVector aPixelVector(maCurrentTransformation * basegfx::B2DVector(1.0, 0.0)); @@ -262,7 +262,7 @@ namespace drawinglayer sal_Int32 nPos = rTextCandidate.getTextPosition(); sal_Int32 nLen = rTextCandidate.getTextLength(); - long* pDXArray = aTransformedDXArray.size() ? &(aTransformedDXArray[0]) : nullptr ; + long* pDXArray = !aTransformedDXArray.empty() ? &(aTransformedDXArray[0]) : nullptr ; if ( rTextCandidate.isFilled() ) { diff --git a/drawinglayer/source/processor3d/cutfindprocessor3d.cxx b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx index 04a37a73c2ad..aa8479527bb6 100644 --- a/drawinglayer/source/processor3d/cutfindprocessor3d.cxx +++ b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx @@ -47,7 +47,7 @@ namespace drawinglayer void CutFindProcessor::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate) { - if(mbAnyHit && maResult.size()) + if(mbAnyHit && !maResult.empty()) { // stop processing as soon as a hit was recognized return; @@ -132,7 +132,7 @@ namespace drawinglayer const primitive3d::UnifiedTransparenceTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::UnifiedTransparenceTexturePrimitive3D& >(rCandidate); const primitive3d::Primitive3DContainer& rChildren = rPrimitive.getChildren(); - if(rChildren.size()) + if(!rChildren.empty()) { process(rChildren); } diff --git a/drawinglayer/source/processor3d/shadow3dextractor.cxx b/drawinglayer/source/processor3d/shadow3dextractor.cxx index 35032588c766..10e9143f2f40 100644 --- a/drawinglayer/source/processor3d/shadow3dextractor.cxx +++ b/drawinglayer/source/processor3d/shadow3dextractor.cxx @@ -248,7 +248,7 @@ namespace drawinglayer Shadow3DExtractingProcessor::~Shadow3DExtractingProcessor() { - OSL_ENSURE(0 == maPrimitive2DSequence.size(), + OSL_ENSURE(maPrimitive2DSequence.empty(), "OOps, someone used Shadow3DExtractingProcessor, but did not fetch the results (!)"); } |