summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-19 08:12:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-19 10:02:39 +0200
commit2c1b7e8d6a7fa22cb91919238418816671c3a497 (patch)
tree6f356017d24dffcd25261295ab25a21b738dc835 /oox
parentad18bb24d51e4f735085d50c496d28bd637dbb0b (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 'oox')
-rw-r--r--oox/source/drawingml/chart/plotareaconverter.cxx2
-rw-r--r--oox/source/drawingml/chart/seriesconverter.cxx2
-rw-r--r--oox/source/drawingml/chart/typegroupconverter.cxx2
-rw-r--r--oox/source/drawingml/customshapeproperties.cxx6
-rw-r--r--oox/source/drawingml/shape.cxx6
-rw-r--r--oox/source/drawingml/textbody.cxx2
-rw-r--r--oox/source/drawingml/textparagraph.cxx6
-rw-r--r--oox/source/vml/vmlformatting.cxx4
8 files changed, 15 insertions, 15 deletions
diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx
index c562ea82837a..f3a4b8ebe493 100644
--- a/oox/source/drawingml/chart/plotareaconverter.cxx
+++ b/oox/source/drawingml/chart/plotareaconverter.cxx
@@ -369,7 +369,7 @@ void PlotAreaConverter::convertFromModel( View3DModel& rView3DModel )
pAxesSet = &aAxesSets.create();
// find axis models used by the type group
const std::vector<sal_Int32>& rAxisIds = typeGroup->maAxisIds;
- if( rAxisIds.size() >= 1 )
+ if( !rAxisIds.empty() )
pAxesSet->maAxes[ API_X_AXIS ] = aAxisMap.get( rAxisIds[ 0 ] );
if( rAxisIds.size() >= 2 )
pAxesSet->maAxes[ API_Y_AXIS ] = aAxisMap.get( rAxisIds[ 1 ] );
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index 7e35fc6f2628..811ee06497b2 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -285,7 +285,7 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat
if (mrModel.mxShapeProp)
importBorderProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper());
- if( mrModel.mxText && mrModel.mxText->mxTextBody && mrModel.mxText->mxTextBody->getParagraphs().size() )
+ if( mrModel.mxText && mrModel.mxText->mxTextBody && !mrModel.mxText->mxTextBody->getParagraphs().empty() )
{
css::uno::Reference< XComponentContext > xContext = getComponentContext();
uno::Sequence< css::uno::Reference< XDataPointCustomLabelField > > aSequence;
diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx
index 17e470fa812f..98623f750aca 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -287,7 +287,7 @@ Reference< XLabeledDataSequence > TypeGroupConverter::createCategorySequence()
}
}
/* n#839727 Create Category Sequence when none are found */
- if( !xLabeledSeq.is() && mrModel.maSeries.size() > 0 ) {
+ if( !xLabeledSeq.is() && !mrModel.maSeries.empty() ) {
if( nMaxValues < 0 )
nMaxValues = 2;
SeriesModel &aModel = *mrModel.maSeries.get(0);
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index 80a3c2a3e036..323831166f59 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -175,7 +175,7 @@ void CustomShapeProperties::pushToPropSet(
}
}
- if ( maAdjustmentGuideList.size() )
+ if ( !maAdjustmentGuideList.empty() )
{
const OUString sType = "Type";
if ( aGeoPropSet >>= aGeoPropSeq )
@@ -237,7 +237,7 @@ void CustomShapeProperties::pushToPropSet(
// This size specifically affects scaling.
// Note 2: Width and Height are set to 0 to force scaling to 1.
awt::Rectangle aViewBox( 0, 0, aSize.Width, aSize.Height );
- if( maGuideList.size() )
+ if( !maGuideList.empty() )
aViewBox = awt::Rectangle( 0, 0, 0, 0 );
aPropertyMap.setProperty( PROP_ViewBox, aViewBox);
@@ -276,7 +276,7 @@ void CustomShapeProperties::pushToPropSet(
aParameterPairs[ k++ ] = j;
aPath.setProperty( PROP_Coordinates, aParameterPairs);
- if ( maPath2DList.size() )
+ if ( !maPath2DList.empty() )
{
bool bAllZero = true;
for ( auto const & i: maPath2DList )
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 2676d43060fb..0872a8b0cf56 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -450,7 +450,7 @@ static void lcl_createPresetShape(uno::Reference<drawing::XShape>& xShape,
auto aGdList = pCustomShapePropertiesPtr->getAdjustmentGuideList();
Sequence<drawing::EnhancedCustomShapeAdjustmentValue> aAdjustment(
- aGdList.size() ? aGdList.size() : 1 );
+ !aGdList.empty() ? aGdList.size() : 1 );
int nIndex = 0;
for (auto& aEntry : aGdList)
@@ -462,7 +462,7 @@ static void lcl_createPresetShape(uno::Reference<drawing::XShape>& xShape,
aAdjustment[nIndex++].State = css::beans::PropertyState_DIRECT_VALUE;
}
- if (!aGdList.size())
+ if (aGdList.empty())
{
// Default angle
double fAngle = 0;
@@ -479,7 +479,7 @@ static void lcl_createPresetShape(uno::Reference<drawing::XShape>& xShape,
xSet->setPropertyValue( UNO_NAME_FILLSTYLE, uno::makeAny( drawing::FillStyle_SOLID ) );
const TextParagraphVector& rParagraphs = pTextBody->getParagraphs();
- if (rParagraphs.size() && rParagraphs[0]->getRuns().size())
+ if (!rParagraphs.empty() && !rParagraphs[0]->getRuns().empty())
{
std::shared_ptr<TextParagraph> pParagraph = rParagraphs[0];
std::shared_ptr<TextRun> pRun = pParagraph->getRuns()[0];
diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx
index 7730ef03dcd9..55989a470a3f 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -88,7 +88,7 @@ bool TextBody::isEmpty() const
return false;
const TextRunVector aRuns = maParagraphs[0]->getRuns();
- if ( aRuns.size() <= 0 )
+ if ( aRuns.empty() )
return true;
if ( aRuns.size() > 1 )
return false;
diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx
index 5c8143dbd673..39d298612882 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -70,7 +70,7 @@ TextParagraphPropertiesPtr TextParagraph::getParagraphStyle(
if (nLevel >= static_cast< sal_Int16 >(rListStyle.size()))
nLevel = 0;
TextParagraphPropertiesPtr pTextParagraphStyle;
- if (rListStyle.size())
+ if (!rListStyle.empty())
pTextParagraphStyle = rListStyle[nLevel];
return pTextParagraphStyle;
@@ -134,12 +134,12 @@ void TextParagraph::insertAt(
aParaProp.apply( maProperties );
// bullets have same color as following texts by default
- if( !aioBulletList.hasProperty( PROP_BulletColor ) && maRuns.size() > 0
+ if( !aioBulletList.hasProperty( PROP_BulletColor ) && !maRuns.empty()
&& (*maRuns.begin())->getTextCharacterProperties().maFillProperties.moFillType.has() )
aioBulletList.setProperty( PROP_BulletColor, (*maRuns.begin())->getTextCharacterProperties().maFillProperties.getBestSolidColor().getColor( rFilterBase.getGraphicHelper() ));
if( !aioBulletList.hasProperty( PROP_BulletColor ) && aTextCharacterStyle.maFillProperties.moFillType.has() )
aioBulletList.setProperty( PROP_BulletColor, aTextCharacterStyle.maFillProperties.getBestSolidColor().getColor( rFilterBase.getGraphicHelper() ));
- if( !aioBulletList.hasProperty( PROP_GraphicSize ) && maRuns.size() > 0
+ if( !aioBulletList.hasProperty( PROP_GraphicSize ) && !maRuns.empty()
&& aParaProp.getBulletList().maGraphic.hasValue())
{
long nFirstCharHeightMm = TransformMetric(nCharHeightFirst > 0 ? nCharHeightFirst : 1200, FUNIT_POINT, FUNIT_MM);
diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index cbd40329ffe8..0dc6a766fee9 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -342,7 +342,7 @@ void ConversionHelper::decodeVmlPath( ::std::vector< ::std::vector< Point > >& r
{
case MOVE_REL:
aCoordList.resize(2, 0); // 2* params -> param count reset
- if ( rPointLists.size() > 0 && rPointLists.back().size() > 0 )
+ if ( !rPointLists.empty() && !rPointLists.back().empty() )
{
rPointLists.emplace_back( );
rFlagLists.emplace_back( );
@@ -355,7 +355,7 @@ void ConversionHelper::decodeVmlPath( ::std::vector< ::std::vector< Point > >& r
case MOVE_ABS:
aCoordList.resize(2, 0); // 2 params -> no param count reset
- if ( rPointLists.size() > 0 && rPointLists.back().size() > 0 )
+ if ( !rPointLists.empty() && !rPointLists.back().empty() )
{
rPointLists.emplace_back( );
rFlagLists.emplace_back( );