summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-26 15:43:28 +0200
committerNoel Grandin <noel@peralex.com>2016-04-27 15:03:40 +0200
commit5e4fc9540993ee5e10f1986918acdd868a1fcf1b (patch)
treece8220d974c5e7994c82fb35b7bee0f7fd21a7ed /framework
parent0c2d6574c6cca4bbb0cc469fb2c976774394e01a (diff)
clang-tidy modernize-loop-convert in f*
Change-Id: Id866aa244378758e3bdb9e99d02cdd2ae6104e16
Diffstat (limited to 'framework')
-rw-r--r--framework/source/jobs/jobdispatch.cxx4
-rw-r--r--framework/source/uiconfiguration/imagemanagerimpl.cxx12
-rw-r--r--framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx16
-rw-r--r--framework/source/uiconfiguration/uiconfigurationmanager.cxx12
-rw-r--r--framework/source/uielement/controlmenucontroller.cxx4
-rw-r--r--framework/source/xml/imagesdocumenthandler.cxx8
6 files changed, 28 insertions, 28 deletions
diff --git a/framework/source/jobs/jobdispatch.cxx b/framework/source/jobs/jobdispatch.cxx
index 78e014c30c40..d85fb0e34566 100644
--- a/framework/source/jobs/jobdispatch.cxx
+++ b/framework/source/jobs/jobdispatch.cxx
@@ -323,13 +323,13 @@ void JobDispatch::impl_dispatchEvent( /*IN*/ const OUString&
// It's not really an error, if no registered jobs could be located.
// Step over all found jobs and execute it
int nExecutedJobs=0;
- for (size_t j=0; j<lJobs.size(); ++j)
+ for (OUString & lJob : lJobs)
{
/* SAFE { */
aReadLock.reset();
JobData aCfg(m_xContext);
- aCfg.setEvent(sEvent, lJobs[j]);
+ aCfg.setEvent(sEvent, lJob);
aCfg.setEnvironment(JobData::E_DISPATCH);
const bool bIsEnabled=aCfg.hasCorrectContext(m_sModuleIdentifier);
diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx
index 139e015d35d8..f8336256eab0 100644
--- a/framework/source/uiconfiguration/imagemanagerimpl.cxx
+++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx
@@ -544,10 +544,10 @@ void ImageManagerImpl::dispose()
m_bDisposed = true;
// delete user and default image list on dispose
- for ( sal_Int32 n=0; n < ImageType_COUNT; n++ )
+ for (ImageList*& n : m_pUserImageList)
{
- delete m_pUserImageList[n];
- m_pUserImageList[n] = nullptr;
+ delete n;
+ n = nullptr;
}
delete m_pDefaultImageList;
m_pDefaultImageList = nullptr;
@@ -1253,10 +1253,10 @@ void ImageManagerImpl::clear()
{
SolarMutexGuard g;
- for ( sal_Int32 n = 0; n < ImageType_COUNT; n++ )
+ for (ImageList* & n : m_pUserImageList)
{
- delete m_pUserImageList[n];
- m_pUserImageList[n] = nullptr;
+ delete n;
+ n = nullptr;
}
}
} // namespace framework
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index a3ca2fb3cacd..5f79341edd2c 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -860,8 +860,8 @@ ModuleUIConfigurationManager::ModuleUIConfigurationManager(
, m_xContext( xContext )
, m_aListenerContainer( m_mutex )
{
- for ( int i = 0; i < css::ui::UIElementType::COUNT; i++ )
- m_pStorageHandler[i] = nullptr;
+ for (PresetHandler* & i : m_pStorageHandler)
+ i = nullptr;
// Make sure we have a default initialized entry for every layer and user interface element type!
// The following code depends on this!
@@ -926,8 +926,8 @@ ModuleUIConfigurationManager::ModuleUIConfigurationManager(
ModuleUIConfigurationManager::~ModuleUIConfigurationManager()
{
- for ( int i = 0; i < css::ui::UIElementType::COUNT; i++ )
- delete m_pStorageHandler[i];
+ for (PresetHandler* i : m_pStorageHandler)
+ delete i;
}
// XComponent
@@ -1596,10 +1596,10 @@ void SAL_CALL ModuleUIConfigurationManager::reload() throw (css::uno::Exception,
aGuard.clear();
// Notify our listeners
- for ( size_t j = 0; j < aRemoveNotifyContainer.size(); j++ )
- implts_notifyContainerListener( aRemoveNotifyContainer[j], NotifyOp_Remove );
- for ( size_t k = 0; k < aReplaceNotifyContainer.size(); k++ )
- implts_notifyContainerListener( aReplaceNotifyContainer[k], NotifyOp_Replace );
+ for (ui::ConfigurationEvent & j : aRemoveNotifyContainer)
+ implts_notifyContainerListener( j, NotifyOp_Remove );
+ for (ui::ConfigurationEvent & k : aReplaceNotifyContainer)
+ implts_notifyContainerListener( k, NotifyOp_Replace );
}
}
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index f169282a2e8f..ebe919202152 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -837,8 +837,8 @@ void SAL_CALL UIConfigurationManager::reset() throw (css::uno::RuntimeException,
aGuard.clear();
// Notify our listeners
- for ( size_t k = 0; k < aRemoveEventNotifyContainer.size(); k++ )
- implts_notifyContainerListener( aRemoveEventNotifyContainer[k], NotifyOp_Remove );
+ for (ConfigurationEvent & k : aRemoveEventNotifyContainer)
+ implts_notifyContainerListener( k, NotifyOp_Remove );
}
catch ( const css::lang::IllegalArgumentException& )
{
@@ -1298,10 +1298,10 @@ void SAL_CALL UIConfigurationManager::reload() throw (css::uno::Exception, css::
aGuard.clear();
// Notify our listeners
- for ( size_t j = 0; j < aRemoveNotifyContainer.size(); j++ )
- implts_notifyContainerListener( aRemoveNotifyContainer[j], NotifyOp_Remove );
- for ( size_t k = 0; k < aReplaceNotifyContainer.size(); k++ )
- implts_notifyContainerListener( aReplaceNotifyContainer[k], NotifyOp_Replace );
+ for (ConfigurationEvent & j : aRemoveNotifyContainer)
+ implts_notifyContainerListener( j, NotifyOp_Remove );
+ for (ConfigurationEvent & k : aReplaceNotifyContainer)
+ implts_notifyContainerListener( k, NotifyOp_Replace );
}
}
diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx
index 7fc5e5e73f59..00e91ace4749 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -418,9 +418,9 @@ void SAL_CALL ControlMenuController::updatePopupMenu() throw (css::uno::RuntimeE
fillPopupMenu( m_xPopupMenu );
m_aURLToDispatchMap.free();
- for (sal_uInt32 i=0; i<SAL_N_ELEMENTS(aCommands); ++i)
+ for (const char* aCommand : aCommands)
{
- aTargetURL.Complete = OUString::createFromAscii( aCommands[i] );
+ aTargetURL.Complete = OUString::createFromAscii( aCommand );
m_xURLTransformer->parseStrict( aTargetURL );
Reference< XDispatch > xDispatch = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 );
diff --git a/framework/source/xml/imagesdocumenthandler.cxx b/framework/source/xml/imagesdocumenthandler.cxx
index 0ba98b3d353d..79866fe53bd5 100644
--- a/framework/source/xml/imagesdocumenthandler.cxx
+++ b/framework/source/xml/imagesdocumenthandler.cxx
@@ -722,8 +722,8 @@ void OWriteImagesDocumentHandler::WriteImageList( const ImageListItemDescriptor*
ImageItemListDescriptor* pImageItemList = pImageList->pImageItemList;
if ( pImageItemList )
{
- for ( size_t i = 0; i < pImageItemList->size(); i++ )
- WriteImage( (*pImageItemList)[i].get() );
+ for (std::unique_ptr<ImageItemDescriptor> & i : *pImageItemList)
+ WriteImage( i.get() );
}
m_xWriteDocumentHandler->endElement( ELEMENT_NS_IMAGES );
@@ -757,9 +757,9 @@ void OWriteImagesDocumentHandler::WriteExternalImageList( const ExternalImageIte
m_xWriteDocumentHandler->startElement( ELEMENT_NS_EXTERNALIMAGES, m_xEmptyList );
m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
- for ( size_t i = 0; i < pExternalImageList->size(); i++ )
+ for (const auto & i : *pExternalImageList)
{
- const ExternalImageItemDescriptor* pItem = (*pExternalImageList)[i].get();
+ const ExternalImageItemDescriptor* pItem = i.get();
WriteExternalImage( pItem );
}