diff options
239 files changed, 371 insertions, 371 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 4cbd2fe8c6b0..627c62eb0ec9 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -877,7 +877,7 @@ void EditorWindow::HandleCodeCompletion() std::vector< OUString > aMethVect = aTypeCompletor.GetXIdlClassMethods();//methods aEntryVect.insert(aEntryVect.end(), aMethVect.begin(), aMethVect.end() ); } - if( aEntryVect.size() > 0 ) + if( !aEntryVect.empty() ) SetupAndShowCodeCompleteWnd( aEntryVect, aSel ); } } diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx index 067c70ff3eb1..20c92eef08bc 100644 --- a/basegfx/source/polygon/b2dpolypolygontools.cxx +++ b/basegfx/source/polygon/b2dpolypolygontools.cxx @@ -219,7 +219,7 @@ namespace basegfx void applyLineDashing(const B2DPolyPolygon& rCandidate, const std::vector<double>& rDotDashArray, B2DPolyPolygon* pLineTarget, double fFullDashDotLen) { - if(fFullDashDotLen == 0.0 && rDotDashArray.size()) + if(fFullDashDotLen == 0.0 && !rDotDashArray.empty()) { // calculate fFullDashDotLen from rDotDashArray fFullDashDotLen = std::accumulate(rDotDashArray.begin(), rDotDashArray.end(), 0.0); diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx index f59d1f16bb21..9bff42a0d0a6 100644 --- a/basegfx/source/polygon/b2dtrapezoid.cxx +++ b/basegfx/source/polygon/b2dtrapezoid.cxx @@ -210,7 +210,7 @@ namespace basegfx ~PointBlockAllocator() { - while(maBlocks.size() > 0) + while(!maBlocks.empty()) { delete [] maBlocks.back(); maBlocks.pop_back(); diff --git a/basegfx/source/raster/rasterconvert3d.cxx b/basegfx/source/raster/rasterconvert3d.cxx index ef9ba7dd8bbe..d6169b7ad9fe 100644 --- a/basegfx/source/raster/rasterconvert3d.cxx +++ b/basegfx/source/raster/rasterconvert3d.cxx @@ -74,7 +74,7 @@ namespace basegfx // get scanlines first LineNumber as start sal_Int32 nLineNumber(std::max(aCurrentEntry->getY(), nStartLine)); - while((aCurrentLine.size() || aCurrentEntry != maLineEntries.end()) && (nLineNumber < nStopLine)) + while((!aCurrentLine.empty() || aCurrentEntry != maLineEntries.end()) && (nLineNumber < nStopLine)) { // add all entries which start at current line to current scanline while(aCurrentEntry != maLineEntries.end()) diff --git a/basegfx/test/basegfx2d.cxx b/basegfx/test/basegfx2d.cxx index acc28f91014b..9af87302847a 100644 --- a/basegfx/test/basegfx2d.cxx +++ b/basegfx/test/basegfx2d.cxx @@ -700,7 +700,7 @@ public: B2DTrapezoidVector aVector; basegfx::utils::trapezoidSubdivide(aVector, aPolyPolygon); CPPUNIT_ASSERT_MESSAGE("more than zero sub-divided trapezoids", - aVector.size() > 0); + !aVector.empty()); } // Change the following lines only, if you add, remove or rename diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 434b5ffd36ae..944836865545 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -1149,7 +1149,7 @@ void SbModule::implProcessModuleRunInit( ModuleInitDependencyMap& rMap, ClassMod if( pModule->pClassData != nullptr ) { std::vector< OUString >& rReqTypes = pModule->pClassData->maRequiredTypes; - if( rReqTypes.size() > 0 ) + if( !rReqTypes.empty() ) { for( const auto& rStr : rReqTypes ) { diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index 49cf24da5214..bce2469d6b9d 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -460,7 +460,7 @@ namespace cairocanvas "Size:(" << aFont.GetAverageFontWidth() << "," << aFont.GetFontHeight() << "), Pos (" << rOutpos.X() << "," << rOutpos.Y() << "), G(" - << (cairo_glyphs.size() > 0 ? cairo_glyphs[0].index : -1) + << (!cairo_glyphs.empty() ? cairo_glyphs[0].index : -1) << "," << (cairo_glyphs.size() > 1 ? cairo_glyphs[1].index : -1) << "," diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index 2a05b9303f5f..c554cf3f7f30 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -1453,7 +1453,7 @@ bool WrappedNumberOfLinesProperty::detectInnerValue( uno::Any& rInnerValue ) con { std::vector< uno::Reference< chart2::XDataSeries > > aSeriesVector( DiagramHelper::getDataSeriesFromDiagram( xDiagram ) ); - if( aSeriesVector.size() > 0 ) + if( !aSeriesVector.empty() ) { Reference< lang::XMultiServiceFactory > xFact( xChartDoc->getChartTypeManager(), uno::UNO_QUERY ); DiagramHelper::tTemplateWithServiceName aTemplateAndService = diff --git a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx index 4ede52c2bec9..ce856e20b60a 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx @@ -131,7 +131,7 @@ css::uno::Any WrappedVolumeProperty::getPropertyValue( const css::uno::Reference { std::vector< uno::Reference< chart2::XDataSeries > > aSeriesVector( DiagramHelper::getDataSeriesFromDiagram( xDiagram ) ); - if( aSeriesVector.size() > 0 ) + if( !aSeriesVector.empty() ) { Reference< lang::XMultiServiceFactory > xFact( xChartDoc->getChartTypeManager(), uno::UNO_QUERY ); DiagramHelper::tTemplateWithServiceName aTemplateAndService = @@ -196,7 +196,7 @@ css::uno::Any WrappedUpDownProperty::getPropertyValue( const css::uno::Reference { std::vector< uno::Reference< chart2::XDataSeries > > aSeriesVector( DiagramHelper::getDataSeriesFromDiagram( xDiagram ) ); - if( aSeriesVector.size() > 0 ) + if( !aSeriesVector.empty() ) { Reference< lang::XMultiServiceFactory > xFact( xChartDoc->getChartTypeManager(), uno::UNO_QUERY ); DiagramHelper::tTemplateWithServiceName aTemplateAndService = diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index 0e627e6787e6..61b531cfc419 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -482,7 +482,7 @@ void SAL_CALL Diagram::addCoordinateSystem( != m_aCoordSystems.end()) throw lang::IllegalArgumentException(); - if( m_aCoordSystems.size()>=1 ) + if( !m_aCoordSystems.empty() ) { OSL_FAIL( "more than one coordinatesystem is not supported yet by the fileformat" ); return; diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx index 70e8e62f5824..6c50ba35aeea 100644 --- a/chart2/source/view/charttypes/BarChart.cxx +++ b/chart2/source/view/charttypes/BarChart.cxx @@ -924,7 +924,7 @@ void BarChart::createShapes() for( auto const& rZSlot : m_aZSlots ) { BarPositionHelper* pPosHelper = m_pMainPosHelper.get(); - if( rZSlot.size() ) + if( !rZSlot.empty() ) { sal_Int32 nAttachedAxisIndex = rZSlot.front().getAttachedAxisIndexForFirstSeries(); //2ND_AXIS_IN_BARS so far one can assume to have the same plotter for each z slot diff --git a/chart2/source/view/charttypes/CandleStickChart.cxx b/chart2/source/view/charttypes/CandleStickChart.cxx index cff376eac322..e3ed188f4ea7 100644 --- a/chart2/source/view/charttypes/CandleStickChart.cxx +++ b/chart2/source/view/charttypes/CandleStickChart.cxx @@ -145,7 +145,7 @@ void CandleStickChart::createShapes() { sal_Int32 nAttachedAxisIndex = 0; BarPositionHelper* pPosHelper = m_pMainPosHelper.get(); - if( rZSlot.size() ) + if( !rZSlot.empty() ) { nAttachedAxisIndex = rZSlot.front().getAttachedAxisIndexForFirstSeries(); //2ND_AXIS_IN_BARS so far one can assume to have the same plotter for each z slot diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index 0a3716df0f98..47fe81a1ab98 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -1573,7 +1573,7 @@ double VSeriesPlotter::getMinimumZ() } double VSeriesPlotter::getMaximumZ() { - if( m_nDimension!=3 || !m_aZSlots.size() ) + if( m_nDimension!=3 || m_aZSlots.empty() ) return getMinimumZ()+1; return m_aZSlots.size(); } diff --git a/comphelper/source/container/container.cxx b/comphelper/source/container/container.cxx index a9edef8a458f..1a6132e0d65a 100644 --- a/comphelper/source/container/container.cxx +++ b/comphelper/source/container/container.cxx @@ -72,7 +72,7 @@ css::uno::Reference< css::uno::XInterface> const & IndexAccessIterator::Next() } else { // otherwise, look above and to the right, if possible - while (m_arrChildIndizies.size() > 0) + while (!m_arrChildIndizies.empty()) { // If the list isn't empty and there's nothing above css::uno::Reference< css::container::XChild> xChild(xSearchLoop, css::uno::UNO_QUERY); OSL_ENSURE(xChild.is(), "IndexAccessIterator::Next : a content has no appropriate interface !"); diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index 456c1f605bdc..cd927faa2bb8 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -234,7 +234,7 @@ uno::Sequence < OUString > EmbeddedObjectContainer::GetObjectNames() const bool EmbeddedObjectContainer::HasEmbeddedObjects() const { - return pImpl->maObjectContainer.size() != 0; + return !pImpl->maObjectContainer.empty(); } bool EmbeddedObjectContainer::HasEmbeddedObject( const OUString& rName ) diff --git a/comphelper/source/misc/numberedcollection.cxx b/comphelper/source/misc/numberedcollection.cxx index 8b742d295cf9..8f5f2061fc1c 100644 --- a/comphelper/source/misc/numberedcollection.cxx +++ b/comphelper/source/misc/numberedcollection.cxx @@ -221,7 +221,7 @@ OUString SAL_CALL NumberedCollection::getUntitledPrefix() impl_cleanUpDeadItems(m_lComponents, lDeadItems); // a) non free numbers ... return INVALID_NUMBER - if (lPossibleNumbers.size () < 1) + if (lPossibleNumbers.empty()) return css::frame::UntitledNumbersConst::INVALID_NUMBER; // b) return first free number diff --git a/comphelper/source/xml/ofopxmlhelper.cxx b/comphelper/source/xml/ofopxmlhelper.cxx index 4a2bf122b39e..99ccf04f7ae2 100644 --- a/comphelper/source/xml/ofopxmlhelper.cxx +++ b/comphelper/source/xml/ofopxmlhelper.cxx @@ -291,7 +291,7 @@ OFOPXMLHelper_Impl::OFOPXMLHelper_Impl( sal_uInt16 nFormat ) uno::Sequence< uno::Sequence< beans::StringPair > > const & OFOPXMLHelper_Impl::GetParsingResult() const { - if ( m_aElementsSeq.size() ) + if ( !m_aElementsSeq.empty() ) throw uno::RuntimeException(); // the parsing has still not finished! return m_aResultSeq; diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx index 3a034b45d9a3..3b17ce8f54c9 100644 --- a/connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx +++ b/connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx @@ -36,7 +36,7 @@ ODatabaseMetaDataResultSetMetaData::~ODatabaseMetaDataResultSetMetaData() sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) { - if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) + if(!m_mColumns.empty() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) return (*m_mColumnsIter).second.getColumnDisplaySize(); return 0; @@ -44,7 +44,7 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnDisplaySize( sal sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnType( sal_Int32 column ) { - if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) + if(!m_mColumns.empty() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) return (*m_mColumnsIter).second.getColumnType(); return 1; } @@ -56,7 +56,7 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnCount( ) sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isCaseSensitive( sal_Int32 column ) { - if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) + if(!m_mColumns.empty() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) return (*m_mColumnsIter).second.isCaseSensitive(); return true; } @@ -68,14 +68,14 @@ OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getSchemaName( sal_Int32 / OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnName( sal_Int32 column ) { - if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) + if(!m_mColumns.empty() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) return (*m_mColumnsIter).second.getColumnName(); return OUString(); } OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getTableName( sal_Int32 column ) { - if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) + if(!m_mColumns.empty() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) return (*m_mColumnsIter).second.getTableName(); return OUString(); } @@ -92,7 +92,7 @@ OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnTypeName( sal_Int OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnLabel( sal_Int32 column ) { - if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) + if(!m_mColumns.empty() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) return (*m_mColumnsIter).second.getColumnLabel(); return getColumnName(column); } @@ -104,35 +104,35 @@ OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnServiceName( sal_ sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isCurrency( sal_Int32 column ) { - if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) + if(!m_mColumns.empty() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) return (*m_mColumnsIter).second.isCurrency(); return false; } sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isAutoIncrement( sal_Int32 column ) { - if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) + if(!m_mColumns.empty() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) return (*m_mColumnsIter).second.isAutoIncrement(); return false; } sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isSigned( sal_Int32 column ) { - if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) + if(!m_mColumns.empty() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) return (*m_mColumnsIter).second.isSigned(); return false; } sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getPrecision( sal_Int32 column ) { - if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) + if(!m_mColumns.empty() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) return (*m_mColumnsIter).second.getPrecision(); return 0; } sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getScale( sal_Int32 column ) { - if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) + if(!m_mColumns.empty() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) return (*m_mColumnsIter).second.getScale(); return 0; @@ -140,7 +140,7 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getScale( sal_Int32 colum sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::isNullable( sal_Int32 column ) { - if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) + if(!m_mColumns.empty() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) return (*m_mColumnsIter).second.isNullable(); return sal_Int32(false); @@ -148,7 +148,7 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::isNullable( sal_Int32 col sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isSearchable( sal_Int32 column ) { - if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) + if(!m_mColumns.empty() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end()) return (*m_mColumnsIter).second.isSearchable(); return true; } diff --git a/connectivity/source/commontools/RowFunctionParser.cxx b/connectivity/source/commontools/RowFunctionParser.cxx index f5942c8f7b0f..0bf991deabd1 100644 --- a/connectivity/source/commontools/RowFunctionParser.cxx +++ b/connectivity/source/commontools/RowFunctionParser.cxx @@ -253,7 +253,7 @@ public: ParserContext::OperandStack& rNodeStack( mpContext->maOperandStack ); - if( rNodeStack.size() < 1 ) + if( rNodeStack.empty() ) throw ParseError( "Not enough arguments for unary operator" ); // retrieve arguments diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index 7b9bb2e52984..a52bb4e97642 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -348,7 +348,7 @@ void OTableHelper::refreshPrimaryKeys(::std::vector< OUString>& _rNames) if(bAlreadyFetched) { SAL_WARN_IF(aPkName.isEmpty(),"connectivity.commontools", "empty Primary Key name"); - SAL_WARN_IF(pKeyProps->m_aKeyColumnNames.size() == 0,"connectivity.commontools", "Primary Key has no columns"); + SAL_WARN_IF(pKeyProps->m_aKeyColumnNames.empty(),"connectivity.commontools", "Primary Key has no columns"); m_pImpl->m_aKeys.emplace(aPkName,pKeyProps); _rNames.push_back(aPkName); } diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx index e1184f3d69ee..ffa43f04644a 100644 --- a/connectivity/source/commontools/parameters.cxx +++ b/connectivity/source/commontools/parameters.cxx @@ -735,7 +735,7 @@ namespace dbtools // fill the parameters from the master-detail relationship Reference< XNameAccess > xParentColumns; - if ( getParentColumns( xParentColumns, false ) && xParentColumns->hasElements() && m_aMasterFields.size() ) + if ( getParentColumns( xParentColumns, false ) && xParentColumns->hasElements() && !m_aMasterFields.empty() ) fillLinkedParameters( xParentColumns ); // let the user (via the interaction handler) fill all remaining parameters diff --git a/connectivity/source/drivers/mork/MPreparedStatement.cxx b/connectivity/source/drivers/mork/MPreparedStatement.cxx index 442dc9060822..b252a02b070b 100644 --- a/connectivity/source/drivers/mork/MPreparedStatement.cxx +++ b/connectivity/source/drivers/mork/MPreparedStatement.cxx @@ -436,7 +436,7 @@ void OPreparedStatement::describeParameter() { m_xParamColumns = new OSQLColumns(); const OSQLTables& rTabs = m_pSQLIterator->getTables(); - if(rTabs.size()) + if(!rTabs.empty()) { OSQLTable xTable = rTabs.begin()->second; for (auto const& parseNode : aParseNodes) diff --git a/connectivity/source/drivers/mork/MorkParser.cxx b/connectivity/source/drivers/mork/MorkParser.cxx index 0b31c3e0e4cc..989455c37593 100644 --- a/connectivity/source/drivers/mork/MorkParser.cxx +++ b/connectivity/source/drivers/mork/MorkParser.cxx @@ -324,7 +324,7 @@ bool MorkParser::parseCell() if ( NP::Rows != nowParsing_ ) { // Dicts - if ( "" != Text ) + if ( !Text.empty() ) { if ( nowParsing_ == NP::Columns ) { @@ -338,7 +338,7 @@ bool MorkParser::parseCell() } else { - if ( "" != Text ) + if ( !Text.empty() ) { // Rows //int ValueId = string( Text.c_str() ).toInt( 0, 16 ); diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx index a35a52182760..ec48bf8db798 100644 --- a/connectivity/source/drivers/odbc/OResultSet.cxx +++ b/connectivity/source/drivers/odbc/OResultSet.cxx @@ -190,7 +190,7 @@ SQLRETURN OResultSet::unbind(bool _bUnbindHandle) if ( _bUnbindHandle ) nRet = N3SQLFreeStmt(m_aStatementHandle,SQL_UNBIND); - if ( m_aBindVector.size() > 0 ) + if ( !m_aBindVector.empty() ) { TVoidVector::iterator pValue = m_aBindVector.begin(); TVoidVector::const_iterator pEnd = m_aBindVector.end(); diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx index d22e2b7a0433..17276c94925f 100644 --- a/connectivity/source/drivers/postgresql/pq_statement.cxx +++ b/connectivity/source/drivers/postgresql/pq_statement.cxx @@ -389,7 +389,7 @@ static std::vector< OUString > lookupKeys( // printf( "\n" ); } } - if( ! ret.size() ) + if( ret.empty() ) { if (isLog(pSettings, LogLevel::Info)) { @@ -498,7 +498,7 @@ bool executePostgresCommand( const OString & cmd, struct CommandData *data ) } } - if( sourceTableKeys.size() && i == static_cast<int>(sourceTableKeys.size()) ) + if( !sourceTableKeys.empty() && i == static_cast<int>(sourceTableKeys.size()) ) { *(data->pLastResultset) = UpdateableResultSet::createFromPGResultSet( @@ -514,7 +514,7 @@ bool executePostgresCommand( const OString & cmd, struct CommandData *data ) buf.append( "." ); aReason = buf.makeStringAndClear(); } - else if( sourceTableKeys.size() ) + else if( !sourceTableKeys.empty() ) { OStringBuffer buf( 128 ); buf.append( "can't support updateable resultset for table " ); diff --git a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx index 0d503693f5b3..fa4b8b5c1de8 100644 --- a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx +++ b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx @@ -164,7 +164,7 @@ css::uno::Sequence< sal_Int8> UpdateableResultSet::getImplementationId() OUString UpdateableResultSet::buildWhereClause() { OUString ret; - if( m_primaryKey.size() ) + if( !m_primaryKey.empty() ) { OUStringBuffer buf( 128 ); buf.append( " WHERE " ); diff --git a/connectivity/source/sdbcx/VCollection.cxx b/connectivity/source/sdbcx/VCollection.cxx index 70f15dc4bd9d..f620f5ebdf50 100644 --- a/connectivity/source/sdbcx/VCollection.cxx +++ b/connectivity/source/sdbcx/VCollection.cxx @@ -104,7 +104,7 @@ namespace virtual void reFill(const ::std::vector< OUString> &_rVector) override { - OSL_ENSURE(!m_aNameMap.size(),"OCollection::reFill: collection isn't empty"); + OSL_ENSURE(m_aNameMap.empty(),"OCollection::reFill: collection isn't empty"); m_aElements.reserve(_rVector.size()); for (auto const& elem : _rVector) diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 3d48ae269a56..70644c7ed9d3 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -864,7 +864,7 @@ bool ContextMenuSaveInData::HasURL( const OUString& rURL ) bool ContextMenuSaveInData::HasSettings() { - return m_pRootEntry && m_pRootEntry->GetEntries()->size(); + return m_pRootEntry && !m_pRootEntry->GetEntries()->empty(); } bool ContextMenuSaveInData::Apply() @@ -2473,7 +2473,7 @@ ToolbarSaveInData::HasURL( const OUString& rURL ) bool ToolbarSaveInData::HasSettings() { // return true if there is at least one toolbar entry - return GetEntries()->size() > 0; + return !GetEntries()->empty(); } void ToolbarSaveInData::Reset() diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx index 5d97a788fa2f..474cb0e9c4dd 100644 --- a/cui/source/options/cfgchart.cxx +++ b/cui/source/options/cfgchart.cxx @@ -69,7 +69,7 @@ void SvxChartColorTable::append( const XColorEntry & _rEntry ) void SvxChartColorTable::remove( size_t _nIndex ) { - if (m_aColorEntries.size() > 0) + if (!m_aColorEntries.empty()) m_aColorEntries.erase( m_aColorEntries.begin() + _nIndex); for (size_t i=0 ; i<m_aColorEntries.size(); i++) diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index 1a80a97b1438..49ea86844901 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -565,7 +565,7 @@ IMPL_LINK( SvxSaveTabPage, FilterHdl_Impl, ListBox&, rBox, void ) { aSaveAsLB->Clear(); auto & rFilters = pImpl->aFilterArr[nData]; - if(!pImpl->aUIFilterArr[nData].size()) + if(pImpl->aUIFilterArr[nData].empty()) { pImpl->aUIFilterArr[nData].resize(pImpl->aFilterArr[nData].size()); auto & rUIFilters = pImpl->aUIFilterArr[nData]; diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 7002296cf0da..47d3a7ffcaa7 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -1946,11 +1946,11 @@ VectorOfNodes OfaTreeOptionsDialog::LoadNodes( if ( !sLeafGrpId.isEmpty() ) { bool bAlreadyOpened = false; - if ( pNode->m_aGroupedLeaves.size() > 0 ) + if ( !pNode->m_aGroupedLeaves.empty() ) { for (auto & rGroup : pNode->m_aGroupedLeaves) { - if ( rGroup.size() > 0 && + if ( !rGroup.empty() && rGroup[0]->m_sGroupId == sLeafGrpId ) { std::vector<std::unique_ptr<OptionsLeaf>>::size_type l = 0; @@ -1980,14 +1980,14 @@ VectorOfNodes OfaTreeOptionsDialog::LoadNodes( } // do not insert nodes without leaves - if ( pNode->m_aLeaves.size() > 0 || pNode->m_aGroupedLeaves.size() > 0 ) + if ( !pNode->m_aLeaves.empty() || !pNode->m_aGroupedLeaves.empty() ) { pModule ? aNodeList.push_back( std::move(pNode) ) : aOutNodeList.push_back( std::move(pNode) ); } } } - if ( pModule && aNodeList.size() > 0 ) + if ( pModule && !aNodeList.empty() ) { for ( auto const & i: pModule->m_aNodeList ) { @@ -2057,7 +2057,7 @@ void OfaTreeOptionsDialog::InsertNodes( const VectorOfNodes& rNodeList ) { for (auto const& node : rNodeList) { - if ( node->m_aLeaves.size() > 0 || node->m_aGroupedLeaves.size() > 0 ) + if ( !node->m_aLeaves.empty() || !node->m_aGroupedLeaves.empty() ) { for ( auto const & j: node->m_aGroupedLeaves ) { diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 2fdb140df21c..20e8429ba0ec 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -2308,7 +2308,7 @@ void OfaAutoCompleteTabPage::Reset( const SfxItemSet* ) } } - if (pOpt->m_pAutoCompleteList && pOpt->m_pAutoCompleteList->size()) + if (pOpt->m_pAutoCompleteList && !pOpt->m_pAutoCompleteList->empty()) { m_pAutoCompleteList = const_cast<editeng::SortedAutoCompleteStrings*>( pOpt->m_pAutoCompleteList); diff --git a/dbaccess/source/filter/hsqldb/fbcreateparser.cxx b/dbaccess/source/filter/hsqldb/fbcreateparser.cxx index aed3552536e3..ad5fa6e65aa4 100644 --- a/dbaccess/source/filter/hsqldb/fbcreateparser.cxx +++ b/dbaccess/source/filter/hsqldb/fbcreateparser.cxx @@ -138,7 +138,7 @@ OUString FbCreateStmtParser::compose() const } // Firebird SQL dialect does not like parameters for TIMESTAMP - if (params.size() > 0 && columnIter->getDataType() != DataType::TIMESTAMP) + if (!params.empty() && columnIter->getDataType() != DataType::TIMESTAMP) { sSql.append("("); auto it = params.cbegin(); diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.cxx b/dbaccess/source/filter/hsqldb/hsqlimport.cxx index 54fdb7411f4d..2a098476b62e 100644 --- a/dbaccess/source/filter/hsqldb/hsqlimport.cxx +++ b/dbaccess/source/filter/hsqldb/hsqlimport.cxx @@ -284,7 +284,7 @@ void HsqlImporter::parseTableRows(const IndexVector& rIndexes, Reference<XInputStream> xInput = xStream->getInputStream(); rowInput.setInputStream(xInput); - if (rIndexes.size() > 0) + if (!rIndexes.empty()) { HsqlBinaryNode aPrimaryNode{ rIndexes.at(0) }; processTree(aPrimaryNode, rowInput, rColTypes, sTableName, rIndexes.size()); @@ -313,7 +313,7 @@ void HsqlImporter::importHsqlDatabase() auto statements = parser.getCreateStatements(); - if (statements.size() < 1 && !pException) + if (statements.empty() && !pException) { SAL_WARN("dbaccess", "dbashql: there is nothing to import"); return; // there is nothing to import diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx index cc6b13e6e2f8..d2a0baaafa5c 100644 --- a/dbaccess/source/ui/browser/formadapter.cxx +++ b/dbaccess/source/ui/browser/formadapter.cxx @@ -1484,7 +1484,7 @@ Type SAL_CALL SbaXFormAdapter::getElementType() sal_Bool SAL_CALL SbaXFormAdapter::hasElements() { - return m_aChildren.size() > 0; + return !m_aChildren.empty(); } // css::container::XIndexContainer diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index 4934f79d886a..30f94d19f973 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -677,7 +677,7 @@ namespace dbaui bool DbaIndexDialog::implCheckPlausibility(const Indexes::const_iterator& _rPos) { // need at least one field - if (0 == _rPos->aFields.size()) + if (_rPos->aFields.empty()) { std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(GetFrameWeld(), VclMessageType::Warning, VclButtonsType::Ok, diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx index b790b651bbcc..b5842210655e 100644 --- a/dbaccess/source/ui/misc/WColumnSelect.cxx +++ b/dbaccess/source/ui/misc/WColumnSelect.cxx @@ -184,7 +184,7 @@ bool OWizColumnSelect::LeavePage() if ( m_pParent->GetPressedButton() == OCopyTableWizard::WIZARD_NEXT || m_pParent->GetPressedButton() == OCopyTableWizard::WIZARD_FINISH ) - return m_pParent->getDestColumns().size() != 0; + return !m_pParent->getDestColumns().empty(); else return true; } diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 7d49411122a5..0660be262c9b 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -661,7 +661,7 @@ void OCopyTableWizard::construct() m_pbNext->GrabFocus(); - if (m_vDestColumns.size()) + if (!m_vDestColumns.empty()) // source is a html or rtf table m_pbNext->SetStyle(m_pbFinish->GetStyle() | WB_DEFBUTTON); else diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx index 2e462c444dac..4ac149299450 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -209,7 +209,7 @@ sal_Int32 OQueryTableView::CountTableAlias(const OUString& rName, sal_Int32& rMa void OQueryTableView::ReSync() { TTableWindowData& rTabWinDataList = m_pView->getController().getTableWindowData(); - OSL_ENSURE((getTableConnections().size()==0) && (GetTabWinMap().size()==0), + OSL_ENSURE((getTableConnections().empty()) && (GetTabWinMap().empty()), "before calling OQueryTableView::ReSync() please call ClearAll !"); // I need a collection of all window names that cannot be created so that I do not initialize connections for them. diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 1d41456adda8..69f2b3ac2bfb 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -290,16 +290,16 @@ void DesktopLOKTest::testGetStyles() char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:StyleApply"); std::stringstream aStream(pJSON); boost::property_tree::read_json(aStream, aTree); - CPPUNIT_ASSERT( aTree.size() > 0 ); + CPPUNIT_ASSERT( !aTree.empty() ); CPPUNIT_ASSERT_EQUAL( std::string(".uno:StyleApply"), aTree.get_child("commandName").get_value<std::string>() ); boost::property_tree::ptree aValues = aTree.get_child("commandValues"); - CPPUNIT_ASSERT( aValues.size() > 0 ); + CPPUNIT_ASSERT( !aValues.empty() ); for (const auto& rPair : aValues) { if( rPair.first != "ClearStyle") { - CPPUNIT_ASSERT( rPair.second.size() > 0); + CPPUNIT_ASSERT( !rPair.second.empty()); } if (rPair.first != "CharacterStyles" && rPair.first != "ParagraphStyles" && @@ -326,15 +326,15 @@ void DesktopLOKTest::testGetFonts() char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:CharFontName"); std::stringstream aStream(pJSON); boost::property_tree::read_json(aStream, aTree); - CPPUNIT_ASSERT( aTree.size() > 0 ); + CPPUNIT_ASSERT( !aTree.empty() ); CPPUNIT_ASSERT_EQUAL( std::string(".uno:CharFontName"), aTree.get_child("commandName").get_value<std::string>() ); boost::property_tree::ptree aValues = aTree.get_child("commandValues"); - CPPUNIT_ASSERT( aValues.size() > 0 ); + CPPUNIT_ASSERT( !aValues.empty() ); for (const auto& rPair : aValues) { // check that we have font sizes available for each font - CPPUNIT_ASSERT( rPair.second.size() > 0); + CPPUNIT_ASSERT( !rPair.second.empty()); } free(pJSON); comphelper::LibreOfficeKit::setActive(false); @@ -401,7 +401,7 @@ void DesktopLOKTest::testGetFilterTypes() boost::property_tree::ptree aTree; boost::property_tree::read_json(aStream, aTree); - CPPUNIT_ASSERT(aTree.size() > 0); + CPPUNIT_ASSERT(!aTree.empty()); CPPUNIT_ASSERT_EQUAL(std::string("application/vnd.oasis.opendocument.text"), aTree.get_child("writer8").get_child("MediaType").get_value<std::string>()); free(pJSON); comphelper::LibreOfficeKit::setActive(false); @@ -1930,10 +1930,10 @@ void DesktopLOKTest::testGetFontSubset() char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, aCommand.getStr()); std::stringstream aStream(pJSON); boost::property_tree::read_json(aStream, aTree); - CPPUNIT_ASSERT( aTree.size() > 0 ); + CPPUNIT_ASSERT( !aTree.empty() ); CPPUNIT_ASSERT_EQUAL( std::string(".uno:FontSubset"), aTree.get_child("commandName").get_value<std::string>() ); boost::property_tree::ptree aValues = aTree.get_child("commandValues"); - CPPUNIT_ASSERT( aValues.size() > 0 ); + CPPUNIT_ASSERT( !aValues.empty() ); free(pJSON); comphelper::LibreOfficeKit::setActive(false); diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index fb6ce8668582..f76a8df08a47 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -1470,7 +1470,7 @@ void BackendImpl::PackageImpl::scanBundle( // patch description: std::vector<sal_Int8> bytes( readFile( descrFileContent ) ); OUStringBuffer buf; - if ( bytes.size() ) + if ( !bytes.empty() ) { buf.append( OUString( reinterpret_cast<sal_Char const *>( bytes.data() ), diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 6dfa7cc28825..6f080c5e0316 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -340,7 +340,7 @@ std::vector<beans::PropertyValue> desktop::jsonToPropertyValuesVector(const char else if (rType == "[]any") { aNodeValue = rPair.second.get_child("value", aNodeNull); - if (aNodeValue != aNodeNull && aNodeValue.size() > 0) + if (aNodeValue != aNodeNull && !aNodeValue.empty()) { sal_Int32 itSeq = 0; uno::Sequence< uno::Any > aSeq(aNodeValue.size()); diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index 33a8af6f8e55..fea990384e9c 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -530,7 +530,7 @@ extern "C" int unopkg_main() Reference<ui::dialogs::XAsynchronousExecutableDialog> xDialog( deployment::ui::PackageManagerDialog::createAndInstall( xComponentContext, - cmdPackages.size() > 0 ? cmdPackages[0] : OUString() )); + !cmdPackages.empty() ? cmdPackages[0] : OUString() )); osl::Condition dialogEnded; dialogEnded.reset(); 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 (!)"); } diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 6637796ea687..06a18b7f7403 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -4017,9 +4017,9 @@ long ImpEditEngine::GetXPos( else if ( rPortion.GetKind() == PortionKind::TEXT ) { OSL_ENSURE( nIndex != pLine->GetStart(), "Strange behavior in new GetXPos()" ); - OSL_ENSURE( pLine && pLine->GetCharPosArray().size(), "svx::ImpEditEngine::GetXPos(), portion in an empty line?" ); + OSL_ENSURE( pLine && !pLine->GetCharPosArray().empty(), "svx::ImpEditEngine::GetXPos(), portion in an empty line?" ); - if( pLine->GetCharPosArray().size() ) + if( !pLine->GetCharPosArray().empty() ) { sal_Int32 nPos = nIndex - 1 - pLine->GetStart(); if (nPos < 0 || nPos >= static_cast<sal_Int32>(pLine->GetCharPosArray().size())) diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 631893e8326c..fadb8db0c56f 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -3311,7 +3311,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po // longer done in Overlay mode and allows to *read* the URL). // It would be difficult to change this due to needed adaptions in // EditEngine (look for lineBreaksList creation) - if( nullptr == pActiveView && bStripOnly && !bParsingFields && pExtraInfo && pExtraInfo->lineBreaksList.size() ) + if( nullptr == pActiveView && bStripOnly && !bParsingFields && pExtraInfo && !pExtraInfo->lineBreaksList.empty() ) { bParsingFields = true; itSubLines = pExtraInfo->lineBreaksList.begin(); @@ -3494,7 +3494,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po // StripPortions() data callback GetEditEnginePtr()->DrawingText( aOutPos, aText, nTextStart, nTextLen, pDXArray, aTmpFont, n, rTextPortion.GetRightToLeftLevel(), - aWrongSpellVector.size() ? &aWrongSpellVector : nullptr, + !aWrongSpellVector.empty() ? &aWrongSpellVector : nullptr, pFieldData, bEndOfLine, bEndOfParagraph, // support for EOL/EOP TEXT comments &aLocale, diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 66cd22344d0c..64bc7443014e 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -2067,7 +2067,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & rEditView, DBG_ASSERT(pSpellInfo, "pSpellInfo not initialized"); if (pSpellInfo && - pSpellInfo->aLastSpellPortions.size() > 0) // no portions -> no text to be changed + !pSpellInfo->aLastSpellPortions.empty()) // no portions -> no text to be changed { // get current paragraph length to calculate later on how the sentence length changed, // in order to place the cursor at the end of the sentence again @@ -2077,7 +2077,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & rEditView, UndoActionStart( EDITUNDO_INSERT ); if(pSpellInfo->aLastSpellPortions.size() == rNewPortions.size()) { - DBG_ASSERT( rNewPortions.size() > 0, "rNewPortions should not be empty here" ); + DBG_ASSERT( !rNewPortions.empty(), "rNewPortions should not be empty here" ); DBG_ASSERT( pSpellInfo->aLastSpellPortions.size() == pSpellInfo->aLastSpellContentSelections.size(), "aLastSpellPortions and aLastSpellContentSelections size mismatch" ); diff --git a/extensions/source/abpilot/fieldmappingpage.cxx b/extensions/source/abpilot/fieldmappingpage.cxx index a5ce91af2c09..d0962e8f85c0 100644 --- a/extensions/source/abpilot/fieldmappingpage.cxx +++ b/extensions/source/abpilot/fieldmappingpage.cxx @@ -78,7 +78,7 @@ namespace abp // invoke the dialog doing the mapping if ( fieldmapping::invokeDialog( getORB(), this, getDialog()->getDataSource().getDataSource(), rSettings ) ) { - if ( rSettings.aFieldMapping.size() ) + if ( !rSettings.aFieldMapping.empty() ) getDialog()->travelNext(); else implUpdateHint(); diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx index be7e94dbdc89..3aca9d72da53 100644 --- a/extensions/source/propctrlr/browserlistbox.cxx +++ b/extensions/source/propctrlr/browserlistbox.cxx @@ -977,7 +977,7 @@ namespace pcr } // wrap around? - if ( ( static_cast< size_t >( nLine ) >= m_aLines.size() ) && ( m_aLines.size() > 0 ) ) + if ( ( static_cast< size_t >( nLine ) >= m_aLines.size() ) && ( !m_aLines.empty() ) ) m_aLines[0].pLine->GrabFocus(); } diff --git a/filter/source/config/cache/cacheitem.cxx b/filter/source/config/cache/cacheitem.cxx index a8ac838dee1e..d494725eb9dd 100644 --- a/filter/source/config/cache/cacheitem.cxx +++ b/filter/source/config/cache/cacheitem.cxx @@ -73,7 +73,7 @@ void CacheItem::validateUINames(const OUString& sActLocale) // 1a) set UIName inside list of UINames for current locale lUINames[sActLocale] <<= sUIName; } - else if (lUINames.size()>0) + else if (!lUINames.empty()) { // 1b) or get it from this list, if it not exist! lUINames[sActLocale] >>= sUIName; diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx index d3cf357f165d..0e2f60dddf6b 100644 --- a/filter/source/config/cache/filtercache.cxx +++ b/filter/source/config/cache/filtercache.cxx @@ -569,7 +569,7 @@ void FilterCache::flush() // renew all dependencies and optimizations impl_validateAndOptimize(); - if (m_lChangedTypes.size() > 0) + if (!m_lChangedTypes.empty()) { css::uno::Reference< css::container::XNameAccess > xConfig(impl_openConfig(E_PROVIDER_TYPES), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::container::XNameAccess > xSet ; @@ -581,7 +581,7 @@ void FilterCache::flush() xFlush->commitChanges(); } - if (m_lChangedFilters.size() > 0) + if (!m_lChangedFilters.empty()) { css::uno::Reference< css::container::XNameAccess > xConfig(impl_openConfig(E_PROVIDER_FILTERS), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::container::XNameAccess > xSet ; @@ -2122,7 +2122,7 @@ CacheItem FilterCache::impl_readOldItem(const css::uno::Reference< css::containe lData = impl_tokenizeString(sData, ','); if ( (sData.isEmpty()) || - (lData.size()<1 ) + (lData.empty() ) ) { throw css::uno::Exception( "Can not read old item property DATA.", css::uno::Reference< css::uno::XInterface >()); diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx index fa23e96ba126..b5268857ca9b 100644 --- a/filter/source/config/cache/typedetection.cxx +++ b/filter/source/config/cache/typedetection.cxx @@ -89,7 +89,7 @@ OUString SAL_CALL TypeDetection::queryTypeByURL(const OUString& sURL) cache.detectFlatForURL(aURL, lFlatTypes); if ( - (lFlatTypes.size() < 1 ) && + (lFlatTypes.empty() ) && (!cache.isFillState(FilterCache::E_CONTAINS_TYPES)) ) { @@ -98,7 +98,7 @@ OUString SAL_CALL TypeDetection::queryTypeByURL(const OUString& sURL) } // first item is guaranteed as "preferred" one! - if (lFlatTypes.size() > 0) + if (!lFlatTypes.empty()) { const FlatDetectionInfo& aMatch = *(lFlatTypes.begin()); sType = aMatch.sType; @@ -426,7 +426,7 @@ OUString SAL_CALL TypeDetection::queryTypeByDescriptor(css::uno::Sequence< css:: // throwing an exception if creation of the might needed input // stream failed by e.g. an IO exception ... std::vector<OUString> lUsedDetectors; - if (lFlatTypes.size()>0) + if (!lFlatTypes.empty()) sType = impl_detectTypeFlatAndDeep(stlDescriptor, lFlatTypes, bAllowDeep, lUsedDetectors, sLastChance); // flat detection failed diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index 03042a9c86a2..f32eb9538f53 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -1099,7 +1099,7 @@ bool Writer::Impl_writeStroke( SvtGraphicStroke const & rStroke ) SvtGraphicStroke::DashArray aDashArray; rStroke.getDashArray( aDashArray ); - if( 0 != aDashArray.size() ) + if( !aDashArray.empty() ) return false; // todo: implement dashes Color aColor( mpVDev->GetLineColor() ); diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index f20e899c0cc6..28e0f59b40b2 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -1260,7 +1260,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) bSkipSequence = false; if ( static_cast<sal_uInt32>(eJT) > 2 ) bSkipSequence = false; - if ( l_aDashArray.size() && ( fStrokeWidth != 0.0 ) ) + if ( !l_aDashArray.empty() && ( fStrokeWidth != 0.0 ) ) bSkipSequence = false; if ( bSkipSequence ) { diff --git a/filter/source/graphicfilter/idxf/dxfentrd.cxx b/filter/source/graphicfilter/idxf/dxfentrd.cxx index a2949dd6578a..0f30ba60f1bc 100644 --- a/filter/source/graphicfilter/idxf/dxfentrd.cxx +++ b/filter/source/graphicfilter/idxf/dxfentrd.cxx @@ -633,7 +633,7 @@ bool DXFBoundaryPathData::EvaluateGroup( DXFGroupReader & rDGR ) case 4 : aEdges.emplace_back( new DXFEdgeTypeSpline() ); break; } } - else if ( aEdges.size() ) + else if ( !aEdges.empty() ) aEdges[ aEdges.size() - 1 ]->EvaluateGroup( rDGR ); else bExecutingGroupCode = false; diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 6fff0b0cb99d..eff3d607fa77 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -2050,7 +2050,7 @@ void SVGActionWriter::ImplWriteShape( const SVGShapeDescriptor& rShape ) } } - if( rShape.maDashArray.size() ) + if( !rShape.maDashArray.empty() ) { OUStringBuffer aDashArrayStr; diff --git a/forms/source/component/EventThread.cxx b/forms/source/component/EventThread.cxx index 821f2b63e77e..76022a84f62d 100644 --- a/forms/source/component/EventThread.cxx +++ b/forms/source/component/EventThread.cxx @@ -71,7 +71,7 @@ Any SAL_CALL OComponentEventThread::queryInterface(const Type& _rType) void OComponentEventThread::impl_clearEventQueue() { - while ( m_aEvents.size() ) + while ( !m_aEvents.empty() ) { delete *m_aEvents.begin(); m_aEvents.erase( m_aEvents.begin() ); @@ -148,7 +148,7 @@ void OComponentEventThread::run() { ::osl::MutexGuard aGuard(m_aMutex); - while( m_aEvents.size() > 0 ) + while( !m_aEvents.empty() ) { // Get the Control and hold on to it so that it cannot be deleted during actionPerformed rtl::Reference<::cppu::OComponentHelper> xComp = m_xComp; diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx index e8a86ada7214..6ffd0c6e7684 100644 --- a/formula/source/ui/dlg/parawin.cxx +++ b/formula/source/ui/dlg/parawin.cxx @@ -396,7 +396,7 @@ void ParaWin::SetArgNameFont(sal_uInt16 no,const vcl::Font& aFont) void ParaWin::SetEdFocus() { UpdateArgDesc(0); - if(0<aParaArray.size()) + if(!aParaArray.empty()) aArgInput[0].GetArgEdPtr()->GrabFocus(); } diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 5242ce8b6fed..34729dfb2005 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -1417,7 +1417,7 @@ std::vector<OUString> RemoteFilesDialog::GetPathList() const pEntry = m_pFileView->NextSelected( pEntry ); } - if( aList.size() == 0 && !m_sPath.isEmpty() ) + if( aList.empty() && !m_sPath.isEmpty() ) aList.push_back( m_sPath ); return aList; diff --git a/framework/source/dispatch/dispatchdisabler.cxx b/framework/source/dispatch/dispatchdisabler.cxx index b847031bf742..0ad5932c0251 100644 --- a/framework/source/dispatch/dispatchdisabler.cxx +++ b/framework/source/dispatch/dispatchdisabler.cxx @@ -101,7 +101,7 @@ uno::Type SAL_CALL DispatchDisabler::getElementType() ::sal_Bool SAL_CALL DispatchDisabler::hasElements() { - return maDisabledURLs.size() > 0; + return !maDisabledURLs.empty(); } // XNameAccess diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx index 819e96475393..27fb2a14b538 100644 --- a/framework/source/dispatch/interceptionhelper.cxx +++ b/framework/source/dispatch/interceptionhelper.cxx @@ -52,7 +52,7 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL InterceptionHelper::queryD // b) No match by registration - but a valid interceptor list. // Find first interceptor w/o pattern, so we need to query it - if (!xInterceptor.is() && m_lInterceptionRegs.size()>0) + if (!xInterceptor.is() && !m_lInterceptionRegs.empty()) { for (auto const& lInterceptionReg : m_lInterceptionRegs) { diff --git a/framework/source/jobs/jobresult.cxx b/framework/source/jobs/jobresult.cxx index fe79bf68cdb8..86ae9b5f0dea 100644 --- a/framework/source/jobs/jobresult.cxx +++ b/framework/source/jobs/jobresult.cxx @@ -117,7 +117,7 @@ JobResult::JobResult( /*IN*/ const css::uno::Any& aResult ) css::uno::Sequence<css::beans::NamedValue> aTmp; pIt->second >>= aTmp; comphelper::sequenceToContainer(m_lArguments, aTmp); - if (!m_lArguments.size()) + if (m_lArguments.empty()) m_eParts |= E_ARGUMENTS; } diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index 96e96ba143e6..e374da107921 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -3917,7 +3917,7 @@ uno::Sequence< uno::Reference< ui::XUIElement > > ToolbarLayoutManager::getToolb uno::Sequence< uno::Reference< ui::XUIElement > > aSeq; SolarMutexGuard g; - if ( m_aUIElements.size() > 0 ) + if ( !m_aUIElements.empty() ) { sal_uInt32 nCount(0); for (auto const& elem : m_aUIElements) diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 14c9148fd92c..844591d56a20 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -3896,7 +3896,7 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue , case AUTORECOVERY_PROPHANDLE_EXISTS_RECOVERYDATA : { bool bSessionData = officecfg::Office::Recovery::RecoveryInfo::SessionData::get(m_xContext); - bool bRecoveryData = m_lDocCache.size() > 0; + bool bRecoveryData = !m_lDocCache.empty(); // exists session data ... => then we can't say, that these // data are valid for recovery. So we have to return sal_False then! diff --git a/framework/source/uielement/thesaurusmenucontroller.cxx b/framework/source/uielement/thesaurusmenucontroller.cxx index de0845440825..a7237ad9c3ec 100644 --- a/framework/source/uielement/thesaurusmenucontroller.cxx +++ b/framework/source/uielement/thesaurusmenucontroller.cxx @@ -77,7 +77,7 @@ void ThesaurusMenuController::fillPopupMenu() VCLXMenu* pAwtMenu = VCLXMenu::GetImplementation( m_xPopupMenu ); Menu* pVCLMenu = pAwtMenu->GetMenu(); pVCLMenu->SetMenuFlags( MenuFlags::NoAutoMnemonics ); - if ( aSynonyms.size() > 0 ) + if ( !aSynonyms.empty() ) { SvtLinguConfig aCfg; Image aImage; diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index 9e427591cd3c..3b3ecefa90cd 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -2908,7 +2908,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart) { if( para->hhstr[n]->hh == CH_END_PARA ) { - if (str.size() > 0) + if (!str.empty()) { if( !pstart ){ STARTP;} if( !tstart ){ STARTT;} @@ -2998,7 +2998,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart) break; case CH_TAB: // 9 if( !pstart ) {STARTP;} - if (str.size() > 0) + if (!str.empty()) { if( !tstart ) {STARTT;} makeChars(str); @@ -3019,7 +3019,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart) else { if( !pstart ) {STARTP;} - if (str.size() > 0) + if (!str.empty()) { if( !tstart ) {STARTT;} makeChars(str); @@ -3052,7 +3052,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart) else { if( !pstart ) {STARTP;} - if (str.size() > 0) + if (!str.empty()) { if( !tstart ) {STARTT;} makeChars(str); @@ -3064,7 +3064,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart) } case CH_LINE: // 14 { - if (str.size() > 0) + if (!str.empty()) { if( !pstart ) {STARTP;} if( !tstart ) {STARTT;} @@ -3731,7 +3731,7 @@ void HwpReader::makeHyperText(TxtBox * hbox) reinterpret_cast<uchar const *>(urltounix(reinterpret_cast<char *>(hypert->filename)).c_str())).c_str()); #endif padd("xlink:type", sXML_CDATA, "simple"); - if (tmp.size() > 0 && strcmp(tmp.c_str(), "[HTML]")) { + if (!tmp.empty() && strcmp(tmp.c_str(), "[HTML]")) { ::std::string tmp3(tmp2); tmp3.push_back('#'); tmp3.append(tmp); diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx index b4eb74e03a03..ebd395b466fc 100644 --- a/jvmfwk/source/elements.cxx +++ b/jvmfwk/source/elements.cxx @@ -484,7 +484,7 @@ void NodeJava::write() const xmlFreeNode(lastNode); } //add a new line after <vmParameters> - if (m_vmParameters->size() > 0) + if (!m_vmParameters->empty()) { xmlNode * nodeCrLf = xmlNewText(reinterpret_cast<xmlChar const *>("\n")); xmlAddChild(vmParameters, nodeCrLf); @@ -524,7 +524,7 @@ void NodeJava::write() const xmlFreeNode(lastNode); } //add a new line after <vmParameters> - if (m_JRELocations->size() > 0) + if (!m_JRELocations->empty()) { xmlNode * nodeCrLf = xmlNewText(reinterpret_cast<xmlChar const *>("\n")); xmlAddChild(jreLocationsNode, nodeCrLf); diff --git a/l10ntools/source/propmerge.cxx b/l10ntools/source/propmerge.cxx index 1f57f03c2ff0..b87c64c994f7 100644 --- a/l10ntools/source/propmerge.cxx +++ b/l10ntools/source/propmerge.cxx @@ -173,7 +173,7 @@ void PropParser::Merge( const OString &rMergeSrc, const OString &rDestinationFil pMergeDataFile.reset( new MergeDataFile( rMergeSrc, m_sSource, false, false ) ); const std::vector<OString> vLanguages = pMergeDataFile->GetLanguages(); - if( vLanguages.size()>=1 && vLanguages[0] != m_sLang ) + if( !vLanguages.empty() && vLanguages[0] != m_sLang ) { std::cerr << ("Propex error: given language conflicts with language of" diff --git a/l10ntools/source/treemerge.cxx b/l10ntools/source/treemerge.cxx index c874603edfa2..65916d12d3e2 100644 --- a/l10ntools/source/treemerge.cxx +++ b/l10ntools/source/treemerge.cxx @@ -259,7 +259,7 @@ void TreeParser::Merge( pMergeDataFile.reset(new MergeDataFile( rMergeSrc, static_cast<OString>( m_pSource->name ), false, false )); const std::vector<OString> vLanguages = pMergeDataFile->GetLanguages(); - if( vLanguages.size()>=1 && vLanguages[0] != m_sLang ) + if( !vLanguages.empty() && vLanguages[0] != m_sLang ) { std::cerr << ("Treex error: given language conflicts with language of" diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx index 307a1b61f3ea..01c587c60ec4 100644 --- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx @@ -100,7 +100,7 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales() // this routine should return the locales supported by the installed // dictionaries. - if (!mvDicts.size()) + if (mvDicts.empty()) { SvtLinguConfig aLinguCfg; diff --git a/lingucomponent/source/languageguessing/guess.cxx b/lingucomponent/source/languageguessing/guess.cxx index 545912dbb032..eefa7ab6c0f0 100644 --- a/lingucomponent/source/languageguessing/guess.cxx +++ b/lingucomponent/source/languageguessing/guess.cxx @@ -97,7 +97,7 @@ Guess::Guess(const char * guess_str) current_pointer++; } - if(lang!=""){//if not we use the default value + if(!lang.empty()){//if not we use the default value language_str=lang; } country_str=country; diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx index 7936d1f4d642..e2331c2e20ce 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx +++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx @@ -102,7 +102,7 @@ Sequence< Locale > SAL_CALL Thesaurus::getLocales() // this routine should return the locales supported by the installed // dictionaries. - if (!mvThesInfo.size()) + if (mvThesInfo.empty()) { SvtLinguConfig aLinguCfg; diff --git a/linguistic/source/misc2.cxx b/linguistic/source/misc2.cxx index 782d190e7a1f..f416a1739fd1 100644 --- a/linguistic/source/misc2.cxx +++ b/linguistic/source/misc2.cxx @@ -137,7 +137,7 @@ OUString GetDictionaryWriteablePath() std::vector< OUString > aPaths( GetMultiPaths_Impl( "Dictionary", DictionaryPathFlags::NONE ) ); DBG_ASSERT( aPaths.size() == 1, "Dictionary_writable path corrupted?" ); OUString aRes; - if (aPaths.size() > 0) + if (!aPaths.empty()) aRes = aPaths[0]; return aRes; } 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( ); diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index c3c9a0ae7022..f29ecfd3ea0a 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -1842,7 +1842,7 @@ void OStorage::InternalDispose( bool bNotifyImpl ) if ( m_pData->m_bReadOnlyWrap ) { - OSL_ENSURE( !m_pData->m_aOpenSubComponentsVector.size() || m_pData->m_pSubElDispListener.get(), + OSL_ENSURE( m_pData->m_aOpenSubComponentsVector.empty() || m_pData->m_pSubElDispListener.get(), "If any subelements are open the listener must exist!" ); if (m_pData->m_pSubElDispListener) @@ -3930,7 +3930,7 @@ sal_Bool SAL_CALL OStorage::hasElements() try { - return ( m_pImpl->GetChildrenVector().size() != 0 ); + return ( !m_pImpl->GetChildrenVector().empty() ); } catch( const uno::RuntimeException& rRuntimeException ) { diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx index 443eaf8dce96..8026ffc5cbf9 100644 --- a/package/source/zippackage/ZipPackageFolder.cxx +++ b/package/source/zippackage/ZipPackageFolder.cxx @@ -214,7 +214,7 @@ uno::Type SAL_CALL ZipPackageFolder::getElementType( ) } sal_Bool SAL_CALL ZipPackageFolder::hasElements( ) { - return maContents.size() > 0; + return !maContents.empty(); } // XNameAccess ZipContentInfo& ZipPackageFolder::doGetByName( const OUString& aName ) diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx index fb6007d8e203..9d7e3d355a19 100644 --- a/package/source/zippackage/zipfileaccess.cxx +++ b/package/source/zippackage/zipfileaccess.cxx @@ -368,7 +368,7 @@ sal_Bool SAL_CALL OZipFileAccess::hasElements() if ( !m_pZipFile ) throw uno::RuntimeException(THROW_WHERE); - return ( m_pZipFile->GetEntryHash().size() != 0 ); + return ( !m_pZipFile->GetEntryHash().empty() ); } // XZipFileAccess diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 3449e6bf2eab..5d7a7a4aebfb 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -858,7 +858,7 @@ void ScDPOutput::CalcSizes() // calculate output positions and sizes long nPageSize = 0; // use page fields! - if ( bDoFilter || pPageFields.size() ) + if ( bDoFilter || !pPageFields.empty() ) { nPageSize += pPageFields.size() + 1; // plus one empty row if ( bDoFilter ) diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index 4ad5530a21b9..d6b8a49f0c60 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -3501,7 +3501,7 @@ ScDPResultMember* ScDPResultDimension::GetMember(long n) ScDPResultDimension* ScDPResultDimension::GetFirstChildDimension() const { - if ( maMemberArray.size() > 0 ) + if ( !maMemberArray.empty() ) return maMemberArray[0]->GetChildDimension(); else return nullptr; diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx index 0fe000d9a50c..10e7fdc48d34 100644 --- a/sc/source/core/data/markdata.cxx +++ b/sc/source/core/data/markdata.cxx @@ -198,7 +198,7 @@ SCTAB ScMarkData::GetSelectCount() const SCTAB ScMarkData::GetFirstSelected() const { - if (maTabMarked.size() > 0) + if (!maTabMarked.empty()) return (*maTabMarked.begin()); OSL_FAIL("GetFirstSelected: nothing selected"); @@ -207,7 +207,7 @@ SCTAB ScMarkData::GetFirstSelected() const SCTAB ScMarkData::GetLastSelected() const { - if (maTabMarked.size() > 0) + if (!maTabMarked.empty()) return (*maTabMarked.rbegin()); OSL_FAIL("GetLastSelected: nothing selected"); diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index f65787120aaf..55751228d691 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -2138,7 +2138,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) } } - if (aRowVector.size() > 0) + if (!aRowVector.empty()) { // generate global total SCROW nGlobalStartRow = aRowVector[0].nSubStartRow; diff --git a/sc/source/core/opencl/op_statistical.cxx b/sc/source/core/opencl/op_statistical.cxx index 79d27e5ef5e7..62f35865c7c7 100644 --- a/sc/source/core/opencl/op_statistical.cxx +++ b/sc/source/core/opencl/op_statistical.cxx @@ -223,7 +223,7 @@ void OpZTest::GenSlidingWindowFunction(std::stringstream &ss, ss << " double arg = 0.0;\n"; ss << " double sigma = 0.0;\n"; ss << " double mu = 0.0;\n"; - if(vSubArguments.size() == 1 || vSubArguments.size() == 0) + if(vSubArguments.size() == 1 || vSubArguments.empty()) { ss << " return DBL_MAX;\n"; ss << "}\n"; diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index b09e5f7f3977..89250fa68ed2 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -438,7 +438,7 @@ void ImportExcel8::PostDocLoad() ImportExcel::PostDocLoad(); // check scenarios; Attention: This increases the table count of the document!! - if( !pD->IsClipboard() && maScenList.aEntries.size() ) + if( !pD->IsClipboard() && !maScenList.aEntries.empty() ) { pD->UpdateChartListenerCollection(); // references in charts must be updated diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx index 431074fbce50..bb2dc847d75f 100644 --- a/sc/source/filter/excel/xepivotxml.cxx +++ b/sc/source/filter/excel/xepivotxml.cxx @@ -303,7 +303,7 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( XclExpXmlStream& rStrm, const Entr // 1 - (Default) at least one text value, or can also contain a mix of other data types and blank values, // or blank values only // 0 - the field does not have a mix of text and other values - if (!(isContainsString || (aDPTypes.size() > 1) || (isContainsBlank && aDPTypesWithoutBlank.size() == 0))) + if (!(isContainsString || (aDPTypes.size() > 1) || (isContainsBlank && aDPTypesWithoutBlank.empty()))) pAttList->add(XML_containsSemiMixedTypes, ToPsz10(false)); if (!isContainsNonDate) diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 14fa8478d0f5..174ed4bf298b 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -106,7 +106,7 @@ public: } virtual sal_Bool SAL_CALL hasElements() override { - return (maColor.size() > 0); + return (!maColor.empty()); } private: diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 7eda5c9dae14..9ea3af92cb3b 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -1355,7 +1355,7 @@ void ScHTMLLayoutParser::Image( HtmlImportInfo* pInfo ) pImage->aSize = pDefaultDev->LogicToPixel( pGraphic->GetPrefSize(), pGraphic->GetPrefMapMode() ); } - if (mxActEntry->maImageList.size() > 0) + if (!mxActEntry->maImageList.empty()) { long nWidth = 0; for (std::unique_ptr<ScHTMLImage> & pI : mxActEntry->maImageList) @@ -1564,7 +1564,7 @@ void ScHTMLLayoutParser::ProcToken( HtmlImportInfo* pInfo ) break; case HtmlTokenId::PARABREAK_OFF: { // We continue vertically after an image - if (mxActEntry->maImageList.size() > 0) + if (!mxActEntry->maImageList.empty()) mxActEntry->maImageList.back()->nDir = nVertical; } break; diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx index babfb61395b8..91bddc80ec76 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -394,15 +394,15 @@ FormulaBuffer::SheetItem FormulaBuffer::getSheetItem( SCTAB nTab ) return aItem; } - if( maCellFormulas[ nTab ].size() > 0 ) + if( !maCellFormulas[ nTab ].empty() ) aItem.mpCellFormulas = &maCellFormulas[ nTab ]; - if( maCellArrayFormulas[ nTab ].size() > 0 ) + if( !maCellArrayFormulas[ nTab ].empty() ) aItem.mpArrayFormulas = &maCellArrayFormulas[ nTab ]; - if( maCellFormulaValues[ nTab ].size() > 0 ) + if( !maCellFormulaValues[ nTab ].empty() ) aItem.mpCellFormulaValues = &maCellFormulaValues[ nTab ]; - if( maSharedFormulas[ nTab ].size() > 0 ) + if( !maSharedFormulas[ nTab ].empty() ) aItem.mpSharedFormulaEntries = &maSharedFormulas[ nTab ]; - if( maSharedFormulaIds[ nTab ].size() > 0 ) + if( !maSharedFormulaIds[ nTab ].empty() ) aItem.mpSharedFormulaIDs = &maSharedFormulaIds[ nTab ]; return aItem; diff --git a/sc/source/filter/oox/formulaparser.cxx b/sc/source/filter/oox/formulaparser.cxx index 888f0465a53d..765881c3ec7b 100644 --- a/sc/source/filter/oox/formulaparser.cxx +++ b/sc/source/filter/oox/formulaparser.cxx @@ -696,7 +696,7 @@ size_t FormulaParserImpl::insertWhiteSpaceTokens( const WhiteSpaceVec* pSpaces, size_t FormulaParserImpl::getOperandSize( size_t nOpIndex ) const { - OSL_ENSURE( (nOpIndex < 1) && (1 <= maOperandSizeStack.size()), + OSL_ENSURE( (nOpIndex < 1) && (!maOperandSizeStack.empty()), "FormulaParserImpl::getOperandSize - invalid parameters" ); return maOperandSizeStack[ maOperandSizeStack.size() - 1 + nOpIndex ]; } @@ -753,7 +753,7 @@ bool FormulaParserImpl::pushParenthesesOperandToken( const WhiteSpaceVec* pClosi bool FormulaParserImpl::pushUnaryPreOperatorToken( sal_Int32 nOpCode, const WhiteSpaceVec* pSpaces ) { - bool bOk = maOperandSizeStack.size() >= 1; + bool bOk = !maOperandSizeStack.empty(); if( bOk ) { size_t nOpSize = popOperandSize(); @@ -766,7 +766,7 @@ bool FormulaParserImpl::pushUnaryPreOperatorToken( sal_Int32 nOpCode, const Whit bool FormulaParserImpl::pushUnaryPostOperatorToken( sal_Int32 nOpCode, const WhiteSpaceVec* pSpaces ) { - bool bOk = maOperandSizeStack.size() >= 1; + bool bOk = !maOperandSizeStack.empty(); if( bOk ) { size_t nOpSize = popOperandSize(); @@ -793,7 +793,7 @@ bool FormulaParserImpl::pushBinaryOperatorToken( sal_Int32 nOpCode, const WhiteS bool FormulaParserImpl::pushParenthesesOperatorToken( const WhiteSpaceVec* pOpeningSpaces, const WhiteSpaceVec* pClosingSpaces ) { - bool bOk = maOperandSizeStack.size() >= 1; + bool bOk = !maOperandSizeStack.empty(); if( bOk ) { size_t nOpSize = popOperandSize(); diff --git a/sc/source/filter/xml/XMLExportIterator.cxx b/sc/source/filter/xml/XMLExportIterator.cxx index 58f1b693a804..71940997d613 100644 --- a/sc/source/filter/xml/XMLExportIterator.cxx +++ b/sc/source/filter/xml/XMLExportIterator.cxx @@ -444,7 +444,7 @@ void ScMyDetectiveObjContainer::SetCellData( ScMyCell& rMyCell ) rMyCell.aDetectiveObjVec.push_back( *aItr ); aItr = aDetectiveObjList.erase( aItr ); } - rMyCell.bHasDetectiveObj = (rMyCell.aDetectiveObjVec.size() != 0); + rMyCell.bHasDetectiveObj = (!rMyCell.aDetectiveObjVec.empty()); } void ScMyDetectiveObjContainer::SkipTable(SCTAB nSkip) @@ -503,7 +503,7 @@ void ScMyDetectiveOpContainer::SetCellData( ScMyCell& rMyCell ) rMyCell.aDetectiveOpVec.push_back( *aItr ); aItr = aDetectiveOpList.erase( aItr ); } - rMyCell.bHasDetectiveOp = (rMyCell.aDetectiveOpVec.size() != 0); + rMyCell.bHasDetectiveOp = (!rMyCell.aDetectiveOpVec.empty()); } void ScMyDetectiveOpContainer::SkipTable(SCTAB nSkip) diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index bf68d4a48b59..a8b61cdfd93f 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -964,7 +964,7 @@ void ScXMLTableRowCellContext::SetAnnotation(const ScAddress& rPos) // core implementation void ScXMLTableRowCellContext::SetDetectiveObj( const ScAddress& rPosition ) { - if( cellExists(rPosition) && pDetectiveObjVec && pDetectiveObjVec->size() ) + if( cellExists(rPosition) && pDetectiveObjVec && !pDetectiveObjVec->empty() ) { LockSolarMutex(); ScDetectiveFunc aDetFunc( rXMLImport.GetDocument(), rPosition.Tab() ); diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 0112c308d71d..7d143a7faec0 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -4562,7 +4562,7 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab) ScConditionalFormatList* pCondFormatList = pDoc->GetCondFormList(nTab); if(pCondFormatList) { - if(pCondFormatList && !pCondFormatList->size()) + if(pCondFormatList && pCondFormatList->empty()) return; SvXMLElementExport aElementCondFormats(*this, XML_NAMESPACE_CALC_EXT, XML_CONDITIONAL_FORMATS, true, true); diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 6a2a8b436674..bcccb1af82bb 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -1535,7 +1535,7 @@ void ScTabStops::AddTabStop( vcl::Window* pWin ) void ScTabStops::SetTabStop( vcl::Window* pWin ) { - if ( !maControls.size() ) + if ( maControls.empty() ) return; ControlToPosMap::const_iterator aIter = maControlToPos.find( pWin ); if ( aIter == maControlToPos.end() ) @@ -1554,7 +1554,7 @@ void ScTabStops::SetTabStop( vcl::Window* pWin ) void ScTabStops::CycleFocus( bool bReverse ) { - if (!maControls.size()) + if (maControls.empty()) return; if ( mnCurTabStop < maControls.size() ) { diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 6cdc2c35dc4e..2968ea7f53c0 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -1167,7 +1167,7 @@ static void lcl_parseHtmlFilterOption(const OUString& rOption, LanguageType& rLa rLang = LanguageType( 0 ); rDateConvert = false; - if (aTokens.size() > 0) + if (!aTokens.empty()) rLang = static_cast<LanguageType>(aTokens[0].toInt32()); if (aTokens.size() > 1) rDateConvert = static_cast<bool>(aTokens[1].toInt32()); diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx index af8de51f271f..ee8104724c02 100644 --- a/sc/source/ui/miscdlgs/conflictsdlg.cxx +++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx @@ -215,7 +215,7 @@ bool ScConflictsFinder::Find() pOwnAction = pOwnAction->GetNext(); } - if ( aOwnActions.size() ) + if ( !aOwnActions.empty() ) { ScConflictsListEntry* pEntry = GetEntry( pSharedAction->GetActionNumber(), aOwnActions ); for ( auto& aOwnAction : aOwnActions ) diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx index 5dbe9b07d987..6bfd7c78ed41 100644 --- a/sc/source/ui/miscdlgs/datafdlg.cxx +++ b/sc/source/ui/miscdlgs/datafdlg.cxx @@ -379,7 +379,7 @@ void ScDataFormDlg::SetButtonState() m_pBtnPrev->Enable(); m_pBtnRestore->Enable( false ); - if ( maEdits.size()>=1 && maEdits[0] != nullptr ) + if ( !maEdits.empty() && maEdits[0] != nullptr ) maEdits[0]->GrabFocus(); } diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index bf4ad3870802..919533227a82 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -9395,7 +9395,7 @@ struct ScUniqueFormatsOrder bool operator()( const ScRangeList& rList1, const ScRangeList& rList2 ) const { // all range lists have at least one entry - OSL_ENSURE( rList1.size() > 0 && rList2.size() > 0, "ScUniqueFormatsOrder: empty list" ); + OSL_ENSURE( !rList1.empty() && !rList2.empty(), "ScUniqueFormatsOrder: empty list" ); // compare start positions using ScAddress comparison operator return ( rList1[ 0 ].aStart < rList2[ 0 ].aStart ); @@ -9479,7 +9479,7 @@ uno::Type SAL_CALL ScUniqueCellFormatsObj::getElementType() sal_Bool SAL_CALL ScUniqueCellFormatsObj::hasElements() { SolarMutexGuard aGuard; - return ( aRangeLists.size() != 0 ); + return ( !aRangeLists.empty() ); } // XEnumerationAccess diff --git a/sc/source/ui/vba/vbaaxes.cxx b/sc/source/ui/vba/vbaaxes.cxx index 1f1ee3b2a9de..09c8195d0bd3 100644 --- a/sc/source/ui/vba/vbaaxes.cxx +++ b/sc/source/ui/vba/vbaaxes.cxx @@ -141,7 +141,7 @@ public: } virtual sal_Bool SAL_CALL hasElements( ) override { - return ( mCoordinates.size() > 0 ); + return ( !mCoordinates.empty() ); } }; diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index cda4214c4d36..bc36ed2d959a 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -1228,7 +1228,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) const SfxPoolItem* pItem = pDoc->GetAttr( nPosX, nPosY, nTab, ATTR_CONDITIONAL ); const ScCondFormatItem* pCondFormatItem = static_cast<const ScCondFormatItem*>(pItem); - if ( !pCondFormatItem->GetCondFormatData().size() ) + if ( pCondFormatItem->GetCondFormatData().empty() ) rSet.DisableItem( nWhich ); else if ( pCondFormatItem->GetCondFormatData().size() == 1 ) rSet.DisableItem( SID_OPENDLG_CURRENTCONDFRMT_MANAGER ); diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx index 22917ec40ee4..804ef7b9ddf2 100644 --- a/sd/source/core/CustomAnimationPreset.cxx +++ b/sd/source/core/CustomAnimationPreset.cxx @@ -563,7 +563,7 @@ Reference< XAnimationNode > CustomAnimationPresets::getRandomPreset( sal_Int16 n pCategoryList = nullptr; } - if( pCategoryList && pCategoryList->size() ) + if( pCategoryList && !pCategoryList->empty() ) { sal_Int32 nCategory = comphelper::rng::uniform_size_distribution(0, pCategoryList->size()-1); diff --git a/sd/source/filter/eppt/pptx-animations.cxx b/sd/source/filter/eppt/pptx-animations.cxx index d4e34d18a03f..34e2aef03122 100644 --- a/sd/source/filter/eppt/pptx-animations.cxx +++ b/sd/source/filter/eppt/pptx-animations.cxx @@ -1256,7 +1256,7 @@ void NodeContext::initValid(bool bHasValidChild, bool bIsIterateChild) { Reference<XIterateContainer> xIterate(mxNode, UNO_QUERY); mbValid = xIterate.is() && (bIsIterateChild || isValidTarget(xIterate->getTarget())) - && maChildNodes.size(); + && !maChildNodes.empty(); } else if (nType == AnimationNodeType::COMMAND) { diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 7a4013469ae3..8b3f3c76acaf 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -574,7 +574,7 @@ void CustomAnimationPane::updateControls() Any aValue; std::vector<OUString> aProperties( pDescriptor->getProperties() ); - if( aProperties.size() >= 1 ) + if( !aProperties.empty() ) { mnPropertyType = getPropertyType( aProperties.front() ); @@ -1209,7 +1209,7 @@ std::unique_ptr<STLPropertySet> CustomAnimationPane::createSelectionSet() sal_Int32 nType = nPropertyTypeNone; std::vector<OUString> aProperties( pDescriptor->getProperties() ); - if( aProperties.size() >= 1 ) + if( !aProperties.empty() ) nType = getPropertyType( aProperties.front() ); if( nType != nPropertyTypeNone ) @@ -1614,7 +1614,7 @@ void CustomAnimationPane::changeSelection( STLPropertySet const * pResultSet, ST // All the effects of the outline object is removed so we need to // put it back. OTOH, the shape object that still has effects // in the text group is fine. - if (nTextGrouping == -1 && pTextGroup->getEffects().size() == 0) + if (nTextGrouping == -1 && pTextGroup->getEffects().empty()) { pEffect->setTarget(makeAny(pEffect->getTargetShape())); pEffect->setGroupId(-1); diff --git a/sd/source/ui/dlg/TemplateScanner.cxx b/sd/source/ui/dlg/TemplateScanner.cxx index 6ce40b056548..fae2557fd889 100644 --- a/sd/source/ui/dlg/TemplateScanner.cxx +++ b/sd/source/ui/dlg/TemplateScanner.cxx @@ -275,7 +275,7 @@ TemplateScanner::State TemplateScanner::ScanFolder() { State eNextState (ERROR); - if (mpFolderDescriptors->size() > 0) + if (!mpFolderDescriptors->empty()) { FolderDescriptor aDescriptor (*mpFolderDescriptors->begin()); mpFolderDescriptors->erase(mpFolderDescriptors->begin()); diff --git a/sd/source/ui/remotecontrol/Receiver.cxx b/sd/source/ui/remotecontrol/Receiver.cxx index 4e810ab5bbd6..042a63006f78 100644 --- a/sd/source/ui/remotecontrol/Receiver.cxx +++ b/sd/source/ui/remotecontrol/Receiver.cxx @@ -52,7 +52,7 @@ void Receiver::pushCommand( const std::vector<OString> &rCommand ) void Receiver::Invoke() { - if( maExecQueue.size() ) + if( !maExecQueue.empty() ) { std::vector< OString > aCommands( maExecQueue.front() ); maExecQueue.pop_front(); diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx index 6f7cd12b64a8..c76105eae2eb 100644 --- a/sd/source/ui/sidebar/MasterPageContainer.cxx +++ b/sd/source/ui/sidebar/MasterPageContainer.cxx @@ -661,7 +661,7 @@ MasterPageContainer::Token MasterPageContainer::Implementation::PutMasterPage ( aResult = (*aEntry)->maToken; std::unique_ptr<std::vector<MasterPageContainerChangeEvent::EventType> > pEventTypes( (*aEntry)->Update(*rpDescriptor)); - if (pEventTypes != nullptr && pEventTypes->size() > 0) + if (pEventTypes != nullptr && !pEventTypes->empty()) { // One or more aspects of the descriptor have changed. Send // appropriate events to the listeners. diff --git a/sd/source/ui/sidebar/MasterPageContainerQueue.cxx b/sd/source/ui/sidebar/MasterPageContainerQueue.cxx index 4690ad283d7a..fce6798068d5 100644 --- a/sd/source/ui/sidebar/MasterPageContainerQueue.cxx +++ b/sd/source/ui/sidebar/MasterPageContainerQueue.cxx @@ -227,7 +227,7 @@ IMPL_LINK(MasterPageContainerQueue, DelayedPreviewCreation, Timer*, pTimer, void } while (false); - if (mpRequestQueue->size() > 0 && ! bWaitForMoreRequests) + if (!mpRequestQueue->empty() && ! bWaitForMoreRequests) { int nTimeout (snDelayedCreationTimeout); if (bIsShowingFullScreenShow) @@ -253,7 +253,7 @@ bool MasterPageContainerQueue::IsEmpty() const void MasterPageContainerQueue::ProcessAllRequests() { snWaitForMoreRequestsCount = 0; - if (mpRequestQueue->size() > 0) + if (!mpRequestQueue->empty()) maDelayedPreviewCreationTimer.Start(); } diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 32b271647157..7f100e66f1f6 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -2229,7 +2229,7 @@ void SlideshowImpl::createSlideList( bool bAll, const OUString& rPresSlide ) // create animation slide controller AnimationSlideController::Mode eMode = - ( pCustomShow && pCustomShow->PagesVector().size() ) ? AnimationSlideController::CUSTOM : + ( pCustomShow && !pCustomShow->PagesVector().empty() ) ? AnimationSlideController::CUSTOM : (bAll ? AnimationSlideController::ALL : AnimationSlideController::FROM); Reference< XDrawPagesSupplier > xDrawPages( mpDoc->getUnoModel(), UNO_QUERY_THROW ); diff --git a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx index 1ae2bd57e3b1..47099f1211e5 100644 --- a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx +++ b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx @@ -78,7 +78,7 @@ void ForAllRectangles (const vcl::Region& rRegion, const std::function<void (con RectangleVector aRectangles; rRegion.GetRegionRectangles(aRectangles); - if(0 == aRectangles.size()) + if(aRectangles.empty()) { aFunction(::tools::Rectangle()); } diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx index 15de3f86a8ab..b1559d9500e5 100644 --- a/sdext/source/minimizer/impoptimizer.cxx +++ b/sdext/source/minimizer/impoptimizer.cxx @@ -386,7 +386,7 @@ static void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XCompon rOptimizer.SetStatusValue( TK_Progress, Any( nProgress ) ); rOptimizer.DispatchStatus(); - if ( aGraphicIter->maUser.size() ) + if ( !aGraphicIter->maUser.empty() ) { GraphicSettings aGraphicSettings( rGraphicSettings ); aGraphicSettings.mbRemoveCropArea = aGraphicIter->mbRemoveCropArea; diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx index 5fed8e18d102..c5e2c4203d8f 100644 --- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx @@ -1285,7 +1285,7 @@ PDFFileImplData* PDFFile::impl_getData() const if( doc_id != pTrailer->m_pDict->m_aMap.end() ) { PDFArray* pArr = dynamic_cast<PDFArray*>(doc_id->second); - if( pArr && pArr->m_aSubElements.size() > 0 ) + if( pArr && !pArr->m_aSubElements.empty() ) { PDFString* pStr = dynamic_cast<PDFString*>(pArr->m_aSubElements[0].get()); if( pStr ) diff --git a/sdext/source/presenter/PresenterTextView.cxx b/sdext/source/presenter/PresenterTextView.cxx index 3583438bcd81..731aee81e911 100644 --- a/sdext/source/presenter/PresenterTextView.cxx +++ b/sdext/source/presenter/PresenterTextView.cxx @@ -725,7 +725,7 @@ void PresenterTextParagraph::AddLine ( Line aLine (rCurrentLine.startPos, rCurrentLine.endPos); // Find the start and end of the line with respect to cells. - if (maLines.size() > 0) + if (!maLines.empty()) { aLine.mnLineStartCellIndex = maLines.back().mnLineEndCellIndex; aLine.mnBaseLine = maLines.back().mnBaseLine + mnLineHeight; diff --git a/sdext/source/presenter/PresenterTimer.cxx b/sdext/source/presenter/PresenterTimer.cxx index 916b6bf168e6..d63ebd8068a9 100644 --- a/sdext/source/presenter/PresenterTimer.cxx +++ b/sdext/source/presenter/PresenterTimer.cxx @@ -577,7 +577,7 @@ void SAL_CALL PresenterClockTimer::notify (const css::uno::Any&) ::std::back_inserter(aListenerCopy)); } - if (aListenerCopy.size() > 0) + if (!aListenerCopy.empty()) { ListenerContainer::const_iterator iListener; ListenerContainer::const_iterator iEnd (aListenerCopy.end()); diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 0d2b41fcecd2..f000d3896f45 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -499,7 +499,7 @@ void SfxDispatcher::Pop(SfxShell& rShell, SfxDispatcherPopFlags nMode) << (bUntil ? " (up to)" : "")); // same shell as on top of the to-do stack? - if(xImp->aToDoStack.size() && xImp->aToDoStack.front().pCluster == &rShell) + if(!xImp->aToDoStack.empty() && xImp->aToDoStack.front().pCluster == &rShell) { // cancel inverse actions if ( xImp->aToDoStack.front().bPush != bPush ) diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 13435a923627..45514d7b1681 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -870,7 +870,7 @@ void ThumbnailView::GetFocus() nSelected = i; } - if (nSelected == -1 && mItemList.size() > 0) + if (nSelected == -1 && !mItemList.empty()) { SelectItem(1); } diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 26dcd99f3bc9..9784a268c39c 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -2426,7 +2426,7 @@ OUString FileDialogHelper::GetPath() const { OUString aPath; - if ( mpImpl->mlLastURLs.size() > 0) + if ( !mpImpl->mlLastURLs.empty()) return mpImpl->mlLastURLs[0]; if ( mpImpl->mxFileDlg.is() ) @@ -2444,7 +2444,7 @@ OUString FileDialogHelper::GetPath() const Sequence < OUString > FileDialogHelper::GetMPath() const { - if ( mpImpl->mlLastURLs.size() > 0) + if ( !mpImpl->mlLastURLs.empty()) return comphelper::containerToSequence(mpImpl->mlLastURLs); if ( mpImpl->mxFileDlg.is() ) diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx index c92d197f2f6e..866e6e1a2292 100644 --- a/sfx2/source/dialog/filtergrouping.cxx +++ b/sfx2/source/dialog/filtergrouping.cxx @@ -805,7 +805,7 @@ namespace sfx2 if ( m_xFilterGroupManager.is() ) { // the file dialog implementation supports visual grouping of filters // create a representation of the group which is understandable by the XFilterGroupManager - if ( _rGroup.size() ) + if ( !_rGroup.empty() ) { Sequence< StringPair > aFilters( comphelper::containerToSequence(_rGroup) ); if ( _bAddExtension ) diff --git a/sfx2/source/doc/doctemplateslocal.cxx b/sfx2/source/doc/doctemplateslocal.cxx index 294274e2e472..197047de7af6 100644 --- a/sfx2/source/doc/doctemplateslocal.cxx +++ b/sfx2/source/doc/doctemplateslocal.cxx @@ -145,7 +145,7 @@ void SAL_CALL DocTemplLocaleHelper::startElement( const OUString& aName, const u { if ( aName == g_sGroupListElement ) { - if ( m_aElementsSeq.size() != 0 ) + if ( !m_aElementsSeq.empty() ) throw xml::sax::SAXException(); // TODO: this element must be the first level element m_aElementsSeq.push_back( aName ); diff --git a/sfx2/source/notebookbar/PriorityHBox.cxx b/sfx2/source/notebookbar/PriorityHBox.cxx index 83b6288afdcb..0a641e2c8259 100644 --- a/sfx2/source/notebookbar/PriorityHBox.cxx +++ b/sfx2/source/notebookbar/PriorityHBox.cxx @@ -200,7 +200,7 @@ void PriorityHBox::GetChildrenWithPriorities() m_aSortedChildren.push_back(pPrioritable); } - if (!m_aSortedChildren.size()) + if (m_aSortedChildren.empty()) m_bInitialized = false; std::sort(m_aSortedChildren.begin(), m_aSortedChildren.end(), lcl_comparePriority); diff --git a/sfx2/source/notify/globalevents.cxx b/sfx2/source/notify/globalevents.cxx index ed495f8d23ef..ca3b680f295e 100644 --- a/sfx2/source/notify/globalevents.cxx +++ b/sfx2/source/notify/globalevents.cxx @@ -339,7 +339,7 @@ sal_Bool SAL_CALL SfxGlobalEvents_Impl::hasElements() { // SAFE -> ::osl::ResettableMutexGuard aLock(m_aLock); - return (m_lModels.size()>0); + return (!m_lModels.empty()); // <- SAFE } diff --git a/slideshow/source/engine/smilfunctionparser.cxx b/slideshow/source/engine/smilfunctionparser.cxx index e029b83d8a2f..ed397d0a7eca 100644 --- a/slideshow/source/engine/smilfunctionparser.cxx +++ b/slideshow/source/engine/smilfunctionparser.cxx @@ -234,7 +234,7 @@ namespace slideshow { ParserContext::OperandStack& rNodeStack( mpContext->maOperandStack ); - if( rNodeStack.size() < 1 ) + if( rNodeStack.empty() ) throw ParseError( "Not enough arguments for unary operator" ); // retrieve arguments diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx index 98424bd9e5d2..2ee87e71458d 100644 --- a/sot/source/base/formats.cxx +++ b/sot/source/base/formats.cxx @@ -1405,7 +1405,7 @@ static sal_uInt16 GetTransferableAction_Impl( { try { - if( rDataFlavorExVector.size() ) + if( !rDataFlavorExVector.empty() ) { const SotAction_Impl* pArrayStart = pArray; SotClipboardFormatId nId = pArray->nFormatId; diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx b/sot/source/unoolestorage/xolesimplestorage.cxx index d4414a2e58ec..8804c4318fad 100644 --- a/sot/source/unoolestorage/xolesimplestorage.cxx +++ b/sot/source/unoolestorage/xolesimplestorage.cxx @@ -550,7 +550,7 @@ sal_Bool SAL_CALL OLESimpleStorage::hasElements() throw uno::RuntimeException(); // TODO: } - return aList.size() != 0; + return !aList.empty(); } diff --git a/svgio/source/svgreader/svgdocumenthandler.cxx b/svgio/source/svgreader/svgdocumenthandler.cxx index 447221b55215..b9ef76de8bf2 100644 --- a/svgio/source/svgreader/svgdocumenthandler.cxx +++ b/svgio/source/svgreader/svgdocumenthandler.cxx @@ -157,19 +157,19 @@ namespace svgio [&](std::unique_ptr<SvgNode> const & p) { return p.get() == mpTarget; })) delete mpTarget; } - OSL_ENSURE(!maCssContents.size(), "SvgDocHdl destructed with active css style stack entry (!)"); + OSL_ENSURE(maCssContents.empty(), "SvgDocHdl destructed with active css style stack entry (!)"); } void SvgDocHdl::startDocument( ) { OSL_ENSURE(!mpTarget, "Already a target at document start (!)"); - OSL_ENSURE(!maCssContents.size(), "SvgDocHdl startDocument with active css style stack entry (!)"); + OSL_ENSURE(maCssContents.empty(), "SvgDocHdl startDocument with active css style stack entry (!)"); } void SvgDocHdl::endDocument( ) { OSL_ENSURE(!mpTarget, "Still a target at document end (!)"); - OSL_ENSURE(!maCssContents.size(), "SvgDocHdl endDocument with active css style stack entry (!)"); + OSL_ENSURE(maCssContents.empty(), "SvgDocHdl endDocument with active css style stack entry (!)"); } void SvgDocHdl::startElement( const OUString& aName, const uno::Reference< xml::sax::XAttributeList >& xAttribs ) @@ -525,7 +525,7 @@ namespace svgio if(pCssStyle && pCssStyle->isTextCss()) { // css style parsing - if(maCssContents.size()) + if(!maCssContents.empty()) { // need to interpret css styles and remember them as StyleSheets // #125325# Caution! the Css content may contain block comments @@ -569,7 +569,7 @@ namespace svgio const auto& rChilds = mpTarget->getChildren(); SvgCharacterNode* pTarget = nullptr; - if(rChilds.size()) + if(!rChilds.empty()) { pTarget = dynamic_cast< SvgCharacterNode* >(rChilds[rChilds.size() - 1].get()); } @@ -594,7 +594,7 @@ namespace svgio if(rSvgStyleNode.isTextCss()) { // collect characters for css style - if(maCssContents.size()) + if(!maCssContents.empty()) { const OUString aTrimmedChars(aChars.trim()); diff --git a/svgio/source/svgreader/svgstylenode.cxx b/svgio/source/svgreader/svgstylenode.cxx index 281bab937bb2..5fdd73e9828b 100644 --- a/svgio/source/svgreader/svgstylenode.cxx +++ b/svgio/source/svgreader/svgstylenode.cxx @@ -112,7 +112,7 @@ namespace svgio } } - if(aSelectorParts.size()) + if(!aSelectorParts.empty()) { OUStringBuffer aConcatenatedSelector; diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index f90588288163..11400851d6bf 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -672,7 +672,7 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich else { // Unconditionally insert; check for a recently freed place - if (pItemArr->maFree.size() > 0) + if (!pItemArr->maFree.empty()) { auto itr = pItemArr->begin(); sal_uInt32 nIdx = pItemArr->maFree.back(); diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 6126f341ec6a..c9ba487b91e0 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -258,7 +258,7 @@ void BrowseBox::ToggleSelection() tools::Rectangle aAddRect( Point( nOfsX, (nRow-nTopRow)*GetDataRowHeight() ), Size( pDataWin->GetSizePixel().Width(), GetDataRowHeight() ) ); - if ( aHighlightList.size() && nLastRowInRect == ( nRow - 1 ) ) + if ( !aHighlightList.empty() && nLastRowInRect == ( nRow - 1 ) ) aHighlightList[ 0 ].Union( aAddRect ); else aHighlightList.emplace( aHighlightList.begin(), aAddRect ); diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 551122ad913d..11a1f6e6890a 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -202,7 +202,7 @@ void SvImpLBox::UpdateContextBmpWidthVectorFromMovedEntry( SvTreeListEntry* pEnt void SvImpLBox::UpdateContextBmpWidthMax( SvTreeListEntry const * pEntry ) { sal_uInt16 nDepth = pView->pModel->GetDepth( pEntry ); - if( aContextBmpWidthVector.size() < 1 ) + if( aContextBmpWidthVector.empty() ) return; short nWidth = aContextBmpWidthVector[ nDepth ]; if( nWidth != pView->nContextBmpWidthMax ) { diff --git a/svtools/source/control/autocmpledit.cxx b/svtools/source/control/autocmpledit.cxx index d008ee41bc69..8bffcd166eb4 100644 --- a/svtools/source/control/autocmpledit.cxx +++ b/svtools/source/control/autocmpledit.cxx @@ -44,7 +44,7 @@ IMPL_LINK_NOARG(AutocompleteEdit, AutoCompleteHdl_Impl, Edit&, void) if( aCurText.isEmpty() ) return; - if( m_aEntries.size() ) + if( !m_aEntries.empty() ) { if( Match( aCurText ) ) { @@ -89,7 +89,7 @@ bool AutocompleteEdit::PreNotify( NotifyEvent& rNEvt ) Selection aSelection( GetSelection() ); sal_uInt16 nLen = static_cast<sal_uInt16>(aSelection.Min()); - if( m_aMatching.size() && + if( !m_aMatching.empty() && ( ( aCode == KEY_DOWN && m_nCurrent + 1 < m_aMatching.size() ) || ( aCode == KEY_UP && m_nCurrent > 0 ) ) ) { diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index cebb1172587a..3f97b55b1e10 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -2531,7 +2531,7 @@ Size TabBar::CalcWindowSizePixel() const { long nWidth = 0; - if (mpImpl->mpItemList.size() > 0) + if (!mpImpl->mpItemList.empty()) { const_cast<TabBar*>(this)->ImplCalcWidth(); for (auto& pItem : mpImpl->mpItemList) diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 275ac4dcc550..04d3622ed4ec 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -1033,7 +1033,7 @@ ValueSetItem* ValueSet::ImplGetItem( size_t nPos ) ValueSetItem* ValueSet::ImplGetFirstItem() { - return mItemList.size() ? mItemList[0].get() : nullptr; + return !mItemList.empty() ? mItemList[0].get() : nullptr; } sal_uInt16 ValueSet::ImplGetVisibleItemCount() const @@ -2404,7 +2404,7 @@ SvtValueSetItem* SvtValueSet::ImplGetItem( size_t nPos ) SvtValueSetItem* SvtValueSet::ImplGetFirstItem() { - return mItemList.size() ? mItemList[0].get() : nullptr; + return !mItemList.empty() ? mItemList[0].get() : nullptr; } sal_uInt16 SvtValueSet::ImplGetVisibleItemCount() const diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx index e76aa4266214..b2ff6deef3d7 100644 --- a/svtools/source/dialogs/wizardmachine.cxx +++ b/svtools/source/dialogs/wizardmachine.cxx @@ -549,7 +549,7 @@ namespace svt bool OWizardMachine::travelPrevious() { - DBG_ASSERT(m_pImpl->aStateHistory.size() > 0, "OWizardMachine::travelPrevious: have no previous page!"); + DBG_ASSERT(!m_pImpl->aStateHistory.empty(), "OWizardMachine::travelPrevious: have no previous page!"); // allowed to leave the current page? if ( !prepareLeaveCurrentState( eTravelBackward ) ) diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx index 355fbd4695c3..a2b0b09acbc9 100644 --- a/svtools/source/misc/templatefoldercache.cxx +++ b/svtools/source/misc/templatefoldercache.cxx @@ -218,7 +218,7 @@ namespace svt if ( _rLHS->getSubContents().size() != _rRHS->getSubContents().size() ) return false; - if ( _rLHS->getSubContents().size() ) + if ( !_rLHS->getSubContents().empty() ) { // there are children // -> compare them ::std::pair< FolderIterator, FolderIterator > aFirstDifferent = ::std::mismatch( diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx index 728bf2cca437..61d2be064b0b 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx @@ -817,7 +817,7 @@ public: { ParserContext::OperandStack& rNodeStack( mxContext->maOperandStack ); - if( rNodeStack.size() < 1 ) + if( rNodeStack.empty() ) throw ParseError( "Not enough arguments for unary operator" ); // retrieve arguments diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 0eb340933404..0709e3eec852 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -821,7 +821,7 @@ void FmXFormShell::invalidateFeatures( const ::std::vector< sal_Int32 >& _rFeatu if (impl_checkDisposed_Lock()) return; - OSL_ENSURE( _rFeatures.size() > 0, "FmXFormShell::invalidateFeatures: invalid arguments!" ); + OSL_ENSURE( !_rFeatures.empty(), "FmXFormShell::invalidateFeatures: invalid arguments!" ); if ( m_pShell->GetViewShell() && m_pShell->GetViewShell()->GetViewFrame() ) { @@ -889,7 +889,7 @@ void FmXFormShell::disposing() CloseExternalFormViewer_Lock(); - while ( m_aLoadingPages.size() ) + while ( !m_aLoadingPages.empty() ) { Application::RemoveUserEvent( m_aLoadingPages.front().nEventId ); m_aLoadingPages.pop(); diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 1a9291bf55a0..e1761279fdd4 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -348,7 +348,7 @@ namespace svxform bool bSingleSelection = (m_arrCurrentSelection.size() == 1); - DBG_ASSERT( (m_arrCurrentSelection.size() > 0) || m_bRootSelected, "no entries selected" ); + DBG_ASSERT( (!m_arrCurrentSelection.empty()) || m_bRootSelected, "no entries selected" ); // shouldn't happen, because I would have selected one during call to IsSelected, // if there was none before @@ -774,7 +774,7 @@ namespace svxform // List of dropped entries from DragServer const ListBoxEntrySet& aDropped = m_aControlExchange->selected(); - DBG_ASSERT(aDropped.size() >= 1, "NavigatorTree::implAcceptDataTransfer: no entries !"); + DBG_ASSERT(!aDropped.empty(), "NavigatorTree::implAcceptDataTransfer: no entries !"); bool bDropTargetIsComponent = IsFormComponentEntry( _pTargetEntry ); //SvTreeListEntry* pDropTargetParent = GetParent( _pTargetEntry ); @@ -1012,7 +1012,7 @@ namespace svxform // list of dragged entries ListBoxEntrySet aDropped = _rData.selected(); - DBG_ASSERT(aDropped.size() >= 1, "NavigatorTree::implExecuteDataTransfer: no entries!"); + DBG_ASSERT(!aDropped.empty(), "NavigatorTree::implExecuteDataTransfer: no entries!"); // shell and model FmFormShell* pFormShell = GetNavModel()->GetFormShell(); diff --git a/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx b/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx index 0c6067cd3efd..78e136b652ae 100644 --- a/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx +++ b/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx @@ -139,12 +139,12 @@ namespace drawinglayer const basegfx::B2DRange& rPaintRange, const basegfx::B2DRange& rDefineRange) const { - if(maPrimitives.size() && (maLastPaintRange != rPaintRange || maLastDefineRange != rDefineRange)) + if(!maPrimitives.empty() && (maLastPaintRange != rPaintRange || maLastDefineRange != rDefineRange)) { const_cast< SdrAllFillAttributesHelper* >(this)->maPrimitives.clear(); } - if(!maPrimitives.size()) + if(maPrimitives.empty()) { const_cast< SdrAllFillAttributesHelper* >(this)->createPrimitive2DSequence(rPaintRange, rDefineRange); } diff --git a/svx/source/sdr/contact/viewcontactofe3d.cxx b/svx/source/sdr/contact/viewcontactofe3d.cxx index 253bdea07f30..c32e823b1ca3 100644 --- a/svx/source/sdr/contact/viewcontactofe3d.cxx +++ b/svx/source/sdr/contact/viewcontactofe3d.cxx @@ -88,7 +88,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfE3d::impCreateWithG const basegfx::B3DRange& rAllContentRange = pVCOfE3DScene->getAllContentRange3D(); drawinglayer::geometry::ViewInformation3D aViewInformation3D(pVCOfE3DScene->getViewInformation3D()); - if(pVCOfE3DScene->getSdrLightingAttribute().getLightVector().size()) + if(!pVCOfE3DScene->getSdrLightingAttribute().getLightVector().empty()) { // get light normal from first light and normalize aLightNormal = pVCOfE3DScene->getSdrLightingAttribute().getLightVector()[0].getDirection(); diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx index c3fa222b83ed..3660598a23f7 100644 --- a/svx/source/sdr/overlay/overlaymanager.cxx +++ b/svx/source/sdr/overlay/overlaymanager.cxx @@ -239,7 +239,7 @@ namespace sdr void OverlayManager::completeRedraw(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice) const { - if(!rRegion.IsEmpty() && maOverlayObjects.size()) + if(!rRegion.IsEmpty() && !maOverlayObjects.empty()) { // check for changed MapModes. That may influence the // logical size of pixel based OverlayObjects (like BitmapHandles) diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 43f951527d8c..4f856c588dc8 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -705,7 +705,7 @@ void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay } // #i54102# if there are edges, reconnect their ends to the corresponding clones (if found) - if(aEdges.size()) + if(!aEdges.empty()) { for(SdrEdgeObj* pSdrEdgeObj: aEdges) { diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index b74dde640e4e..e5338d43085b 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -850,7 +850,7 @@ void SdrEditView::DeleteMarkedObj() GetMarkedObjectListWriteAccess().Clear(); maHdlList.Clear(); - while(aParents.size() && !GetMarkedObjectCount()) + while(!aParents.empty() && !GetMarkedObjectCount()) { // iterate over remembered parents SdrObject* pParent = aParents.back(); diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index 72347de60639..6ea58083d472 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -792,7 +792,7 @@ bool ImpSdrGDIMetaFileImport::CheckLastLineMerge(const basegfx::B2DPolygon& rSrc // #i73407# reformulation to use new B2DPolygon classes if(mbLastObjWasLine && (maOldLineColor == mpVD->GetLineColor()) && rSrcPoly.count()) { - SdrObject* pTmpObj = maTmpList.size() ? maTmpList[maTmpList.size() - 1] : nullptr; + SdrObject* pTmpObj = !maTmpList.empty() ? maTmpList[maTmpList.size() - 1] : nullptr; SdrPathObj* pLastPoly = dynamic_cast< SdrPathObj* >(pTmpObj); if(pLastPoly) @@ -858,7 +858,7 @@ bool ImpSdrGDIMetaFileImport::CheckLastPolyLineAndFillMerge(const basegfx::B2DPo // #i73407# reformulation to use new B2DPolygon classes if(mbLastObjWasPolyWithoutLine) { - SdrObject* pTmpObj = maTmpList.size() ? maTmpList[maTmpList.size() - 1] : nullptr; + SdrObject* pTmpObj = !maTmpList.empty() ? maTmpList[maTmpList.size() - 1] : nullptr; SdrPathObj* pLastPoly = dynamic_cast< SdrPathObj* >(pTmpObj); if(pLastPoly) diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index 9346c9f86c58..770bd440a86a 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -477,7 +477,7 @@ namespace const sal_Int32 nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen)); ::std::vector< double > aNewDXArray; - if(nNextGlyphLen > 1 && pCandidate->getDoubleDXArray().size()) + if(nNextGlyphLen > 1 && !pCandidate->getDoubleDXArray().empty()) { // copy DXArray for portion aNewDXArray.insert( diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 5c739744c285..881880255f90 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -691,7 +691,7 @@ bool ImpSdrPdfImport::CheckLastPolyLineAndFillMerge(const basegfx::B2DPolyPolygo // #i73407# reformulation to use new B2DPolygon classes if (mbLastObjWasPolyWithoutLine) { - SdrObject* pTmpObj = maTmpList.size() ? maTmpList[maTmpList.size() - 1] : nullptr; + SdrObject* pTmpObj = !maTmpList.empty() ? maTmpList[maTmpList.size() - 1] : nullptr; SdrPathObj* pLastPoly = dynamic_cast<SdrPathObj*>(pTmpObj); if (pLastPoly) diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index c722484602aa..db929f86af57 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -699,7 +699,7 @@ void SdrExchangeView::DrawMarkedObj(OutputDevice& rOut) const { ::std::vector< SdrObject* > aSdrObjects(GetMarkedObjects()); - if(aSdrObjects.size()) + if(!aSdrObjects.empty()) { sdr::contact::ObjectContactOfObjListPainter aPainter(rOut, aSdrObjects, aSdrObjects[0]->getSdrPageFromSdrObject()); sdr::contact::DisplayInfo aDisplayInfo; diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx index 55c5fdfdc01d..29fe40b58620 100644 --- a/svx/source/table/tablertfimporter.cxx +++ b/svx/source/table/tablertfimporter.cxx @@ -238,7 +238,7 @@ void SdrTableRTFParser::InsertCell( RtfImportInfo const * pInfo ) RTFColumnVectorPtr xColumn( maRows.back() ); if ( xCellInfo->mxVMergeCell ) { - if ( xColumn->size()==0 || + if ( xColumn->empty() || xColumn->back()->mxVMergeCell != xCellInfo->mxVMergeCell ) xCellInfo->mxVMergeCell->mnRowSpan++; } diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx index fcd6a2b80c99..8cb98e35b5c6 100644 --- a/sw/source/core/access/accdoc.cxx +++ b/sw/source/core/access/accdoc.cxx @@ -858,7 +858,7 @@ css::uno::Sequence< css::uno::Any > while( _pStartCursor && ( (_pStartCursor = _pStartCursor->GetNext()) != _pStartCursor2) ); - if ( vFrameList.size() ) + if ( !vFrameList.empty() ) { uno::Sequence< uno::Any > aRet(vFrameList.size()); std::vector<SwFrame*>::iterator aIter = vFrameList.begin(); diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index 0d9bd2460819..a5236330f46e 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -717,7 +717,7 @@ bool SwAccessiblePortionData::IsValidCorePosition( sal_Int32 nPos ) const bool SwAccessiblePortionData::IsZeroCorePositionData() { - if( m_aModelPositions.size() < 1 ) return true; + if( m_aModelPositions.empty() ) return true; return m_aModelPositions[0] == 0 && m_aModelPositions[m_aModelPositions.size()-1] == 0; } diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index b93ab75d4718..956efc128f1a 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1014,7 +1014,7 @@ bool SwCursorShell::GotoNextOutline() { const SwNodes& rNds = GetDoc()->GetNodes(); - if ( rNds.GetOutLineNds().size() == 0 ) + if ( rNds.GetOutLineNds().empty() ) { SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound ); return false; @@ -1053,7 +1053,7 @@ bool SwCursorShell::GotoPrevOutline() { const SwNodes& rNds = GetDoc()->GetNodes(); - if ( rNds.GetOutLineNds().size() == 0 ) + if ( rNds.GetOutLineNds().empty() ) { SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound ); return false; @@ -1446,7 +1446,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, std::vector<SwTextAttr *> const marks( pTextNd->GetTextAttrsAt( aPos.nContent.GetIndex(), RES_TXTATR_TOXMARK)); - if (marks.size()) + if (!marks.empty()) { // hmm... can only return 1 here pTextAttr = *marks.begin(); } @@ -1458,7 +1458,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, std::vector<SwTextAttr *> const marks( pTextNd->GetTextAttrsAt( aPos.nContent.GetIndex(), RES_TXTATR_REFMARK)); - if (marks.size()) + if (!marks.empty()) { // hmm... can only return 1 here pTextAttr = *marks.begin(); } diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx index 6115e918be4f..4de4450e54f2 100644 --- a/sw/source/core/crsr/trvlfnfl.cxx +++ b/sw/source/core/crsr/trvlfnfl.cxx @@ -191,7 +191,7 @@ bool SwCursor::GotoNextFootnoteAnchor() const SwTextFootnote* pTextFootnote = nullptr; size_t nPos = 0; - if( !rFootnoteArr.size() ) + if( rFootnoteArr.empty() ) { SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound ); return false; @@ -264,7 +264,7 @@ bool SwCursor::GotoPrevFootnoteAnchor() const SwTextFootnote* pTextFootnote = nullptr; size_t nPos = 0; - if( !rFootnoteArr.size() ) + if( rFootnoteArr.empty() ) { SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound ); return false; diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index f8d802cf95fa..9593f326d149 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -444,7 +444,7 @@ void SwSelPaintRects::HighlightInputField() } } - if ( aInputFieldRanges.size() > 0 ) + if ( !aInputFieldRanges.empty() ) { if (m_pTextInputFieldOverlay != nullptr) { diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 679fd7d1f098..1b40c8605e49 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -4090,7 +4090,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt } else { - if( !m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline() && m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().size() ) + if( !m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline() && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty() ) m_rDoc.getIDocumentRedlineAccess().DeleteRedline( aDelPam, true, USHRT_MAX ); SwUndoReplace* pUndoRpl = nullptr; diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 076428024811..4e203e565108 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -2540,7 +2540,7 @@ void DocumentRedlineManager::AcceptAllRedline(bool bAccept) rUndoMgr.StartUndo(bAccept ? SwUndoId::ACCEPT_REDLINE : SwUndoId::REJECT_REDLINE, &aRewriter); } - while (mpRedlineTable->size() > 0) + while (!mpRedlineTable->empty()) { if (bAccept) AcceptRedline(mpRedlineTable->size() - 1, true); diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 18f59510ed43..9eb49b95a44b 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -366,7 +366,7 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView ) GetIDocumentUndoRedo().AppendUndo(std::unique_ptr<SwUndo>(pUndo)); } - while ( pFormatsAndObjs[i].size() > 0 ) + while ( !pFormatsAndObjs[i].empty() ) { SwDrawFrameFormat* pFormat( pFormatsAndObjs[i].back().first ); SdrObject* pObj( pFormatsAndObjs[i].back().second ); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 92a49b7c5205..28d5cd766aea 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -1141,7 +1141,7 @@ bool SwDoc::ReplaceNumRule( const SwPosition& rPos, SwNumRule::tTextNodeList aTextNodeList; pOldRule->GetTextNodeList( aTextNodeList ); - if ( aTextNodeList.size() > 0 ) + if ( !aTextNodeList.empty() ) { SwRegHistory aRegH( pUndo ? pUndo->GetHistory() : nullptr ); sal_uInt16 nChgFormatLevel = 0; diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index d5cc122cc9f0..70633e0eada5 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -849,7 +849,7 @@ sal_uInt16 FlatFndBox::GetRowCount(const FndBox_& rBox) sal_uInt16 nLn = 1; for (const auto &rpB : rBoxes) { - if (rpB->GetLines().size()) + if (!rpB->GetLines().empty()) { // Iterate recursively over the Lines nLn = std::max(GetRowCount(*rpB), nLn); } diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index f82d8bb706d3..da0135abd966 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -392,9 +392,9 @@ const SwStartNode *SwHTMLTableLayout::GetAnyBoxStartNode() const const SwTableBox* pBox = m_pSwTable->GetTabLines()[0]->GetTabBoxes()[0]; while( nullptr == (pBoxSttNd = pBox->GetSttNd()) ) { - OSL_ENSURE( pBox->GetTabLines().size() > 0, + OSL_ENSURE( !pBox->GetTabLines().empty(), "Box without start node and lines" ); - OSL_ENSURE( pBox->GetTabLines().front()->GetTabBoxes().size() > 0, + OSL_ENSURE( !pBox->GetTabLines().front()->GetTabBoxes().empty(), "Line without boxes" ); pBox = pBox->GetTabLines().front()->GetTabBoxes().front(); } diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 710b693bfb7b..ee0050226efe 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -297,7 +297,7 @@ static void lcl_CopyCol( FndBox_ & rFndBox, CpyPara *const pCpyPara) SwFormatFrameSize aFrameSz( pNewFormat->GetFrameSize() ); bool bDiffCount = false; - if( pBox->GetTabLines().size() ) + if( !pBox->GetTabLines().empty() ) { pCmpLine = rFndBox.GetLines().front().get(); if ( pCmpLine->GetBoxes().size() != pCmpLine->GetLine()->GetTabBoxes().size() ) @@ -1411,7 +1411,7 @@ static void lcl_Merge_MoveBox(FndBox_ & rFndBox, InsULPara *const pULPara) pBoxes = &pULPara->pInsLine->GetTabBoxes(); // Is there still a level to step down to? - if (rFndBox.GetBox()->GetTabLines().size()) + if (!rFndBox.GetBox()->GetTabLines().empty()) { SwTableBox* pBox = new SwTableBox( static_cast<SwTableBoxFormat*>(rFndBox.GetBox()->GetFrameFormat()), @@ -1423,7 +1423,7 @@ static void lcl_Merge_MoveBox(FndBox_ & rFndBox, InsULPara *const pULPara) { lcl_Merge_MoveLine(**it, &aPara); } - if( pBox->GetTabLines().size() ) + if( !pBox->GetTabLines().empty() ) { if( USHRT_MAX == nInsPos ) nInsPos = pBoxes->size(); @@ -1730,7 +1730,7 @@ static void lcl_CalcNewWidths(const FndLines_t& rFndLines, CpyPara& rPara) { std::vector< sal_uLong > &rWidth = (*rPara.pWidths.get())[ nLine ]; const FndLine_ *pFndLine = rFndLines[ nLine ].get(); - if( pFndLine && pFndLine->GetBoxes().size() ) + if( pFndLine && !pFndLine->GetBoxes().empty() ) { const SwTableLine *pLine = pFndLine->GetLine(); if( pLine && !pLine->GetTabBoxes().empty() ) diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 28ec60d97d43..09ac4f83f61d 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -350,7 +350,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, } bool bUpdateFootnote = false; - if( GetFootnoteIdxs().size() && pAttr ) + if( !GetFootnoteIdxs().empty() && pAttr ) { sal_uInt16 nVal = pAttr->Get( RES_FTN_AT_TXTEND ).GetValue(); if( ( FTNEND_ATTXTEND_OWNNUMSEQ == nVal || @@ -748,7 +748,7 @@ void SwDoc::UpdateSection( size_t const nPos, SwSectionData & rNewData, void sw_DeleteFootnote( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd ) { SwFootnoteIdxs& rFootnoteArr = pNd->GetDoc()->GetFootnoteIdxs(); - if( rFootnoteArr.size() ) + if( !rFootnoteArr.empty() ) { size_t nPos = 0; rFootnoteArr.SeekEntry( SwNodeIndex( *pNd ), &nPos ); diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index d59d39a820c2..9c36a1fadff7 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -1703,7 +1703,7 @@ bool SwContentNode::GetAttr( SfxItemSet& rSet ) const sal_uInt16 SwContentNode::ClearItemsFromAttrSet( const std::vector<sal_uInt16>& rWhichIds ) { sal_uInt16 nRet = 0; - if ( 0 == rWhichIds.size() ) + if ( rWhichIds.empty() ) return nRet; OSL_ENSURE( GetpSwAttrSet(), "no item set" ); diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 2953fdb9d567..e7dd6788a979 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -1074,12 +1074,12 @@ void SwEditShell::ApplyChangedSentence(const svx::SpellPortions& rNewPortions, b OSL_ENSURE( g_pSpellIter, "SpellIter missing" ); if (!g_pSpellIter || - g_pSpellIter->GetLastPortions().size() <= 0) // no portions -> no text to be changed + g_pSpellIter->GetLastPortions().empty()) // no portions -> no text to be changed return; const SpellPortions& rLastPortions = g_pSpellIter->GetLastPortions(); const SpellContentPositions rLastPositions = g_pSpellIter->GetLastPositions(); - OSL_ENSURE(rLastPortions.size() > 0 && + OSL_ENSURE(!rLastPortions.empty() && rLastPortions.size() == rLastPositions.size(), "last vectors of spelling results are not set or not equal"); diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index f4dfc7994637..74e1eeb9584f 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -892,7 +892,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc ) break; // exit the "while-loop" } else if( *aCpyPam.GetPoint() == *aCpyPam.GetMark() && - pClpDoc->GetSpzFrameFormats()->size() ) + !pClpDoc->GetSpzFrameFormats()->empty() ) { // we need a DrawView if( !Imp()->GetDrawView() ) @@ -1154,7 +1154,7 @@ void SwFEShell::PastePages( SwFEShell& rToFill, sal_uInt16 nStartPage, sal_uInt1 } // now the page bound objects // additionally copy page bound frames - if( GetDoc()->GetSpzFrameFormats()->size() ) + if( !GetDoc()->GetSpzFrameFormats()->empty() ) { // create a draw view if necessary if( !rToFill.Imp()->GetDrawView() ) diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 43e8a4219bfe..c56986b7ea6c 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -1877,7 +1877,7 @@ void SwFEShell::GetConnectableFrameFormats(SwFrameFormat & rFormat, } - if (aTmpSpzArray.size() > 0) + if (!aTmpSpzArray.empty()) { aPrevPageVec.clear(); aThisPageVec.clear(); diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index ece9442cc5d4..61001866b042 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -203,7 +203,7 @@ void SwFEShell::InsertRow( sal_uInt16 nCnt, bool bBehind ) TableWait aWait( nCnt, pFrame, *GetDoc()->GetDocShell(), aBoxes.size() ); - if ( aBoxes.size() ) + if ( !aBoxes.empty() ) GetDoc()->InsertRow( aBoxes, nCnt, bBehind ); EndAllActionAndCall(); diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 06dd1cf815cd..6f17da290939 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -2060,7 +2060,7 @@ static void lcl_InsertRow( SwTableLine const &rLine, SwLayoutFrame *pUpper, SwFr static void FndBoxCopyCol( SwTableBox* pBox, FndPara* pFndPara ) { std::unique_ptr<FndBox_> pFndBox(new FndBox_( pBox, pFndPara->pFndLine )); - if( pBox->GetTabLines().size() ) + if( !pBox->GetTabLines().empty() ) { FndPara aPara( *pFndPara, pFndBox.get() ); ForEach_FndLineCopyCol( pFndBox->GetBox()->GetTabLines(), &aPara ); @@ -2086,7 +2086,7 @@ static void FndLineCopyCol( SwTableLine* pLine, FndPara* pFndPara ) for( SwTableBoxes::iterator it = pFndLine->GetLine()->GetTabBoxes().begin(); it != pFndLine->GetLine()->GetTabBoxes().end(); ++it) FndBoxCopyCol(*it, &aPara ); - if( pFndLine->GetBoxes().size() ) + if( !pFndLine->GetBoxes().empty() ) { pFndPara->pFndBox->GetLines().push_back( std::move(pFndLine) ); } @@ -2538,7 +2538,7 @@ bool FndBox_::AreLinesToRestore( const SwTable &rTable ) const { // Should we call MakeFrames here? - if ( !m_pLineBefore && !m_pLineBehind && rTable.GetTabLines().size() ) + if ( !m_pLineBefore && !m_pLineBehind && !rTable.GetTabLines().empty() ) return true; sal_uInt16 nBfPos; diff --git a/sw/source/core/layout/objstmpconsiderwrapinfl.cxx b/sw/source/core/layout/objstmpconsiderwrapinfl.cxx index 9c5a2240eeac..e35336b9fc3c 100644 --- a/sw/source/core/layout/objstmpconsiderwrapinfl.cxx +++ b/sw/source/core/layout/objstmpconsiderwrapinfl.cxx @@ -47,7 +47,7 @@ void SwObjsMarkedAsTmpConsiderWrapInfluence::Remove( SwAnchoredObject& _rAnchore void SwObjsMarkedAsTmpConsiderWrapInfluence::Clear() { - while ( maObjsTmpConsiderWrapInfl.size() ) + while ( !maObjsTmpConsiderWrapInfl.empty() ) { SwAnchoredObject* pAnchoredObj = maObjsTmpConsiderWrapInfl.back(); pAnchoredObj->SetTmpConsiderWrapInfluence( false ); diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 3c621722b3f5..f16cde1fc091 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1731,7 +1731,7 @@ bool DrawFillAttributes( aPaintRange, aDefineRange); - if(rSequence.size()) + if(!rSequence.empty()) { drawinglayer::primitive2d::Primitive2DContainer const* pPrimitives(&rSequence); diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index 3e659366264d..c0dfeaba837a 100644 --- a/sw/source/core/text/pormulti.cxx +++ b/sw/source/core/text/pormulti.cxx @@ -839,7 +839,7 @@ namespace sw { { m_First = false; rpNode = m_pMerged - ? m_pMerged->extents.size() + ? !m_pMerged->extents.empty() ? m_pMerged->extents[0].pNode : m_pMerged->pFirstNode : m_pNode; diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index 65107e295e2f..424f1acb59d6 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -223,7 +223,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) } } - if (m_FlyUndos.size()) + if (!m_FlyUndos.empty()) { sal_uLong nTmp = rPam.GetPoint()->nNode.GetIndex(); for (size_t n = m_FlyUndos.size(); 0 < n; --n) diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 5a93eaedf06c..da1facfad0ab 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -475,7 +475,7 @@ bool getCursorPropertyValue(const SfxItemPropertySimpleEntry& rEntry marks = rPam.GetNode().GetTextNode()->GetTextAttrsAt( rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_TOXMARK); } - if (marks.size()) + if (!marks.empty()) { if( pAny ) { // hmm... can only return 1 here @@ -644,7 +644,7 @@ bool getCursorPropertyValue(const SfxItemPropertySimpleEntry& rEntry marks = rPam.GetNode().GetTextNode()->GetTextAttrsAt( rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_REFMARK); } - if (marks.size()) + if (!marks.empty()) { if( pAny ) { // hmm... can only return 1 here diff --git a/sw/source/core/unocore/unoredlines.cxx b/sw/source/core/unocore/unoredlines.cxx index d75670160bf0..0f5b5d8a0d4b 100644 --- a/sw/source/core/unocore/unoredlines.cxx +++ b/sw/source/core/unocore/unoredlines.cxx @@ -86,7 +86,7 @@ sal_Bool SwXRedlines::hasElements( ) if(!IsValid()) throw uno::RuntimeException(); const SwRedlineTable& rRedTable = GetDoc()->getIDocumentRedlineAccess().GetRedlineTable(); - return rRedTable.size() > 0; + return !rRedTable.empty(); } OUString SwXRedlines::getImplementationName() diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx index 605e106105f0..bb6d8f770ee1 100644 --- a/sw/source/core/view/pagepreviewlayout.cxx +++ b/sw/source/core/view/pagepreviewlayout.cxx @@ -1016,7 +1016,7 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& rRenderContext, const tools: OutputDevice* pOutputDev = &rRenderContext; // prepare paint - if ( maPreviewPages.size() > 0 ) + if ( !maPreviewPages.empty() ) { mrParentViewShell.Imp()->m_bFirstPageInvalid = false; mrParentViewShell.Imp()->m_pFirstVisiblePage = @@ -1166,7 +1166,7 @@ void SwPagePreviewLayout::Repaint( const tools::Rectangle& rInvalidCoreRect ) co // environment and parameter ok // prepare paint - if ( maPreviewPages.size() > 0 ) + if ( !maPreviewPages.empty() ) { mrParentViewShell.Imp()->m_bFirstPageInvalid = false; mrParentViewShell.Imp()->m_pFirstVisiblePage = diff --git a/sw/source/filter/ascii/wrtasc.cxx b/sw/source/filter/ascii/wrtasc.cxx index d17027aab832..b8964aaadd8b 100644 --- a/sw/source/filter/ascii/wrtasc.cxx +++ b/sw/source/filter/ascii/wrtasc.cxx @@ -126,7 +126,7 @@ ErrCode SwASCWriter::WriteStream() if( bTstFly && m_bWriteAll && pNd->GetText().isEmpty() && // Frame exists - m_pDoc->GetSpzFrameFormats()->size() && + !m_pDoc->GetSpzFrameFormats()->empty() && // Only one node in the array m_pDoc->GetNodes().GetEndOfExtras().GetIndex() + 3 == m_pDoc->GetNodes().GetEndOfContent().GetIndex() && diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 836e7db42cfa..e655dd34e569 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -3049,7 +3049,7 @@ static Writer& OutHTML_SwFormatINetFormat( Writer& rWrt, const SfxPoolItem& rHt if( rHTMLWrt.m_bTagOn ) { // if necessary, temporarily close an attribute that is still open - if( rHTMLWrt.m_aINetFormats.size() ) + if( !rHTMLWrt.m_aINetFormats.empty() ) { SwFormatINetFormat *pINetFormat = rHTMLWrt.m_aINetFormats.back(); @@ -3068,7 +3068,7 @@ static Writer& OutHTML_SwFormatINetFormat( Writer& rWrt, const SfxPoolItem& rHt OutHTML_INetFormat( rWrt, rINetFormat, false ); OSL_ENSURE( rHTMLWrt.m_aINetFormats.size(), "there must be a URL attribute missing" ); - if( rHTMLWrt.m_aINetFormats.size() ) + if( !rHTMLWrt.m_aINetFormats.empty() ) { // get its own attribute from the stack SwFormatINetFormat *pINetFormat = rHTMLWrt.m_aINetFormats.back(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 8dc33bfd8b71..a759adc24d1a 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3321,7 +3321,7 @@ void DocxAttributeOutput::EndTable() // We closed the table; if it is a nested table, the cell that contains it // still continues // set to true only if we were in a nested table, not otherwise. - if( 0 != tableFirstCells.size() ) + if( !tableFirstCells.empty() ) m_tableReference->m_bTableCellOpen = true; // Cleans the table helper diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 533f787393a6..36555f31f96e 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1905,7 +1905,7 @@ bool MSWordExportBase::GetBookmarks( const SwTextNode& rNd, sal_Int32 nStt, } } } - return ( rArr.size() > 0 ); + return ( !rArr.empty() ); } bool MSWordExportBase::GetAnnotationMarks( const SwTextNode& rNd, sal_Int32 nStt, @@ -1941,7 +1941,7 @@ bool MSWordExportBase::GetAnnotationMarks( const SwTextNode& rNd, sal_Int32 nStt } } } - return ( rArr.size() > 0 ); + return ( !rArr.empty() ); } class CompareMarksEnd diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index c92a5f9b1957..a2d8856733fb 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -2224,7 +2224,7 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, rFib.m_lcbGrpStAtnOwners = nFcStart - rFib.m_fcGrpStAtnOwners; // Commented text ranges - if( aRangeStartPos.size() > 0 ) + if( !aRangeStartPos.empty() ) { // Commented text ranges starting positions (Plcfbkf.aCP) rFib.m_fcPlcfAtnbkf = nFcStart; diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index db8f3cac3c08..54bf8e6aeaa7 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -3928,7 +3928,7 @@ bool SwWW8ImplReader::IsParaEndInCPs(sal_Int32 nStart, sal_Int32 nEnd,bool bSdOD //Clear the para end position recorded in reader intermittently for the least impact on loading performance void SwWW8ImplReader::ClearParaEndPosition() { - if ( m_aEndParaPos.size() > 0 ) + if ( !m_aEndParaPos.empty() ) m_aEndParaPos.clear(); } diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 87e3ee83c78c..58257f01830c 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -4445,7 +4445,7 @@ void WW8RStyle::ImportOldFormatStyles() ImportSprms(aPAPXOffsets[stcp].mnOffset, aPAPXOffsets[stcp].mnSize, true); - if (aConvertedChpx[stcp].size() > 0) + if (!aConvertedChpx[stcp].empty()) ImportSprms(&(aConvertedChpx[stcp][0]), static_cast< short >(aConvertedChpx[stcp].size()), false); diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index 736c9adc0321..ad8452df3e5d 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -135,7 +135,7 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData) { m_pData = &rDBData; //when the address data is updated then remove the controls an build again - if(m_aFixedTexts.size()) + if(!m_aFixedTexts.empty()) { for(auto aTextIter = m_aFixedTexts.begin(); aTextIter != m_aFixedTexts.end(); ++aTextIter) aTextIter->disposeAndClear(); @@ -233,7 +233,7 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData) } // Even if no items in m_aEdits, the scrollbar will still exist; // we might as well disable it. - if (m_aEdits.size() < 1) { + if (m_aEdits.empty()) { m_pScrollBar->DoScroll(0); m_pScrollBar->SetThumbPos(0); m_pScrollBar->Enable(false); @@ -377,7 +377,7 @@ void SwAddressControl_Impl::Resize() m_pWindow->SetSizePixel(Size(aSize.Width() - nScrollBarWidth, m_pWindow->GetOutputSizePixel().Height())); m_pScrollBar->SetPosPixel(Point(aSize.Width() - nScrollBarWidth, 0)); - if(m_aEdits.size()) + if(!m_aEdits.empty()) { long nNewEditSize = aSize.Width() - (*m_aEdits.begin())->GetPosPixel().X() - nScrollBarWidth - 6; diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx index ae0171148c8a..86f0a1a1dac1 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.cxx +++ b/sw/source/ui/dbui/mmoutputtypepage.cxx @@ -552,7 +552,7 @@ void SwSendMailDialog::UpdateTransferStatus() sStatus = m_sErrorStatus.replaceFirst("%1", OUString::number(m_nErrorCount) ); m_pErrorStatus->SetText(sStatus); - if (m_pImpl->aDescriptors.size()) + if (!m_pImpl->aDescriptors.empty()) { assert(m_nExpectedCount && "div-by-zero"); m_pProgressBar->SetValue(static_cast<sal_uInt16>(m_nSendCount * 100 / m_nExpectedCount)); diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index 1ccc19651629..b6ec409f14e1 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -1141,7 +1141,7 @@ void SwDocShell::GetState(SfxItemSet& rSet) case FN_REDLINE_ACCEPT_ALL: case FN_REDLINE_REJECT_ALL: { - if (GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().size() == 0) + if (GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().empty()) rSet.DisableItem(nWhich); } break; diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 71e0c8b7ae77..31548a502b15 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -3315,7 +3315,7 @@ std::shared_ptr<SwMailMergeConfigItem> SwDBManager::PerformMailMerge(SwView cons void SwDBManager::RevokeLastRegistrations() { - if (m_aUncommitedRegistrations.size()) + if (!m_aUncommitedRegistrations.empty()) { SwView* pView = ( m_pDoc && m_pDoc->GetDocShell() ) ? m_pDoc->GetDocShell()->GetView() : nullptr; if (pView) diff --git a/sw/source/uibase/dbui/maildispatcher.cxx b/sw/source/uibase/dbui/maildispatcher.cxx index 5b1a1d80708d..bdb4a91b9cdf 100644 --- a/sw/source/uibase/dbui/maildispatcher.cxx +++ b/sw/source/uibase/dbui/maildispatcher.cxx @@ -252,7 +252,7 @@ void MailDispatcher::run() ::osl::ClearableMutexGuard message_container_guard( m_aMessageContainerMutex ); - if ( m_aXMessageList.size() ) + if ( !m_aXMessageList.empty() ) { thread_status_guard.clear(); uno::Reference<mail::XMailMessage> message = m_aXMessageList.front(); diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 1d778cc4910c..ffa1ffe4f069 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -690,7 +690,7 @@ void SwPostItMgr::LayoutPostIts() for (std::unique_ptr<SwPostItPageItem>& pPage : mPages) { // only layout if there are notes on this page - if (pPage->mvSidebarItems.size()>0) + if (!pPage->mvSidebarItems.empty()) { std::vector<SwAnnotationWin*> aVisiblePostItList; unsigned long lNeededHeight = 0; diff --git a/sw/source/uibase/misc/glosdoc.cxx b/sw/source/uibase/misc/glosdoc.cxx index 30365661e9be..c0286c30dfe8 100644 --- a/sw/source/uibase/misc/glosdoc.cxx +++ b/sw/source/uibase/misc/glosdoc.cxx @@ -373,7 +373,7 @@ void SwGlossaries::UpdateGlosPath(bool bFull) INetURLObject(), m_aPath.getToken(0, SVT_SEARCHPATH_DELIMITER, nIndex), URIHelper::GetMaybeFileHdl()); - if (aDirArr.size() && + if (!aDirArr.empty() && std::find(aDirArr.begin(), aDirArr.end(), sPth) != aDirArr.end()) { continue; diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index d996777be209..d6ba87cc6598 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -71,7 +71,7 @@ static void lcl_FillSvxColumn(const SwFormatCol& rCol, { const SwColumns& rCols = rCol.GetColumns(); - bool bOrtho = rCol.IsOrtho() && rCols.size(); + bool bOrtho = rCol.IsOrtho() && !rCols.empty(); long nInnerWidth = 0; if( bOrtho ) { diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index 1348a5fde2bf..f1c9b72afcaa 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -294,7 +294,7 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) // sdrObjects handled below } bool bRet(false); - if (sdrObjects.size()) + if (!sdrObjects.empty()) { SdrView *const pDrawView = rSh.GetDrawView(); diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx index cf205d099044..c20968fd0a88 100644 --- a/test/source/screenshot_test.cxx +++ b/test/source/screenshot_test.cxx @@ -133,7 +133,7 @@ void ScreenshotTest::dumpDialogToPath(VclAbstractDialog& rDialog) { const std::vector<OString> aPageDescriptions(rDialog.getAllPageUIXMLDescriptions()); - if (aPageDescriptions.size()) + if (!aPageDescriptions.empty()) { for (size_t a(0); a < aPageDescriptions.size(); a++) { @@ -157,7 +157,7 @@ void ScreenshotTest::dumpDialogToPath(Dialog& rDialog) { const std::vector<OString> aPageDescriptions(rDialog.getAllPageUIXMLDescriptions()); - if (aPageDescriptions.size()) + if (!aPageDescriptions.empty()) { for (size_t a(0); a < aPageDescriptions.size(); a++) { diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx index 3c6036115e06..38e4afe3345a 100644 --- a/ucb/source/ucp/ftp/ftpurl.cxx +++ b/ucb/source/ucp/ftp/ftpurl.cxx @@ -226,7 +226,7 @@ void FTPURL::parse(const OUString& url) ""/*aAccount*/); // now check for something like ";type=i" at end of url - if(m_aPathSegmentVec.size() && + if(!m_aPathSegmentVec.empty() && (l = m_aPathSegmentVec.back().indexOf(';')) != -1) { m_aType = m_aPathSegmentVec.back().copy(l); m_aPathSegmentVec.back() = m_aPathSegmentVec.back().copy(0,l); @@ -344,7 +344,7 @@ void FTPURL::child(const OUString& title) OUString FTPURL::child() const { return - m_aPathSegmentVec.size() ? + !m_aPathSegmentVec.empty() ? decodePathSegment(m_aPathSegmentVec.back()) : OUString(); } @@ -742,7 +742,7 @@ OUString FTPURL::ren(const OUString& NewTitle) curl_slist_free_all(slist); if(err != CURLE_OK) throw curl_exception(err); - else if( m_aPathSegmentVec.size() && m_aPathSegmentVec.back() != ".." ) + else if( !m_aPathSegmentVec.empty() && m_aPathSegmentVec.back() != ".." ) m_aPathSegmentVec.back() = encodePathSegment(NewTitle); return OldTitle; } diff --git a/unotools/source/config/dynamicmenuoptions.cxx b/unotools/source/config/dynamicmenuoptions.cxx index 6c451d387dcb..71a5e8713686 100644 --- a/unotools/source/config/dynamicmenuoptions.cxx +++ b/unotools/source/config/dynamicmenuoptions.cxx @@ -83,7 +83,7 @@ class SvtDynMenu void AppendSetupEntry( const SvtDynMenuEntry& rEntry ) { if( - ( lSetupEntries.size() < 1 ) || + ( lSetupEntries.empty() ) || ( lSetupEntries.rbegin()->sURL != rEntry.sURL ) ) { diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx index be391cb82a5a..35af2a1bddfb 100644 --- a/unotools/source/misc/fontdefs.cxx +++ b/unotools/source/misc/fontdefs.cxx @@ -535,15 +535,15 @@ OUString GetSubsFontName( const OUString& rName, SubsFontFlags nFlags ) switch( i ) { case 0: - if( nFlags & SubsFontFlags::MS && pAttr->MSSubstitutions.size() ) + if( nFlags & SubsFontFlags::MS && !pAttr->MSSubstitutions.empty() ) pVector = &pAttr->MSSubstitutions; break; case 1: - if( nFlags & SubsFontFlags::PS && pAttr->PSSubstitutions.size() ) + if( nFlags & SubsFontFlags::PS && !pAttr->PSSubstitutions.empty() ) pVector = &pAttr->PSSubstitutions; break; case 2: - if( nFlags & SubsFontFlags::HTML && pAttr->HTMLSubstitutions.size() ) + if( nFlags & SubsFontFlags::HTML && !pAttr->HTMLSubstitutions.empty() ) pVector = &pAttr->HTMLSubstitutions; break; } diff --git a/uui/source/iahndl-filter.cxx b/uui/source/iahndl-filter.cxx index 9a8ef64c247c..829d761b0d06 100644 --- a/uui/source/iahndl-filter.cxx +++ b/uui/source/iahndl-filter.cxx @@ -151,7 +151,7 @@ handleNoSuchFilterRequest_( // no list available for showing // -> abort operation - if (lNames.size()<1) + if (lNames.empty()) { xAbort->select(); return; diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 7b8ee8b8afe0..2ec7bb5496a3 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -245,7 +245,7 @@ UUIInteractionHelper::replaceMessageWithArguments( { OUString aMessage = _aMessage; - SAL_WARN_IF(rArguments.size() == 0, "uui", "replaceMessageWithArguments: No arguments passed!"); + SAL_WARN_IF(rArguments.empty(), "uui", "replaceMessageWithArguments: No arguments passed!"); for (size_t i = 0; i < rArguments.size(); ++i) { const OUString sReplaceTemplate = "$(ARG" + OUString::number(i+1) + ")"; diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 082c8d66b7b0..6c9f9de494d2 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -899,7 +899,7 @@ void OpenGLSalGraphicsImpl::DrawPolyPolygon( const basegfx::B2DPolyPolygon& rPol basegfx::B2DTrapezoidVector aB2DTrapVector; basegfx::utils::trapezoidSubdivide( aB2DTrapVector, aSimplePolyPolygon ); // draw tessellation result - if( aB2DTrapVector.size()) + if( !aB2DTrapVector.empty()) { for(basegfx::B2DTrapezoid & i : aB2DTrapVector) DrawTrapezoid( i, blockAA ); diff --git a/vcl/source/bitmap/bitmappaint.cxx b/vcl/source/bitmap/bitmappaint.cxx index 0bbd32559bfe..7f754997d694 100644 --- a/vcl/source/bitmap/bitmappaint.cxx +++ b/vcl/source/bitmap/bitmappaint.cxx @@ -681,7 +681,7 @@ vcl::Region Bitmap::CreateRegion(const Color& rColor, const tools::Rectangle& rR if (aNewLine != aLine) { // need to write aLine, it's different from the next line - if (aLine.size()) + if (!aLine.empty()) { tools::Rectangle aSubRect; @@ -704,7 +704,7 @@ vcl::Region Bitmap::CreateRegion(const Color& rColor, const tools::Rectangle& rR } // write last line if used - if (aLine.size()) + if (!aLine.empty()) { tools::Rectangle aSubRect; diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index 9b2381e2cc95..5c8fed1fee15 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -147,7 +147,7 @@ void NotebookBar::SetSystemWindow(SystemWindow* pSystemWindow) void SAL_CALL NotebookBarContextChangeEventListener::notifyContextChangeEvent(const css::ui::ContextChangeEventObject& rEvent) { - if (mpParent && mpParent->m_pContextContainers.size() > 0) + if (mpParent && !mpParent->m_pContextContainers.empty()) { for (NotebookbarContextControl* pControl : mpParent->m_pContextContainers) pControl->SetContext(vcl::EnumContext::GetContextEnum(rEvent.ContextName)); diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index c8eba348db53..e0b38b2549d8 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -2018,7 +2018,7 @@ tools::Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, long nIndex { tools::Rectangle aRet; - if( !HasLayoutData() || ! mpTabCtrlData->maLayoutPageIdToLine.size() ) + if( !HasLayoutData() || mpTabCtrlData->maLayoutPageIdToLine.empty() ) FillLayoutData(); if( HasLayoutData() ) @@ -2039,7 +2039,7 @@ long TabControl::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPageId ) co { long nRet = -1; - if( !HasLayoutData() || ! mpTabCtrlData->maLayoutPageIdToLine.size() ) + if( !HasLayoutData() || mpTabCtrlData->maLayoutPageIdToLine.empty() ) FillLayoutData(); if( HasLayoutData() ) diff --git a/vcl/source/control/throbber.cxx b/vcl/source/control/throbber.cxx index 48f1f47733e6..5b4dc1b570d5 100644 --- a/vcl/source/control/throbber.cxx +++ b/vcl/source/control/throbber.cxx @@ -170,7 +170,7 @@ void Throbber::setImageList( ::std::vector< Image > const& i_images ) maImageList = i_images; - const Image aInitialImage( maImageList.size() ? maImageList[ 0 ] : Image() ); + const Image aInitialImage( !maImageList.empty() ? maImageList[ 0 ] : Image() ); SetImage( aInitialImage ); } diff --git a/vcl/source/edit/textdata.cxx b/vcl/source/edit/textdata.cxx index 493cb434e5de..63fdab60ffef 100644 --- a/vcl/source/edit/textdata.cxx +++ b/vcl/source/edit/textdata.cxx @@ -117,7 +117,7 @@ void TETextPortionList::Reset() void TETextPortionList::DeleteFromPortion( std::size_t nDelFrom ) { - SAL_WARN_IF( ( nDelFrom >= maPortions.size() ) && ( (nDelFrom != 0) || (maPortions.size() != 0) ), "vcl", "DeleteFromPortion: Out of range" ); + SAL_WARN_IF( ( nDelFrom >= maPortions.size() ) && ( (nDelFrom != 0) || (!maPortions.empty()) ), "vcl", "DeleteFromPortion: Out of range" ); maPortions.erase( maPortions.begin() + nDelFrom, maPortions.end() ); } diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index b15446522b35..08e1ba46212e 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -2353,7 +2353,7 @@ bool TextEngine::CreateLines( sal_uInt32 nPara ) pTEParaPortion->GetLines().end() ); } - SAL_WARN_IF( !pTEParaPortion->GetLines().size(), "vcl", "CreateLines: No Line!" ); + SAL_WARN_IF( pTEParaPortion->GetLines().empty(), "vcl", "CreateLines: No Line!" ); pTEParaPortion->SetValid(); diff --git a/vcl/source/gdi/gdimetafiletools.cxx b/vcl/source/gdi/gdimetafiletools.cxx index 1f9f610f14ef..dc7236bce9b0 100644 --- a/vcl/source/gdi/gdimetafiletools.cxx +++ b/vcl/source/gdi/gdimetafiletools.cxx @@ -315,7 +315,7 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource) const MetaISectRectClipRegionAction* pA = static_cast< const MetaISectRectClipRegionAction* >(pAction); const tools::Rectangle& rRect = pA->GetRect(); - if(!rRect.IsEmpty() && aClips.size() && aClips.back().count()) + if(!rRect.IsEmpty() && !aClips.empty() && aClips.back().count()) { const basegfx::B2DRange aClipRange( rRect.Left(), rRect.Top(), @@ -335,7 +335,7 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource) const MetaISectRegionClipRegionAction* pA = static_cast< const MetaISectRegionClipRegionAction* >(pAction); const vcl::Region& rRegion = pA->GetRegion(); - if(!rRegion.IsEmpty() && aClips.size() && aClips.back().count()) + if(!rRegion.IsEmpty() && !aClips.empty() && aClips.back().count()) { const basegfx::B2DPolyPolygon aNewClip(rRegion.GetAsB2DPolyPolygon()); @@ -354,7 +354,7 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource) const long aHorMove(pA->GetHorzMove()); const long aVerMove(pA->GetVertMove()); - if((aHorMove || aVerMove) && aClips.size() && aClips.back().count()) + if((aHorMove || aVerMove) && !aClips.empty() && aClips.back().count()) { aClips.back().transform( basegfx::utils::createTranslateB2DHomMatrix( @@ -386,7 +386,7 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource) case MetaActionType::POP : { - if(aPushFlags.size()) + if(!aPushFlags.empty()) { const PushFlags nFlags(aPushFlags.back()); aPushFlags.pop_back(); @@ -441,7 +441,7 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource) // this tooling is only a fallback (see comments in header), only the needed // actions will be implemented. Extend using the pattern for the already // implemented actions. - if(aClips.size() && aClips.back().count()) + if(!aClips.empty() && aClips.back().count()) { switch(nType) { diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx index 4b0c9cdc5725..9655126ed411 100644 --- a/vcl/source/gdi/pdfextoutdevdata.cxx +++ b/vcl/source/gdi/pdfextoutdevdata.cxx @@ -322,7 +322,7 @@ void PageSyncData::PushAction( const OutputDevice& rOutDev, const PDFExtOutDevDa bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction, const GDIMetaFile& rMtf, const PDFExtOutDevData& rOutDevData ) { bool bRet = false; - if ( mActions.size() && ( mActions.front().nIdx == rCurGDIMtfAction ) ) + if ( !mActions.empty() && ( mActions.front().nIdx == rCurGDIMtfAction ) ) { bRet = true; PDFExtOutDevDataSync aDataSync = mActions.front(); diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index d3496adc4f1e..48475a52fba8 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1234,7 +1234,7 @@ bool PDFWriterImpl::PDFPage::emit(sal_Int32 nParentObject ) } aLine.append( "]\n" ); } - if( m_aMCIDParents.size() > 0 ) + if( !m_aMCIDParents.empty() ) { OStringBuffer aStructParents( 1024 ); aStructParents.append( "[ " ); @@ -4672,7 +4672,7 @@ bool PDFWriterImpl::emitWidgetAnnotations() } aValue.append( "]" ); } - else if( rWidget.m_aSelectedEntries.size() > 0 && + else if( !rWidget.m_aSelectedEntries.empty() && rWidget.m_aSelectedEntries[0] >= 0 && rWidget.m_aSelectedEntries[0] < sal_Int32(rWidget.m_aListEntries.size()) ) { @@ -4708,7 +4708,7 @@ bool PDFWriterImpl::emitWidgetAnnotations() aLine.append( rWidget.m_nParent ); aLine.append( " 0 R\n" ); } - if( rWidget.m_aKids.size() ) + if( !rWidget.m_aKids.empty() ) { aLine.append( "/Kids[" ); for( size_t i = 0; i < rWidget.m_aKids.size(); i++ ) @@ -4886,7 +4886,7 @@ bool PDFWriterImpl::emitWidgetAnnotations() bool PDFWriterImpl::emitAnnotations() { - if( m_aPages.size() < 1 ) + if( m_aPages.empty() ) return false; CHECK_RETURN( emitLinkAnnotations() ); @@ -5191,7 +5191,7 @@ bool PDFWriterImpl::emitCatalog() { aLine.append( "/MarkInfo<</Marked true>>\n" ); } - if( m_aWidgets.size() > 0 ) + if( !m_aWidgets.empty() ) { aLine.append( "/AcroForm<</Fields[\n" ); int nWidgets = m_aWidgets.size(); @@ -5899,7 +5899,7 @@ bool PDFWriterImpl::emitTrailer() aLine.append( aDocChecksum.makeStringAndClear() ); aLine.append( "\n" ); } - if( m_aAdditionalStreams.size() > 0 ) + if( !m_aAdditionalStreams.empty() ) { aLine.append( "/AdditionalStreams [" ); for(const PDFAddStream & rAdditionalStream : m_aAdditionalStreams) @@ -8398,7 +8398,7 @@ void PDFWriterImpl::drawPolyLine( const tools::Polygon& rPoly, const PDFWriter:: case PDFWriter::joinRound: aLine.append( " 1 j" );break; case PDFWriter::joinBevel: aLine.append( " 2 j" );break; } - if( rInfo.m_aDashArray.size() > 0 ) + if( !rInfo.m_aDashArray.empty() ) { aLine.append( " [ " ); for (auto const& dash : rInfo.m_aDashArray) diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 7636569fd8fb..1cd4f81993c5 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -591,7 +591,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa bSkipSequence = true; if ( aStartArrow.Count() || aEndArrow.Count() ) bSkipSequence = false; - if ( aDashArray.size() && ( fStrokeWidth != 0.0 ) && ( fTransparency == 0.0 ) ) + if ( !aDashArray.empty() && ( fStrokeWidth != 0.0 ) && ( fTransparency == 0.0 ) ) bSkipSequence = false; if ( bSkipSequence ) { diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 8d876acaa38f..36edd1bbcdde 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -791,7 +791,7 @@ SalPrinterQueueInfo* Printer::ImplGetQueueInfo( const OUString& rPrinterName, ImplInitPrnQueueList(); ImplPrnQueueList* pPrnList = pSVData->maGDIData.mpPrinterQueueList; - if ( pPrnList && pPrnList->m_aQueueInfos.size() ) + if ( pPrnList && !pPrnList->m_aQueueInfos.empty() ) { // first search for the printer name directly ImplPrnQueueData* pInfo = pPrnList->Get( rPrinterName ); diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index cc4e9d18f8a4..360d96e2db82 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -2464,7 +2464,7 @@ void VclBuilder::handleTabChild(vcl::Window *pParent, xmlreader::XmlReader &read sal_uInt16 nPageId = pTabControl->GetCurPageId(); pTabControl->SetPageText(nPageId, aFind->second); pTabControl->SetPageName(nPageId, sID); - if (context.size() != 0) + if (!context.empty()) { TabPage* pPage = pTabControl->GetTabPage(nPageId); pPage->SetContext(context); @@ -3406,7 +3406,7 @@ VclPtr<vcl::Window> VclBuilder::handleObject(vcl::Window *pParent, xmlreader::Xm if (pPrioritable) pPrioritable->SetPriority(nPriority); } - if (aContext.size() != 0) + if (!aContext.empty()) { vcl::IContext* pContextControl = dynamic_cast<vcl::IContext*>(pCurrentChild.get()); SAL_WARN_IF(!pContextControl, "vcl", "context set for not supported item"); diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx index 860f8fc0def8..8141da534a57 100644 --- a/vcl/unx/generic/app/saldata.cxx +++ b/vcl/unx/generic/app/saldata.cxx @@ -314,7 +314,7 @@ void X11SalData::PushXErrorLevel( bool bIgnore ) void X11SalData::PopXErrorLevel() { - if( m_aXErrorHandlerStack.size() ) + if( !m_aXErrorHandlerStack.empty() ) { XSetErrorHandler( m_aXErrorHandlerStack.back().m_aHandler ); m_aXErrorHandlerStack.pop_back(); diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index 30272c739029..9c1007cdcd09 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -476,7 +476,7 @@ void PrinterInfoManager::initialize() } // set default printer - if( m_aPrinters.size() ) + if( !m_aPrinters.empty() ) { if( m_aPrinters.find( aDefaultPrinter ) == m_aPrinters.end() ) aDefaultPrinter = m_aPrinters.begin()->first; diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 9c83df9ce3b2..39743415594d 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -2246,7 +2246,7 @@ public: xWidgets = VclPtr< DemoWidgets >::Create (); else if (bPopup) xPopup = VclPtrInstance< DemoPopup> (); - else if (aFontNames.size() > 0) + else if (!aFontNames.empty()) renderFonts(aFontNames); else aMainWin->Show(); diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 962f7130e6f9..a8d90962c4cc 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -579,7 +579,7 @@ void DomainMapperTableManager::endOfRowAction() IntVectorPtr pTableGrid = getCurrentGrid( ); IntVectorPtr pCellWidths = getCurrentCellWidths( ); - if(!m_nTableWidth && pTableGrid->size()) + if(!m_nTableWidth && !pTableGrid->empty()) { #ifdef DEBUG_WRITERFILTER TagLogger::getInstance().startElement("tableWidth"); @@ -697,7 +697,7 @@ void DomainMapperTableManager::endOfRowAction() #endif insertRowProps(pPropMap); } - else if ( pCellWidths->size() > 0 && + else if ( !pCellWidths->empty() && ( m_nLayoutType == NS_ooxml::LN_Value_doc_ST_TblLayout_fixed || pCellWidths->size() == ( m_nGridBefore + nGrids + m_nGridAfter ) ) ) diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index ced0cda06778..de36dbcf9755 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -2419,7 +2419,7 @@ void DomainMapper_Impl::PopShapeContext() getTableManager().endLevel(); popTableManager(); } - if ( m_aAnchoredStack.size() > 0 ) + if ( !m_aAnchoredStack.empty() ) { // For OLE object replacement shape, the text append context was already removed // or the OLE object couldn't be inserted. @@ -4922,7 +4922,7 @@ void DomainMapper_Impl::SetFieldFFData(const FFDataHandler::Pointer_t& pFFDataHa TagLogger::getInstance().startElement("setFieldFFData"); #endif - if (m_aFieldStack.size()) + if (!m_aFieldStack.empty()) { FieldContextPtr pContext = m_aFieldStack.top(); if (pContext.get()) diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 35ae974dd7b8..41ad7869b1fd 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -1576,7 +1576,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) if ( m_nColumnCount > 0 ) { // skip custom-width columns since we don't know what column the shape is in. - if ( m_aColWidth.size() ) + if ( !m_aColWidth.empty() ) nParagraphWidth = 0; else nParagraphWidth = (nParagraphWidth - (m_nColumnDistance * m_nColumnCount)) / (m_nColumnCount + 1); diff --git a/writerfilter/source/dmapper/TDefTableHandler.cxx b/writerfilter/source/dmapper/TDefTableHandler.cxx index 0658a9f8c128..68f8494f586f 100644 --- a/writerfilter/source/dmapper/TDefTableHandler.cxx +++ b/writerfilter/source/dmapper/TDefTableHandler.cxx @@ -415,17 +415,17 @@ void TDefTableHandler::lcl_sprm(Sprm & rSprm) void TDefTableHandler::fillCellProperties( const ::tools::SvRef< TablePropertyMap >& pCellProperties ) const { - if( m_aTopBorderLines.size() ) + if( !m_aTopBorderLines.empty() ) pCellProperties->Insert( PROP_TOP_BORDER, uno::makeAny( m_aTopBorderLines[0] ) ); - if( m_aLeftBorderLines.size() ) + if( !m_aLeftBorderLines.empty() ) pCellProperties->Insert( PROP_LEFT_BORDER, uno::makeAny( m_aLeftBorderLines[0] ) ); - if( m_aBottomBorderLines.size() ) + if( !m_aBottomBorderLines.empty() ) pCellProperties->Insert( PROP_BOTTOM_BORDER, uno::makeAny( m_aBottomBorderLines[0] ) ); - if( m_aRightBorderLines.size() ) + if( !m_aRightBorderLines.empty() ) pCellProperties->Insert( PROP_RIGHT_BORDER, uno::makeAny( m_aRightBorderLines[0] ) ); - if( m_aInsideHBorderLines.size() ) + if( !m_aInsideHBorderLines.empty() ) pCellProperties->Insert( META_PROP_HORIZONTAL_BORDER, uno::makeAny( m_aInsideHBorderLines[0] ) ); - if( m_aInsideVBorderLines.size() ) + if( !m_aInsideVBorderLines.empty() ) pCellProperties->Insert( META_PROP_VERTICAL_BORDER, uno::makeAny( m_aInsideVBorderLines[0] ) ); } diff --git a/xmloff/source/core/xmlictxt.cxx b/xmloff/source/core/xmlictxt.cxx index 18e1446e190a..8b25589f8181 100644 --- a/xmloff/source/core/xmlictxt.cxx +++ b/xmloff/source/core/xmlictxt.cxx @@ -131,7 +131,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SvXMLImportContext::cre (sal_Int32 Element, const uno::Reference< xml::sax::XFastAttributeList > & Attribs) { // Call CreateFastContext only if it's the first element of the document - if ( !mrImport.maFastContexts.size() ) + if ( mrImport.maFastContexts.empty() ) return mrImport.CreateFastContext( Element, Attribs ); else return new SvXMLImportContext( GetImport() ); diff --git a/xmloff/source/script/XMLEventImportHelper.cxx b/xmloff/source/script/XMLEventImportHelper.cxx index 6626598f5688..26048e86bacf 100644 --- a/xmloff/source/script/XMLEventImportHelper.cxx +++ b/xmloff/source/script/XMLEventImportHelper.cxx @@ -87,7 +87,7 @@ void XMLEventImportHelper::PushTranslationTable() void XMLEventImportHelper::PopTranslationTable() { - DBG_ASSERT(aEventNameMapVector.size() > 0, + DBG_ASSERT(!aEventNameMapVector.empty(), "no translation tables left to pop"); if ( !aEventNameMapVector.empty() ) { diff --git a/xmloff/source/style/PageMasterImportContext.cxx b/xmloff/source/style/PageMasterImportContext.cxx index aa81fd62e8c6..3ccac9f8bc47 100644 --- a/xmloff/source/style/PageMasterImportContext.cxx +++ b/xmloff/source/style/PageMasterImportContext.cxx @@ -161,7 +161,7 @@ void PageStyleContext::FillPropertySet(const uno::Reference<beans::XPropertySet { // need to filter out old fill definitions when the new ones are used. The new // ones are used when a FillStyle is defined - if(!m_bIsFillStyleAlreadyConverted && GetProperties().size()) + if(!m_bIsFillStyleAlreadyConverted && !GetProperties().empty()) { static ::rtl::OUString s_FillStyle("FillStyle"); static ::rtl::OUString s_HeaderFillStyle("HeaderFillStyle"); diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index 5637e3cc959d..e9497349546a 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -533,7 +533,7 @@ void XMLPropStyleContext::Finish( bool bOverwrite ) bool XMLPropStyleContext::doNewDrawingLayerFillStyleDefinitionsExist( const OUString& rFillStyleTag) const { - if(maProperties.size() && rFillStyleTag.getLength()) + if(!maProperties.empty() && rFillStyleTag.getLength()) { const rtl::Reference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper(); @@ -578,7 +578,7 @@ bool XMLPropStyleContext::doNewDrawingLayerFillStyleDefinitionsExist( void XMLPropStyleContext::deactivateOldFillStyleDefinitions( const OldFillStyleDefinitionSet& rHashSetOfTags) { - if(!rHashSetOfTags.empty() && maProperties.size()) + if(!rHashSetOfTags.empty() && !maProperties.empty()) { const rtl::Reference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper(); @@ -603,7 +603,7 @@ void XMLPropStyleContext::deactivateOldFillStyleDefinitions( void XMLPropStyleContext::translateNameBasedDrawingLayerFillStyleDefinitionsToStyleDisplayNames() { - if(maProperties.size()) + if(!maProperties.empty()) { const rtl::Reference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper(); diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx index fa494e86396a..b30fc9ba0070 100644 --- a/xmloff/source/text/XMLRedlineExport.cxx +++ b/xmloff/source/text/XMLRedlineExport.cxx @@ -126,7 +126,7 @@ void XMLRedlineExport::ExportChangesList( ChangesVectorType* pChangesList = aFind->second.get(); // export only if changes are found - if (pChangesList->size() > 0) + if (!pChangesList->empty()) { // changes container element SvXMLElementExport aChanges(rExport, XML_NAMESPACE_TEXT, diff --git a/xmloff/source/text/txtlists.cxx b/xmloff/source/text/txtlists.cxx index bd6593717df4..1ac73d43af68 100644 --- a/xmloff/source/text/txtlists.cxx +++ b/xmloff/source/text/txtlists.cxx @@ -292,7 +292,7 @@ void XMLTextListsHelper::PushListOnStack( const OUString& sListId, void XMLTextListsHelper::PopListFromStack() { if ( mpListStack && - mpListStack->size() > 0 ) + !mpListStack->empty() ) { mpListStack->pop_back(); } diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 894fa542fd7a..6a5a5936c833 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -364,7 +364,7 @@ short DigitalSignaturesDialog::Execute() // consequences, as I noticed when I tried to use DocumentSignatureManager::IsXAdESRelevant() // (which now is in #if 0). - if (maSignatureManager.maCurrentSignatureInformations.size() > 0) + if (!maSignatureManager.maCurrentSignatureInformations.empty()) { // If the document has only SHA-1 signatures we probably want it to stay that way? } |