summaryrefslogtreecommitdiff
path: root/xmloff/source/table
diff options
context:
space:
mode:
Diffstat (limited to 'xmloff/source/table')
-rw-r--r--xmloff/source/table/XMLTableExport.cxx24
-rw-r--r--xmloff/source/table/XMLTableImport.cxx23
2 files changed, 17 insertions, 30 deletions
diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx
index 3a4f8a5752bf..8018f2b1bc3d 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -130,14 +130,12 @@ void StringStatisticHelper::add( const OUString& rStyleName )
sal_Int32 StringStatisticHelper::getModeString( OUString& rStyleName )
{
sal_Int32 nMax = 0;
- const std::map< OUString, sal_Int32 >::const_iterator aEnd( mStats.end() );
- for( std::map< OUString, sal_Int32 >::iterator iter( mStats.begin() );
- iter != aEnd; ++iter)
+ for( const auto& rStatsEntry : mStats )
{
- if( (*iter).second > nMax )
+ if( rStatsEntry.second > nMax )
{
- rStyleName = (*iter).first;
- nMax = (*iter).second;
+ rStyleName = rStatsEntry.first;
+ nMax = rStatsEntry.second;
}
}
@@ -206,18 +204,8 @@ XMLTableExport::~XMLTableExport ()
static bool has_states( const std::vector< XMLPropertyState >& xPropStates )
{
- if( !xPropStates.empty() )
- {
- std::vector< XMLPropertyState >::const_iterator aIter( xPropStates.begin() );
- std::vector< XMLPropertyState >::const_iterator aEnd( xPropStates.end() );
- while( aIter != aEnd )
- {
- if( aIter->mnIndex != -1 )
- return true;
- ++aIter;
- }
- }
- return false;
+ return std::any_of(xPropStates.cbegin(), xPropStates.cend(),
+ [](const XMLPropertyState& rPropertyState) { return rPropertyState.mnIndex != -1; });
}
void XMLTableExport::collectTableAutoStyles(const Reference < XColumnRowRange >& xColumnRowRange)
diff --git a/xmloff/source/table/XMLTableImport.cxx b/xmloff/source/table/XMLTableImport.cxx
index b3c20b5bc7b3..9b2c646c3a09 100644
--- a/xmloff/source/table/XMLTableImport.cxx
+++ b/xmloff/source/table/XMLTableImport.cxx
@@ -270,10 +270,10 @@ void XMLTableImport::insertTabletemplate(const OUString& rsStyleName, bool bOver
std::shared_ptr<XMLTableTemplate> xT(it->second);
- for (auto aStyleIter=xT->begin(); aStyleIter != xT->end(); ++aStyleIter) try
+ for (const auto& rStyle : *xT) try
{
- const OUString sPropName((*aStyleIter).first);
- const OUString sStyleName((*aStyleIter).second);
+ const OUString sPropName(rStyle.first);
+ const OUString sStyleName(rStyle.second);
// Internally unassigned cell styles are stored by display name.
// However table-template elements reference cell styles by its encoded name.
// This loop is looking for cell style by their encoded names.
@@ -323,17 +323,17 @@ void XMLTableImport::finishStyles()
Reference< XSingleServiceFactory > xFactory( xTableFamily, UNO_QUERY_THROW );
- for( XMLTableTemplateMap::iterator aTemplateIter( maTableTemplates.begin() ); aTemplateIter != maTableTemplates.end(); ++aTemplateIter ) try
+ for( const auto& rTemplate : maTableTemplates ) try
{
- const OUString sTemplateName( (*aTemplateIter).first );
+ const OUString sTemplateName( rTemplate.first );
Reference< XNameReplace > xTemplate( xFactory->createInstance(), UNO_QUERY_THROW );
- std::shared_ptr< XMLTableTemplate > xT( (*aTemplateIter).second );
+ std::shared_ptr< XMLTableTemplate > xT( rTemplate.second );
- for( XMLTableTemplate::iterator aStyleIter( xT->begin() ); aStyleIter != xT->end(); ++aStyleIter ) try
+ for( const auto& rStyle : *xT ) try
{
- const OUString sPropName( (*aStyleIter).first );
- const OUString sStyleName( (*aStyleIter).second );
+ const OUString sPropName( rStyle.first );
+ const OUString sStyleName( rStyle.second );
xTemplate->replaceByName( sPropName, xCellFamily->getByName( sStyleName ) );
}
catch( Exception& )
@@ -596,10 +596,9 @@ void XMLTableImportContext::EndElement()
{
if( !maMergeInfos.empty() )
{
- MergeInfoVector::iterator aIter( maMergeInfos.begin() );
- while( aIter != maMergeInfos.end() )
+ for( const auto& rMergeInfo : maMergeInfos )
{
- std::shared_ptr< MergeInfo > xInfo( (*aIter++) );
+ std::shared_ptr< MergeInfo > xInfo( rMergeInfo );
if( xInfo.get() ) try
{