summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-25 10:56:28 +0200
committerNoel Grandin <noel@peralex.com>2016-04-25 11:57:07 +0200
commita5810faae384f7f73e8e835c1f536785a60881d2 (patch)
tree32586f5af184c764d103e64c3c31b366f421c832 /dbaccess/source
parentcafc53f8b4c08443524b1da6f4918d49afd45bb5 (diff)
clang-tidy modernize-loop-convert in d*
Change-Id: I0830a41b48e884ef63d32b5873c7007195659bb9
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/core/api/RowSet.cxx6
-rw-r--r--dbaccess/source/core/api/columnsettings.cxx6
-rw-r--r--dbaccess/source/core/api/definitioncolumn.cxx6
-rw-r--r--dbaccess/source/core/dataaccess/documentdefinition.cxx8
-rw-r--r--dbaccess/source/core/misc/dsntypes.cxx6
-rw-r--r--dbaccess/source/core/recovery/dbdocrecovery.cxx8
-rw-r--r--dbaccess/source/ext/macromigration/migrationengine.cxx10
-rw-r--r--dbaccess/source/filter/xml/xmlExport.cxx34
-rw-r--r--dbaccess/source/ui/app/AppController.cxx8
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx26
-rw-r--r--dbaccess/source/ui/app/AppIconControl.cxx8
-rw-r--r--dbaccess/source/ui/app/AppTitleWindow.cxx12
-rw-r--r--dbaccess/source/ui/browser/dbloader.cxx6
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx6
-rw-r--r--dbaccess/source/ui/control/FieldDescControl.cxx36
-rw-r--r--dbaccess/source/ui/dlg/queryorder.cxx8
-rw-r--r--dbaccess/source/ui/misc/DExport.cxx8
-rw-r--r--dbaccess/source/ui/misc/HtmlReader.cxx12
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx4
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx16
-rw-r--r--dbaccess/source/ui/querydesign/LimitBox.cxx5
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx8
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx4
-rw-r--r--dbaccess/source/ui/uno/copytablewizard.cxx6
24 files changed, 126 insertions, 131 deletions
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 42913cefdb1b..18a95db85ec2 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -1746,11 +1746,11 @@ void ORowSet::impl_initializeColumnSettings_nothrow( const Reference< XPropertyS
OUString(PROPERTY_ALIGN), OUString(PROPERTY_RELATIVEPOSITION), OUString(PROPERTY_WIDTH), OUString(PROPERTY_HIDDEN), OUString(PROPERTY_CONTROLMODEL),
OUString(PROPERTY_HELPTEXT), OUString(PROPERTY_CONTROLDEFAULT)
};
- for ( size_t i=0; i<SAL_N_ELEMENTS( aPropertyNames ); ++i )
+ for (const auto & aPropertyName : aPropertyNames)
{
- if ( xInfo->hasPropertyByName( aPropertyNames[i] ) )
+ if ( xInfo->hasPropertyByName( aPropertyName ) )
{
- _rxRowSetColumn->setPropertyValue( aPropertyNames[i], _rxTemplateColumn->getPropertyValue( aPropertyNames[i] ) );
+ _rxRowSetColumn->setPropertyValue( aPropertyName, _rxTemplateColumn->getPropertyValue( aPropertyName ) );
bHaveAnyColumnSetting = true;
}
}
diff --git a/dbaccess/source/core/api/columnsettings.cxx b/dbaccess/source/core/api/columnsettings.cxx
index 7449c320500f..860ed7d36617 100644
--- a/dbaccess/source/core/api/columnsettings.cxx
+++ b/dbaccess/source/core/api/columnsettings.cxx
@@ -132,10 +132,10 @@ namespace dbaccess
{ OUString(PROPERTY_HIDDEN), PROPERTY_ID_HIDDEN }
};
- for ( size_t i=0; i < SAL_N_ELEMENTS( aProps ); ++i )
+ for (const auto & aProp : aProps)
{
- if ( xPSI->hasPropertyByName( aProps[i].sName ) )
- if ( !isDefaulted( aProps[i].nHandle, _rxColumn->getPropertyValue( aProps[i].sName ) ) )
+ if ( xPSI->hasPropertyByName( aProp.sName ) )
+ if ( !isDefaulted( aProp.nHandle, _rxColumn->getPropertyValue( aProp.sName ) ) )
return false;
}
}
diff --git a/dbaccess/source/core/api/definitioncolumn.cxx b/dbaccess/source/core/api/definitioncolumn.cxx
index 435e99576360..c8d7e9dc6e2f 100644
--- a/dbaccess/source/core/api/definitioncolumn.cxx
+++ b/dbaccess/source/core/api/definitioncolumn.cxx
@@ -200,10 +200,10 @@ OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, co
{ OUString(PROPERTY_TABLENAME), PROPERTY_ID_TABLENAME },
{ OUString(PROPERTY_REALNAME), PROPERTY_ID_REALNAME }
};
- for ( size_t i=0; i < SAL_N_ELEMENTS( aProps ); ++i )
+ for (const auto & aProp : aProps)
{
- if ( xPSI->hasPropertyByName( aProps[i].sName ) )
- setFastPropertyValue_NoBroadcast( aProps[i].nHandle, _rxParserColumn->getPropertyValue( aProps[i].sName ) );
+ if ( xPSI->hasPropertyByName( aProp.sName ) )
+ setFastPropertyValue_NoBroadcast( aProp.nHandle, _rxParserColumn->getPropertyValue( aProp.sName ) );
}
// determine the table column we're based on
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index 9eefaffbd9b7..e421a2b71dd6 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -1476,12 +1476,12 @@ void ODocumentDefinition::separateOpenCommandArguments( const Sequence< Property
{
"RecoveryStorage"
};
- for ( size_t i=0; i < SAL_N_ELEMENTS( pObjectDescriptorArgs ); ++i )
+ for (const char* pObjectDescriptorArg : pObjectDescriptorArgs)
{
- if ( aOpenCommandArguments.has( pObjectDescriptorArgs[i] ) )
+ if ( aOpenCommandArguments.has( pObjectDescriptorArg ) )
{
- o_rEmbeddedObjectDescriptor.put( pObjectDescriptorArgs[i], aOpenCommandArguments.get( pObjectDescriptorArgs[i] ) );
- aOpenCommandArguments.remove( pObjectDescriptorArgs[i] );
+ o_rEmbeddedObjectDescriptor.put( pObjectDescriptorArg, aOpenCommandArguments.get( pObjectDescriptorArg ) );
+ aOpenCommandArguments.remove( pObjectDescriptorArg );
}
}
diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx
index ebd05ab9203b..87b16061df8c 100644
--- a/dbaccess/source/core/misc/dsntypes.cxx
+++ b/dbaccess/source/core/misc/dsntypes.cxx
@@ -411,11 +411,11 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(const OUString& _rDsn) const
KnownPrefix( "sdbc:address:macab", DST_MACAB, true )
};
- for ( size_t i=0; i < SAL_N_ELEMENTS( aKnowPrefixes ); ++i )
+ for (const auto & aKnowPrefixe : aKnowPrefixes)
{
- if( aKnowPrefixes[i].match(sDsn) )
+ if( aKnowPrefixe.match(sDsn) )
{
- return aKnowPrefixes[i].eType;
+ return aKnowPrefixe.eType;
}
}
diff --git a/dbaccess/source/core/recovery/dbdocrecovery.cxx b/dbaccess/source/core/recovery/dbdocrecovery.cxx
index 814a2504256c..b081b63547b6 100644
--- a/dbaccess/source/core/recovery/dbdocrecovery.cxx
+++ b/dbaccess/source/core/recovery/dbdocrecovery.cxx
@@ -291,14 +291,14 @@ namespace dbaccess
// read the map from sub storages to object names
MapCompTypeToCompDescs aMapCompDescs;
const SubComponentType aKnownTypes[] = { TABLE, QUERY, FORM, REPORT, RELATION_DESIGN };
- for ( size_t i = 0; i < SAL_N_ELEMENTS( aKnownTypes ); ++i )
+ for (SubComponentType aKnownType : aKnownTypes)
{
- if ( !xRecoveryStorage->hasByName( SubComponentRecovery::getComponentsStorageName( aKnownTypes[i] ) ) )
+ if ( !xRecoveryStorage->hasByName( SubComponentRecovery::getComponentsStorageName( aKnownType ) ) )
continue;
Reference< XStorage > xComponentsStor( xRecoveryStorage->openStorageElement(
- SubComponentRecovery::getComponentsStorageName( aKnownTypes[i] ), ElementModes::READ ) );
- lcl_readObjectMap_throw( m_pData->aContext, xComponentsStor, aMapCompDescs[ aKnownTypes[i] ] );
+ SubComponentRecovery::getComponentsStorageName( aKnownType ), ElementModes::READ ) );
+ lcl_readObjectMap_throw( m_pData->aContext, xComponentsStor, aMapCompDescs[ aKnownType ] );
xComponentsStor->dispose();
}
diff --git a/dbaccess/source/ext/macromigration/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx
index 5564edcedda8..e2c09925293c 100644
--- a/dbaccess/source/ext/macromigration/migrationengine.cxx
+++ b/dbaccess/source/ext/macromigration/migrationengine.cxx
@@ -194,11 +194,11 @@ namespace dbmm
LanguageMapping( "Python", ePython ), // TODO: is this correct?
LanguageMapping( "Basic", eBasic )
};
- for ( size_t i=0; i < SAL_N_ELEMENTS( aLanguageMapping ); ++i )
+ for (const LanguageMapping& i : aLanguageMapping)
{
- if ( _rLanguage.equalsAscii( aLanguageMapping[i].pAsciiLanguage ) )
+ if ( _rLanguage.equalsAscii( i.pAsciiLanguage ) )
{
- _out_rScriptType = aLanguageMapping[i].eScriptType;
+ _out_rScriptType = i.eScriptType;
return true;
}
}
@@ -1195,8 +1195,8 @@ namespace dbmm
const ScriptType aKnownStorageBasedTypes[] = {
eBeanShell, eJavaScript, ePython, eJava
};
- for ( size_t i=0; i<SAL_N_ELEMENTS( aKnownStorageBasedTypes ); ++i )
- aElementNames.erase( lcl_getScriptsSubStorageName( aKnownStorageBasedTypes[i] ) );
+ for (ScriptType aKnownStorageBasedType : aKnownStorageBasedTypes)
+ aElementNames.erase( lcl_getScriptsSubStorageName( aKnownStorageBasedType ) );
if ( !aElementNames.empty() )
{
diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx
index 0de7d581fb7d..d1863990e9b7 100644
--- a/dbaccess/source/filter/xml/xmlExport.cxx
+++ b/dbaccess/source/filter/xml/xmlExport.cxx
@@ -364,14 +364,14 @@ void ODBExport::exportDataSource()
};
bool bIsXMLDefault = false;
- for ( size_t i=0; i < SAL_N_ELEMENTS( aTokens ); ++i )
+ for (const auto & aToken : aTokens)
{
- if ( pProperties->Name == aTokens[i].sPropertyName )
+ if ( pProperties->Name == aToken.sPropertyName )
{
- eToken = aTokens[i].eAttributeToken;
+ eToken = aToken.eAttributeToken;
- if ( !!aTokens[i].aXMLDefault
- && ( sValue == *aTokens[i].aXMLDefault )
+ if ( !!aToken.aXMLDefault
+ && ( sValue == *aToken.aXMLDefault )
)
{
bIsXMLDefault = true;
@@ -498,9 +498,9 @@ void ODBExport::exportApplicationConnectionSettings(const TSettingsMap& _aSettin
,XML_MAX_ROW_COUNT
,XML_SUPPRESS_VERSION_COLUMNS
};
- for (size_t i = 0; i< SAL_N_ELEMENTS(pSettings); ++i)
+ for (::xmloff::token::XMLTokenEnum pSetting : pSettings)
{
- TSettingsMap::const_iterator aFind = _aSettings.find(pSettings[i]);
+ TSettingsMap::const_iterator aFind = _aSettings.find(pSetting);
if ( aFind != _aSettings.end() )
AddAttribute(XML_NAMESPACE_DB, aFind->first,aFind->second);
}
@@ -531,9 +531,9 @@ void ODBExport::exportDriverSettings(const TSettingsMap& _aSettings)
,XML_IS_FIRST_ROW_HEADER_LINE
,XML_PARAMETER_NAME_SUBSTITUTION
};
- for (size_t i = 0; i< SAL_N_ELEMENTS(pSettings); ++i)
+ for (::xmloff::token::XMLTokenEnum pSetting : pSettings)
{
- TSettingsMap::const_iterator aFind = _aSettings.find(pSettings[i]);
+ TSettingsMap::const_iterator aFind = _aSettings.find(pSetting);
if ( aFind != _aSettings.end() )
AddAttribute(XML_NAMESPACE_DB, aFind->first,aFind->second);
}
@@ -1132,11 +1132,11 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp)
};
::std::vector< XMLPropertyState > aPropertyStates;
- for (size_t i = 0 ; i < SAL_N_ELEMENTS(pExportHelper); ++i)
+ for (const auto & i : pExportHelper)
{
- aPropertyStates = pExportHelper[i].first->Filter(_xProp);
+ aPropertyStates = i.first->Filter(_xProp);
if ( !aPropertyStates.empty() )
- pExportHelper[i].second.first->insert( TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( pExportHelper[i].second.second, aPropertyStates )));
+ i.second.first->insert( TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( i.second.second, aPropertyStates )));
}
Reference< XNameAccess > xCollection;
@@ -1177,14 +1177,14 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp)
TExportPropMapperPair(m_xColumnExportHelper,TEnumMapperPair(&m_aAutoStyleNames,XML_STYLE_FAMILY_TABLE_COLUMN ))
,TExportPropMapperPair(m_xCellExportHelper,TEnumMapperPair(&m_aCellAutoStyleNames,XML_STYLE_FAMILY_TABLE_CELL))
};
- for (size_t i = 0 ; i < SAL_N_ELEMENTS(pExportHelper); ++i)
+ for (const auto & i : pExportHelper)
{
- ::std::vector< XMLPropertyState > aPropStates = pExportHelper[i].first->Filter( _xProp );
+ ::std::vector< XMLPropertyState > aPropStates = i.first->Filter( _xProp );
if ( !aPropStates.empty() )
{
::std::vector< XMLPropertyState >::iterator aItr = aPropStates.begin();
::std::vector< XMLPropertyState >::const_iterator aEnd = aPropStates.end();
- const rtl::Reference < XMLPropertySetMapper >& pStyle = pExportHelper[i].first->getPropertySetMapper();
+ const rtl::Reference < XMLPropertySetMapper >& pStyle = i.first->getPropertySetMapper();
while ( aItr != aEnd )
{
if ( aItr->mnIndex != -1 )
@@ -1208,10 +1208,10 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp)
}
}
- if ( XML_STYLE_FAMILY_TABLE_CELL == pExportHelper[i].second.second )
+ if ( XML_STYLE_FAMILY_TABLE_CELL == i.second.second )
::std::copy( m_aCurrentPropertyStates.begin(), m_aCurrentPropertyStates.end(), ::std::back_inserter( aPropStates ));
if ( !aPropStates.empty() )
- pExportHelper[i].second.first->insert( TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( pExportHelper[i].second.second, aPropStates )));
+ i.second.first->insert( TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( i.second.second, aPropStates )));
}
}
}
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 071cbab7713e..d6b962767077 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -2646,9 +2646,9 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel >
{
if ( m_xDataSource.is() )
{
- for ( size_t i=0; i < SAL_N_ELEMENTS( aPropertyNames ); ++i )
+ for (const auto & aPropertyName : aPropertyNames)
{
- m_xDataSource->removePropertyChangeListener( aPropertyNames[i], this );
+ m_xDataSource->removePropertyChangeListener( aPropertyName, this );
}
}
@@ -2669,9 +2669,9 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel >
{
if ( m_xDataSource.is() )
{
- for ( size_t i=0; i < SAL_N_ELEMENTS( aPropertyNames ); ++i )
+ for (const auto & aPropertyName : aPropertyNames)
{
- m_xDataSource->addPropertyChangeListener( aPropertyNames[i], this );
+ m_xDataSource->addPropertyChangeListener( aPropertyName, this );
}
}
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 3c96e67237ec..aaabfb2bb024 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -212,8 +212,8 @@ OAppDetailPageHelper::OAppDetailPageHelper(vcl::Window* _pParent,OAppBorderWindo
m_xWindow = VCLUnoHelper::GetInterface( m_pTablePreview );
SetUniqueId(UID_APP_DETAILPAGE_HELPER);
- for (int i=0; i < E_ELEMENT_TYPE_COUNT; ++i)
- m_pLists[i] = nullptr;
+ for (VclPtr<DBTreeListBox> & m_pList : m_pLists)
+ m_pList = nullptr;
ImplInitSettings();
}
@@ -235,14 +235,14 @@ void OAppDetailPageHelper::dispose()
OSL_FAIL("Exception thrown while disposing preview frame!");
}
- for (int i=0; i < E_ELEMENT_TYPE_COUNT; ++i)
+ for (VclPtr<DBTreeListBox> & m_pList : m_pLists)
{
- if ( m_pLists[i] )
+ if ( m_pList )
{
- m_pLists[i]->clearCurrentSelection();
- m_pLists[i]->Hide();
- m_pLists[i]->clearCurrentSelection(); // why a second time?
- m_pLists[i].disposeAndClear();
+ m_pList->clearCurrentSelection();
+ m_pList->Hide();
+ m_pList->clearCurrentSelection(); // why a second time?
+ m_pList.disposeAndClear();
}
}
m_aMenu.reset();
@@ -764,10 +764,10 @@ DBTreeListBox* OAppDetailPageHelper::createTree( DBTreeListBox* _pTreeView, cons
void OAppDetailPageHelper::clearPages()
{
showPreview(nullptr);
- for (size_t i=0; i < E_ELEMENT_TYPE_COUNT; ++i)
+ for (VclPtr<DBTreeListBox> & m_pList : m_pLists)
{
- if ( m_pLists[i] )
- m_pLists[i]->Clear();
+ if ( m_pList )
+ m_pList->Clear();
}
}
@@ -1156,9 +1156,9 @@ IMPL_LINK_NOARG_TYPED(OAppDetailPageHelper, OnDropdownClickHdl, ToolBox*, void)
, SID_DB_APP_VIEW_DOCINFO_PREVIEW
};
- for(size_t i=0; i < SAL_N_ELEMENTS(pActions);++i)
+ for(unsigned short pAction : pActions)
{
- aMenu->CheckItem(pActions[i],m_aMenu->IsItemChecked(pActions[i]));
+ aMenu->CheckItem(pAction,m_aMenu->IsItemChecked(pAction));
}
aMenu->EnableItem( SID_DB_APP_VIEW_DOCINFO_PREVIEW, getBorderWin().getView()->getAppController().isCommandEnabled(SID_DB_APP_VIEW_DOCINFO_PREVIEW) );
diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx
index d0c0fde00dd5..078b2245bce3 100644
--- a/dbaccess/source/ui/app/AppIconControl.cxx
+++ b/dbaccess/source/ui/app/AppIconControl.cxx
@@ -47,13 +47,13 @@ OApplicationIconControl::OApplicationIconControl(vcl::Window* _pParent)
{ RID_STR_FORMS_CONTAINER, E_FORM, IMG_FORMFOLDER_TREE_L },
{ RID_STR_REPORTS_CONTAINER, E_REPORT, IMG_REPORTFOLDER_TREE_L }
};
- for ( size_t i=0; i < SAL_N_ELEMENTS(aCategories); ++i)
+ for (const CategoryDescriptor& aCategorie : aCategories)
{
SvxIconChoiceCtrlEntry* pEntry = InsertEntry(
- OUString( ModuleRes( aCategories[i].nLabelResId ) ) ,
- Image( ModuleRes( aCategories[i].nImageResId ) ) );
+ OUString( ModuleRes( aCategorie.nLabelResId ) ) ,
+ Image( ModuleRes( aCategorie.nImageResId ) ) );
if ( pEntry )
- pEntry->SetUserData( new ElementType( aCategories[i].eType ) );
+ pEntry->SetUserData( new ElementType( aCategorie.eType ) );
}
SetChoiceWithCursor();
diff --git a/dbaccess/source/ui/app/AppTitleWindow.cxx b/dbaccess/source/ui/app/AppTitleWindow.cxx
index cb2f0526295a..7c89754c0da0 100644
--- a/dbaccess/source/ui/app/AppTitleWindow.cxx
+++ b/dbaccess/source/ui/app/AppTitleWindow.cxx
@@ -41,14 +41,14 @@ OTitleWindow::OTitleWindow(vcl::Window* _pParent,sal_uInt16 _nTitleId,WinBits _n
const StyleSettings& rStyle = Application::GetSettings().GetStyleSettings();
vcl::Window* pWindows[] = { m_aSpace1.get(), m_aSpace2.get(), m_aTitle.get() };
- for (size_t i=0; i < SAL_N_ELEMENTS(pWindows); ++i)
+ for (vcl::Window* pWindow : pWindows)
{
- vcl::Font aFont = pWindows[i]->GetControlFont();
+ vcl::Font aFont = pWindow->GetControlFont();
aFont.SetWeight(WEIGHT_BOLD);
- pWindows[i]->SetControlFont(aFont);
- pWindows[i]->SetControlForeground(rStyle.GetLightColor());
- pWindows[i]->SetControlBackground(rStyle.GetShadowColor());
- pWindows[i]->Show();
+ pWindow->SetControlFont(aFont);
+ pWindow->SetControlForeground(rStyle.GetLightColor());
+ pWindow->SetControlBackground(rStyle.GetShadowColor());
+ pWindow->Show();
}
}
diff --git a/dbaccess/source/ui/browser/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx
index 2d74d33f3945..d8efde54c7f2 100644
--- a/dbaccess/source/ui/browser/dbloader.cxx
+++ b/dbaccess/source/ui/browser/dbloader.cxx
@@ -174,12 +174,12 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
Reference< XController2 > xController;
const OUString sComponentURL( aParser.GetMainURL( INetURLObject::DECODE_TO_IURI ) );
- for ( size_t i=0; i < SAL_N_ELEMENTS( aImplementations ); ++i )
+ for (const ServiceNameToImplName& aImplementation : aImplementations)
{
- if ( sComponentURL.equalsAscii( aImplementations[i].pAsciiServiceName ) )
+ if ( sComponentURL.equalsAscii( aImplementation.pAsciiServiceName ) )
{
xController.set( m_xContext->getServiceManager()->
- createInstanceWithContext( OUString::createFromAscii( aImplementations[i].pAsciiImplementationName ), m_xContext), UNO_QUERY_THROW );
+ createInstanceWithContext( OUString::createFromAscii( aImplementation.pAsciiImplementationName ), m_xContext), UNO_QUERY_THROW );
break;
}
}
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 7005c727c2d2..e33ada455982 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -542,11 +542,11 @@ bool SbaTableQueryBrowser::InitializeForm( const Reference< XPropertySet > & i_f
OUString(PROPERTY_HAVING_CLAUSE),
OUString(PROPERTY_ORDER)
};
- for (size_t i = 0; i < SAL_N_ELEMENTS(aTransferProperties); ++i)
+ for (const auto & aTransferPropertie : aTransferProperties)
{
- if ( !xPSI->hasPropertyByName( aTransferProperties[i] ) )
+ if ( !xPSI->hasPropertyByName( aTransferPropertie ) )
continue;
- aPropertyValues.put( aTransferProperties[i], pData->xObjectProperties->getPropertyValue( aTransferProperties[i] ) );
+ aPropertyValues.put( aTransferPropertie, pData->xObjectProperties->getPropertyValue( aTransferPropertie ) );
}
::std::vector< OUString > aNames( aPropertyValues.getNames() );
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index 20e1d9180969..dbd43d7ff597 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -275,8 +275,8 @@ void OFieldDescControl::CheckScrollBars()
// horizontal :
long lMaxXPosition = 0;
Control* ppAggregates[] = { pRequired, pNumType, pAutoIncrement, pDefault, pTextLen, pLength, pScale, pFormat, m_pColumnName, m_pType,m_pAutoIncrementValue};
- for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
- getMaxXPosition(ppAggregates[i],lMaxXPosition);
+ for (Control* ppAggregate : ppAggregates)
+ getMaxXPosition(ppAggregate,lMaxXPosition);
lMaxXPosition += m_pHorzScroll->GetThumbPos() * HSCROLL_STEP;
@@ -399,8 +399,8 @@ sal_uInt16 OFieldDescControl::CountActiveAggregates() const
{
Control* ppAggregates[] = { pRequired, pNumType, pAutoIncrement, pDefault, pTextLen, pLength, pScale, pFormat, m_pColumnName, m_pType,m_pAutoIncrementValue};
sal_uInt16 nVisibleAggregates = 0;
- for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
- if (ppAggregates[i])
+ for (Control* pAggregate : ppAggregates)
+ if (pAggregate)
++nVisibleAggregates;
return nVisibleAggregates;
}
@@ -409,11 +409,11 @@ sal_Int32 OFieldDescControl::GetMaxControlHeight() const
{
Size aHeight;
Control* ppAggregates[] = { pRequired, pNumType, pAutoIncrement, pDefault, pTextLen, pLength, pScale, pFormat, m_pColumnName, m_pType,m_pAutoIncrementValue};
- for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
+ for (Control* pAggregate : ppAggregates)
{
- if ( ppAggregates[i] )
+ if ( pAggregate )
{
- const Size aTemp(ppAggregates[i]->GetOptimalSize());
+ const Size aTemp(pAggregate->GetOptimalSize());
if ( aTemp.Height() > aHeight.Height() )
aHeight.Height() = aTemp.Height();
}
@@ -662,11 +662,11 @@ void OFieldDescControl::ArrangeAggregates()
};
long nMaxWidth = 0;
- for (size_t i=0; i<SAL_N_ELEMENTS(adAggregates); i++)
+ for (const AGGREGATE_DESCRIPTION & adAggregate : adAggregates)
{
- if (adAggregates[i].pctrlTextControl)
+ if (adAggregate.pctrlTextControl)
{
- nMaxWidth = ::std::max<long>(OutputDevice::GetTextWidth(adAggregates[i].pctrlTextControl->GetText()),nMaxWidth);
+ nMaxWidth = ::std::max<long>(OutputDevice::GetTextWidth(adAggregate.pctrlTextControl->GetText()),nMaxWidth);
}
}
@@ -675,19 +675,19 @@ void OFieldDescControl::ArrangeAggregates()
// And go ...
int nCurrentControlPos = 0;
Control* pZOrderPredecessor = nullptr;
- for (size_t i=0; i<SAL_N_ELEMENTS(adAggregates); i++)
+ for (AGGREGATE_DESCRIPTION & adAggregate : adAggregates)
{
- if (adAggregates[i].pctrlInputControl)
+ if (adAggregate.pctrlInputControl)
{
- SetPosSize(adAggregates[i].pctrlTextControl, nCurrentControlPos, 0);
- SetPosSize(adAggregates[i].pctrlInputControl, nCurrentControlPos, adAggregates[i].nPosSizeArgument);
+ SetPosSize(adAggregate.pctrlTextControl, nCurrentControlPos, 0);
+ SetPosSize(adAggregate.pctrlInputControl, nCurrentControlPos, adAggregate.nPosSizeArgument);
// Set the z-order in a way such that the Controls can be traversed in the same sequence in which they have been arranged here
- adAggregates[i].pctrlTextControl->SetZOrder(pZOrderPredecessor, pZOrderPredecessor ? ZOrderFlags::Behind : ZOrderFlags::First);
- adAggregates[i].pctrlInputControl->SetZOrder(adAggregates[i].pctrlTextControl, ZOrderFlags::Behind );
- pZOrderPredecessor = adAggregates[i].pctrlInputControl;
+ adAggregate.pctrlTextControl->SetZOrder(pZOrderPredecessor, pZOrderPredecessor ? ZOrderFlags::Behind : ZOrderFlags::First);
+ adAggregate.pctrlInputControl->SetZOrder(adAggregate.pctrlTextControl, ZOrderFlags::Behind );
+ pZOrderPredecessor = adAggregate.pctrlInputControl;
- if (adAggregates[i].pctrlInputControl == pFormatSample)
+ if (adAggregate.pctrlInputControl == pFormatSample)
{
pFormat->SetZOrder(pZOrderPredecessor, ZOrderFlags::Behind);
pZOrderPredecessor = pFormat;
diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx
index 13fb716b4296..7d7828f17a01 100644
--- a/dbaccess/source/ui/dlg/queryorder.cxx
+++ b/dbaccess/source/ui/dlg/queryorder.cxx
@@ -76,9 +76,9 @@ DlgOrderCrit::DlgOrderCrit(vcl::Window * pParent,
m_aValueList[1] = m_pLB_ORDERVALUE2;
m_aValueList[2] = m_pLB_ORDERVALUE3;
- for (int j=0; j < DOG_ROWS; ++j)
+ for (VclPtr<ListBox> & j : m_aColumnList)
{
- m_aColumnList[j]->InsertEntry( aSTR_NOENTRY );
+ j->InsertEntry( aSTR_NOENTRY );
}
for (int j=0; j < DOG_ROWS; ++j)
@@ -104,9 +104,9 @@ DlgOrderCrit::DlgOrderCrit(vcl::Window * pParent,
sal_Int32 eColumnSearch = dbtools::getSearchColumnFlag(m_xConnection,nDataType);
if(eColumnSearch != ColumnSearch::NONE)
{
- for (int j=0; j < DOG_ROWS; ++j)
+ for (VclPtr<ListBox> & j : m_aColumnList)
{
- m_aColumnList[j]->InsertEntry(*pIter);
+ j->InsertEntry(*pIter);
}
}
}
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index 09740afd0a51..d3504b4b3f18 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -112,8 +112,8 @@ ODatabaseExport::ODatabaseExport(sal_Int32 nRows,
{
m_nRows += nRows;
sal_Int32 nCount = 0;
- for(sal_Int32 j=0;j < (sal_Int32)m_vColumns.size();++j)
- if ( m_vColumns[j].first != COLUMN_POSITION_NOT_FOUND )
+ for(const std::pair<sal_Int32,sal_Int32> & rPair : m_vColumns)
+ if ( rPair.first != COLUMN_POSITION_NOT_FOUND )
++nCount;
m_vColumnSize.resize(nCount);
@@ -345,11 +345,11 @@ void ODatabaseExport::insertValueIntoColumn()
,NumberFormat::NUMBER
,NumberFormat::LOGICAL
};
- for (size_t i = 0; i < SAL_N_ELEMENTS(nFormats); ++i)
+ for (short nFormat : nFormats)
{
try
{
- nNumberFormat = m_xFormatter->detectNumberFormat(xNumType->getStandardFormat(nFormats[i],m_aLocale),m_sTextToken);
+ nNumberFormat = m_xFormatter->detectNumberFormat(xNumType->getStandardFormat(nFormat,m_aLocale),m_sTextToken);
break;
}
catch(Exception&)
diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx
index 2cf1497bff1f..9442f8125c69 100644
--- a/dbaccess/source/ui/misc/HtmlReader.cxx
+++ b/dbaccess/source/ui/misc/HtmlReader.cxx
@@ -134,9 +134,8 @@ void OHTMLReader::NextToken( int nToken )
++m_nTableCount;
{ // can also be TD or TH, if there was no TABLE before
const HTMLOptions& rHtmlOptions = GetOptions();
- for (size_t i = 0, n = rHtmlOptions.size(); i < n; ++i)
+ for (const auto & rOption : rHtmlOptions)
{
- const HTMLOption& rOption = rHtmlOptions[i];
switch( rOption.GetToken() )
{
case HTML_O_WIDTH:
@@ -291,9 +290,8 @@ void OHTMLReader::fetchOptions()
{
m_bInTbl = true;
const HTMLOptions& options = GetOptions();
- for (size_t i = 0, n = options.size(); i < n; ++i)
+ for (const auto & rOption : options)
{
- const HTMLOption& rOption = options[i];
switch( rOption.GetToken() )
{
case HTML_O_SDVAL:
@@ -312,9 +310,8 @@ void OHTMLReader::fetchOptions()
void OHTMLReader::TableDataOn(SvxCellHorJustify& eVal)
{
const HTMLOptions& rHtmlOptions = GetOptions();
- for (size_t i = 0, n = rHtmlOptions.size(); i < n; ++i)
+ for (const auto & rOption : rHtmlOptions)
{
- const HTMLOption& rOption = rHtmlOptions[i];
switch( rOption.GetToken() )
{
case HTML_O_ALIGN:
@@ -340,9 +337,8 @@ void OHTMLReader::TableDataOn(SvxCellHorJustify& eVal)
void OHTMLReader::TableFontOn(FontDescriptor& _rFont,sal_Int32 &_rTextColor)
{
const HTMLOptions& rHtmlOptions = GetOptions();
- for (size_t i = 0, n = rHtmlOptions.size(); i < n; ++i)
+ for (const auto & rOption : rHtmlOptions)
{
- const HTMLOption& rOption = rHtmlOptions[i];
switch( rOption.GetToken() )
{
case HTML_O_COLOR:
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index cf4cabdec2ab..abde97068c2a 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -891,8 +891,8 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
pFormatDescriptor.reset();
SfxItemPool::Free(pPool);
- for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(pDefaults); ++i)
- delete pDefaults[i];
+ for (SfxPoolItem* pDefault : pDefaults)
+ delete pDefault;
return bRet;
}
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index 169a0b8d8d89..44ae24f14928 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -143,10 +143,10 @@ void ObjectCopySource::copyUISettingsTo( const Reference< XPropertySet >& _rxObj
const OUString aCopyProperties[] = {
OUString(PROPERTY_FONT), OUString(PROPERTY_ROW_HEIGHT), OUString(PROPERTY_TEXTCOLOR),OUString(PROPERTY_TEXTLINECOLOR),OUString(PROPERTY_TEXTEMPHASIS),OUString(PROPERTY_TEXTRELIEF)
};
- for ( size_t i=0; i < SAL_N_ELEMENTS( aCopyProperties ); ++i )
+ for (const auto & aCopyPropertie : aCopyProperties)
{
- if ( m_xObjectPSI->hasPropertyByName( aCopyProperties[i] ) )
- _rxObject->setPropertyValue( aCopyProperties[i], m_xObject->getPropertyValue( aCopyProperties[i] ) );
+ if ( m_xObjectPSI->hasPropertyByName( aCopyPropertie ) )
+ _rxObject->setPropertyValue( aCopyPropertie, m_xObject->getPropertyValue( aCopyPropertie ) );
}
}
@@ -165,19 +165,19 @@ void ObjectCopySource::copyFilterAndSortingTo( const Reference< XConnection >& _
OUString sStatement = "SELECT * FROM " + sTargetName + " WHERE 0=1";
- for ( size_t i=0; i < SAL_N_ELEMENTS(aProperties); ++i )
+ for (const std::pair<OUString,OUString> & aPropertie : aProperties)
{
- if ( m_xObjectPSI->hasPropertyByName( aProperties[i].first ) )
+ if ( m_xObjectPSI->hasPropertyByName( aPropertie.first ) )
{
OUString sFilter;
- m_xObject->getPropertyValue( aProperties[i].first ) >>= sFilter;
+ m_xObject->getPropertyValue( aPropertie.first ) >>= sFilter;
if ( !sFilter.isEmpty() )
{
- sStatement += aProperties[i].second;
+ sStatement += aPropertie.second;
OUString sReplace = sFilter;
sReplace = sReplace.replaceFirst(sSourceName,sTargetNameTemp);
sFilter = sReplace;
- _rxObject->setPropertyValue( aProperties[i].first, makeAny(sFilter) );
+ _rxObject->setPropertyValue( aPropertie.first, makeAny(sFilter) );
sStatement += sFilter;
}
}
diff --git a/dbaccess/source/ui/querydesign/LimitBox.cxx b/dbaccess/source/ui/querydesign/LimitBox.cxx
index a5047cf6abcd..6575ad19b4fb 100644
--- a/dbaccess/source/ui/querydesign/LimitBox.cxx
+++ b/dbaccess/source/ui/querydesign/LimitBox.cxx
@@ -100,10 +100,9 @@ void LimitBox::LoadDefaultLimits()
{
InsertValue( ALL_INT );
- const unsigned nSize = SAL_N_ELEMENTS(global::aDefLimitAry);
- for( unsigned nIndex = 0; nIndex< nSize; ++nIndex)
+ for(long nIndex : global::aDefLimitAry)
{
- InsertValue( global::aDefLimitAry[nIndex] );
+ InsertValue( nIndex );
}
}
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index ed085e4a5099..c5399b965c16 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -190,10 +190,10 @@ void OSelectionBrowseBox::initialize()
OUString sGroup = m_aFunctionStrings.getToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';') - 1, ';');
m_aFunctionStrings = m_aFunctionStrings.getToken(0, ';');
- for (size_t i = 0; i < SAL_N_ELEMENTS(eFunctions); ++i)
+ for (IParseContext::InternationalKeyCode eFunction : eFunctions)
{
m_aFunctionStrings += ";";
- m_aFunctionStrings += OStringToOUString(rContext.getIntlKeywordAscii(eFunctions[i]),
+ m_aFunctionStrings += OStringToOUString(rContext.getIntlKeywordAscii(eFunction),
RTL_TEXTENCODING_UTF8);
}
m_aFunctionStrings += ";";
@@ -341,9 +341,9 @@ void OSelectionBrowseBox::Init()
Size aHeight;
const Control* pControls[] = { m_pTextCell,m_pVisibleCell,m_pTableCell,m_pFieldCell };
- for (sal_Size i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
+ for (const Control* pControl : pControls)
{
- const Size aTemp(pControls[i]->GetOptimalSize());
+ const Size aTemp(pControl->GetOptimalSize());
if ( aTemp.Height() > aHeight.Height() )
aHeight.Height() = aTemp.Height();
}
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 55e8042767e8..c4b4fd621651 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -234,9 +234,9 @@ void OTableEditorCtrl::InitCellController()
Size aHeight;
const Control* pControls[] = { pTypeCell,pDescrCell,pNameCell,pHelpTextCell};
- for(sal_Size i= 0; i < SAL_N_ELEMENTS(pControls); ++i)
+ for(const Control* pControl : pControls)
{
- const Size aTemp(pControls[i]->GetOptimalSize());
+ const Size aTemp(pControl->GetOptimalSize());
if ( aTemp.Height() > aHeight.Height() )
aHeight.Height() = aTemp.Height();
}
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index b708ebc0fbae..4f977ea6bb02 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -686,11 +686,11 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X
const OUString aSettings[] = {
OUString(PROPERTY_FILTER), OUString(PROPERTY_ORDER), OUString(PROPERTY_HAVING_CLAUSE), OUString(PROPERTY_GROUP_BY)
};
- for ( size_t i=0; i < SAL_N_ELEMENTS( aSettings ); ++i )
+ for (const auto & aSetting : aSettings)
{
- if ( lcl_hasNonEmptyStringValue_throw( _rxSourceDescriptor, xPSI, aSettings[i] ) )
+ if ( lcl_hasNonEmptyStringValue_throw( _rxSourceDescriptor, xPSI, aSetting ) )
{
- sUnsupportedSetting = aSettings[i];
+ sUnsupportedSetting = aSetting;
break;
}
}