summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-21 11:03:55 +0200
committerNoel Grandin <noel@peralex.com>2016-04-21 11:03:55 +0200
commite1af7f0c438bc242e4562aa0286c99787b5ad544 (patch)
tree29c7faa3556f33baa7eae5cd0aca3946afb8a560 /cui
parent8762aa986dbca42e61cc8fb1b2c1d2ca66bcfcbe (diff)
clang-tidy modernize-loop-convert in c*
Change-Id: I77d2548f8be97792660761e6156cd24734a95aaf
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/acccfg.cxx4
-rw-r--r--cui/source/dialogs/cuifmsearch.cxx28
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx14
-rw-r--r--cui/source/dialogs/cuiimapwnd.cxx4
-rw-r--r--cui/source/dialogs/iconcdlg.cxx13
-rw-r--r--cui/source/dialogs/linkdlg.cxx7
-rw-r--r--cui/source/dialogs/thesdlg.cxx4
-rw-r--r--cui/source/options/optaboutconfig.cxx6
-rw-r--r--cui/source/options/optupdt.cxx6
-rw-r--r--cui/source/options/personalization.cxx22
-rw-r--r--cui/source/options/treeopt.cxx23
-rw-r--r--cui/source/tabpages/autocdlg.cxx10
-rw-r--r--cui/source/tabpages/border.cxx12
-rw-r--r--cui/source/tabpages/labdlg.cxx8
-rw-r--r--cui/source/tabpages/numpages.cxx6
-rw-r--r--cui/source/tabpages/swpossizetabpage.cxx22
-rw-r--r--cui/source/tabpages/tpline.cxx3
17 files changed, 89 insertions, 103 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index a885da1704ff..758975b3e475 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -803,9 +803,9 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( vcl::Window* pParent, const
// detect max keyname width
long nMaxWidth = 0;
- for ( sal_uInt16 i = 0; i < KEYCODE_ARRAY_SIZE; ++i )
+ for (unsigned short i : KEYCODE_ARRAY)
{
- long nTmp = GetTextWidth( vcl::KeyCode( KEYCODE_ARRAY[i] ).GetName() );
+ long nTmp = GetTextWidth( vcl::KeyCode( i ).GetName() );
if ( nTmp > nMaxWidth )
nMaxWidth = nTmp;
}
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index 17d6da871044..e7d30c63db80 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -120,8 +120,8 @@ FmSearchDialog::FmSearchDialog(vcl::Window* pParent, const OUString& sInitialTex
DBG_ASSERT(comphelper::string::getTokenCount(fmscInitial.strUsedFields, ';') == (sal_Int32)fmscInitial.arrFields.size(),
"FmSearchDialog::FmSearchDialog : invalid data supplied by ContextSupplied !");
#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL
- for (sal_Int32 i=0; i<(sal_Int32)fmscInitial.arrFields.size(); ++i)
- DBG_ASSERT(fmscInitial.arrFields.at(i).is(), "FmSearchDialog::FmSearchDialog : invalid data supplied by ContextSupplier !");
+ for (Reference<XInterface> & arrField : fmscInitial.arrFields)
+ DBG_ASSERT(arrField.is(), "FmSearchDialog::FmSearchDialog : invalid data supplied by ContextSupplier !");
#endif // (OSL_DEBUG_LEVEL > 1) || DBG_UTIL
for ( ::std::vector< OUString >::const_iterator context = _rContexts.begin();
@@ -245,8 +245,8 @@ void FmSearchDialog::Init(const OUString& strVisibleFields, const OUString& sIni
RID_STR_SEARCH_END,
RID_STR_SEARCH_WHOLE
};
- for ( size_t i=0; i<SAL_N_ELEMENTS(nResIds); ++i )
- m_plbPosition->InsertEntry( OUString( CUI_RES( nResIds[i] ) ) );
+ for (unsigned short nResId : nResIds)
+ m_plbPosition->InsertEntry( OUString( CUI_RES( nResId ) ) );
m_plbPosition->SelectEntryPos(MATCHING_ANYWHERE);
// the field listbox
@@ -446,14 +446,14 @@ IMPL_LINK_TYPED(FmSearchDialog, OnCheckBoxToggled, CheckBox&, rBox, void)
else if ((&rBox == m_pcbApprox) || (&rBox == m_pcbRegular) || (&rBox == m_pcbWildCard))
{
CheckBox* pBoxes[] = { m_pcbWildCard, m_pcbRegular, m_pcbApprox };
- for (sal_uInt32 i=0; i< SAL_N_ELEMENTS(pBoxes); ++i)
+ for (CheckBox* pBoxe : pBoxes)
{
- if (pBoxes[i] != &rBox)
+ if (pBoxe != &rBox)
{
if (bChecked)
- pBoxes[i]->Disable();
+ pBoxe->Disable();
else
- pBoxes[i]->Enable();
+ pBoxe->Enable();
}
}
@@ -659,16 +659,16 @@ void FmSearchDialog::EnableControlPaint(bool bEnable)
m_pbSearchAgain, m_pbClose };
if (!bEnable)
- for (sal_uInt32 i=0; i<SAL_N_ELEMENTS(pAffectedControls); ++i)
+ for (Control* pAffectedControl : pAffectedControls)
{
- pAffectedControls[i]->SetUpdateMode(bEnable);
- pAffectedControls[i]->EnablePaint(bEnable);
+ pAffectedControl->SetUpdateMode(bEnable);
+ pAffectedControl->EnablePaint(bEnable);
}
else
- for (sal_uInt32 i=0; i<SAL_N_ELEMENTS(pAffectedControls); ++i)
+ for (Control* pAffectedControl : pAffectedControls)
{
- pAffectedControls[i]->EnablePaint(bEnable);
- pAffectedControls[i]->SetUpdateMode(bEnable);
+ pAffectedControl->EnablePaint(bEnable);
+ pAffectedControl->SetUpdateMode(bEnable);
}
}
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 4a10d6f6c434..ca99ba88756c 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -800,8 +800,8 @@ void TPGalleryThemeProperties::dispose()
xMediaPlayer.clear();
xDialogListener.clear();
- for ( size_t i = 0, n = aFilterEntryList.size(); i < n; ++i ) {
- delete aFilterEntryList[ i ];
+ for (FilterEntry* i : aFilterEntryList) {
+ delete i;
}
aFilterEntryList.clear();
@@ -901,17 +901,17 @@ void TPGalleryThemeProperties::FillFilterList()
::avmedia::FilterNameVector aFilters;
::avmedia::MediaWindow::getMediaFilters( aFilters );
- for( unsigned long l = 0; l < aFilters.size(); ++l )
+ for(std::pair<OUString,OUString> & aFilter : aFilters)
{
for( sal_Int32 nIndex = 0; nIndex >= 0; )
{
OUString aFilterWildcard( aWildcard );
pFilterEntry = new FilterEntry;
- pFilterEntry->aFilterName = aFilters[ l ].second.getToken( 0, ';', nIndex );
+ pFilterEntry->aFilterName = aFilter.second.getToken( 0, ';', nIndex );
nFirstExtFilterPos = m_pCbbFileType->InsertEntry(
addExtension(
- aFilters[ l ].first,
+ aFilter.first,
aFilterWildcard += pFilterEntry->aFilterName
)
);
@@ -950,13 +950,13 @@ void TPGalleryThemeProperties::FillFilterList()
}
// media filters
- for( unsigned long k = 0; k < aFilters.size(); ++k )
+ for(std::pair<OUString,OUString> & aFilter : aFilters)
{
for( sal_Int32 nIndex = 0; nIndex >= 0; )
{
if ( !aExtensions.isEmpty() )
aExtensions += ";";
- aExtensions += aWildcard + aFilters[ k ].second.getToken( 0, ';', nIndex );
+ aExtensions += aWildcard + aFilter.second.getToken( 0, ';', nIndex );
}
}
diff --git a/cui/source/dialogs/cuiimapwnd.cxx b/cui/source/dialogs/cuiimapwnd.cxx
index 98e059a2109a..99c71350124b 100644
--- a/cui/source/dialogs/cuiimapwnd.cxx
+++ b/cui/source/dialogs/cuiimapwnd.cxx
@@ -64,8 +64,8 @@ URLDlg::URLDlg( vcl::Window* pWindow, const OUString& rURL, const OUString& rAlt
m_pEdtDescription->SetText( rDescription );
m_pEdtName->SetText( rName );
- for( size_t i = 0, n = rTargetList.size(); i < n; ++i )
- m_pCbbTargets->InsertEntry( rTargetList[ i ] );
+ for(OUString & i : rTargetList)
+ m_pCbbTargets->InsertEntry( i );
if( rTarget.isEmpty() )
m_pCbbTargets->SetText( "_self");
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index 66d042d274f0..1ce8a53b6810 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -220,10 +220,8 @@ void IconChoiceDialog::dispose()
//aTabDlgOpt.SetWindowState(OStringToOUString(GetWindowState((WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | WINDOWSTATE_MASK_STATE | WINDOWSTATE_MASK_MINIMIZED)), RTL_TEXTENCODING_ASCII_US));
//aTabDlgOpt.SetPageID( mnCurrentPageId );
- for ( size_t i = 0, nCount = maPageList.size(); i < nCount; ++i )
+ for (IconChoicePageData* pData : maPageList)
{
- IconChoicePageData* pData = maPageList[ i ];
-
if ( pData->pPage )
{
OUString aPageData(pData->pPage->GetUserData());
@@ -529,9 +527,8 @@ void IconChoiceDialog::DeActivatePageImpl ()
{
RefreshInputSet();
// flag all pages to be newly initialized
- for ( size_t i = 0, nCount = maPageList.size(); i < nCount; ++i )
+ for (IconChoicePageData* pObj : maPageList)
{
- IconChoicePageData* pObj = maPageList[ i ];
if ( pObj->pPage.get() != pPage )
pObj->bRefresh = true;
else
@@ -668,9 +665,8 @@ void IconChoiceDialog::Start()
bool IconChoiceDialog::QueryClose()
{
bool bRet = true;
- for ( size_t i = 0, nCount = maPageList.size(); i < nCount; ++i )
+ for (IconChoicePageData* pData : maPageList)
{
- IconChoicePageData* pData = maPageList[i ];
if ( pData->pPage && !pData->pPage->QueryClose() )
{
bRet = false;
@@ -700,9 +696,8 @@ void IconChoiceDialog::RefreshInputSet()
IconChoicePageData* IconChoiceDialog::GetPageData ( sal_uInt16 nId )
{
IconChoicePageData *pRet = nullptr;
- for ( size_t i=0; i < maPageList.size(); i++ )
+ for (IconChoicePageData* pData : maPageList)
{
- IconChoicePageData* pData = maPageList[ i ];
if ( pData->nId == nId )
{
pRet = pData;
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index 2403bb9e5126..b5a840f1f028 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -299,8 +299,8 @@ IMPL_LINK_NOARG_TYPED(SvBaseLinksDlg, UpdateNowClickHdl, Button*, void)
tools::SvRef<SvBaseLink> xLink = aLnkArr[ n ];
// first look for the entry in the array
- for( size_t i = 0; i < pLinkMgr->GetLinks().size(); ++i )
- if( xLink == pLinkMgr->GetLinks()[ i ] )
+ for(const auto & i : pLinkMgr->GetLinks())
+ if( xLink == i )
{
xLink->SetUseCache( false );
SetType( *xLink, aPosArr[ n ], xLink->GetUpdateMode() );
@@ -689,9 +689,8 @@ void SvBaseLinksDlg::SetActLink( SvBaseLink * pLink )
{
const SvBaseLinks& rLnks = pLinkMgr->GetLinks();
sal_uLong nSelect = 0;
- for( size_t n = 0; n < rLnks.size(); ++n )
+ for(const auto & rLinkRef : rLnks)
{
- const tools::SvRef<SvBaseLink>& rLinkRef = rLnks[ n ];
// #109573# only visible links have been inserted into the TreeListBox,
// invisible ones have to be skipped here
if( rLinkRef->IsVisible() )
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index 3e95c310e34f..3c9854f47804 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -501,8 +501,8 @@ SvxThesaurusDialog::SvxThesaurusDialog(
aLangVec.push_back( SvtLanguageTable::GetLanguageString( nLang ) );
}
std::sort( aLangVec.begin(), aLangVec.end() );
- for (size_t i = 0; i < aLangVec.size(); ++i)
- m_pLangLB->InsertEntry( aLangVec[i] );
+ for (OUString & i : aLangVec)
+ m_pLangLB->InsertEntry( i );
std::vector< OUString >::iterator aI = std::find(aLangVec.begin(), aLangVec.end(),
SvtLanguageTable::GetLanguageString(nLanguage));
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 112dbf294f61..3661856620b3 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -507,13 +507,13 @@ void CuiAboutConfigTabPage::AddToModifiedVector( const std::shared_ptr< Prop_Imp
{
bool isModifiedBefore = false;
//Check if value modified before
- for( size_t nInd = 0; nInd < m_vectorOfModified.size() ; ++nInd )
+ for(std::shared_ptr<Prop_Impl> & nInd : m_vectorOfModified)
{
- if( rProp->Name == m_vectorOfModified[nInd]->Name && rProp->Property == m_vectorOfModified[nInd]->Property )
+ if( rProp->Name == nInd->Name && rProp->Property == nInd->Property )
{
//property modified before. Assign reference to the modified value
//do your changes on this object. They will be saved later.
- m_vectorOfModified[nInd] = rProp;
+ nInd = rProp;
isModifiedBefore = true;
break;
}
diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index 9da2bb42da65..3623bd65200c 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -180,11 +180,11 @@ void SvxOnlineUpdateTabPage::UpdateUserAgent()
uno::Sequence< beans::StringPair > aHeaders
= xDav->getUserRequestHeaders( aPseudoURL, ucb::WebDAVHTTPMethod(0) );
- for ( auto i = aHeaders.begin(); i != aHeaders.end(); ++i )
+ for (css::beans::StringPair & aHeader : aHeaders)
{
- if ( i->First == "User-Agent" )
+ if ( aHeader.First == "User-Agent" )
{
- OUString aText = i->Second;
+ OUString aText = aHeader.Second;
aText = aText.replaceAll(";", ";\n");
aText = aText.replaceAll("(", "\n(");
m_pUserAgentLabel->SetText( aText );
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index 2e990cf77436..57298ae26243 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -85,10 +85,10 @@ SelectPersonaDialog::SelectPersonaDialog( vcl::Window *pParent )
get( m_vResultList[7], "result8" );
get( m_vResultList[8], "result9" );
- for (sal_Int32 nIndex = 0; nIndex < 9; ++nIndex)
+ for (VclPtr<PushButton> & nIndex : m_vResultList)
{
- m_vResultList[nIndex]->SetClickHdl( LINK( this, SelectPersonaDialog, SelectPersona ) );
- m_vResultList[nIndex]->Disable();
+ nIndex->SetClickHdl( LINK( this, SelectPersonaDialog, SelectPersona ) );
+ nIndex->Disable();
}
}
@@ -129,11 +129,11 @@ IMPL_LINK_TYPED( SelectPersonaDialog, SearchPersonas, Button*, pButton, void )
searchTerm = m_pEdit->GetText();
else
{
- for( sal_Int32 nIndex = 0; nIndex < 5; nIndex++ )
+ for(VclPtr<PushButton> & m_vSearchSuggestion : m_vSearchSuggestions)
{
- if( pButton == m_vSearchSuggestions[nIndex] )
+ if( pButton == m_vSearchSuggestion )
{
- searchTerm = m_vSearchSuggestions[nIndex]->GetDisplayText();
+ searchTerm = m_vSearchSuggestion->GetDisplayText();
break;
}
}
@@ -235,10 +235,10 @@ void SelectPersonaDialog::ClearSearchResults()
{
m_vPersonaSettings.clear();
m_aSelectedPersona.clear();
- for( sal_Int32 nIndex = 0; nIndex < 9; nIndex++ )
+ for(VclPtr<PushButton> & nIndex : m_vResultList)
{
- m_vResultList[nIndex]->Disable();
- m_vResultList[nIndex]->SetModeImage(Image());
+ nIndex->Disable();
+ nIndex->SetModeImage(Image());
}
}
@@ -286,8 +286,8 @@ void SvxPersonalizationTabPage::dispose()
m_pDefaultPersona.clear();
m_pOwnPersona.clear();
m_pSelectPersona.clear();
- for (int i=0; i<3; ++i)
- m_vDefaultPersonaImages[i].clear();
+ for (VclPtr<PushButton> & m_vDefaultPersonaImage : m_vDefaultPersonaImages)
+ m_vDefaultPersonaImage.clear();
m_pExtensionPersonaPreview.clear();
m_pPersonaList.clear();
m_pExtensionLabel.clear();
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index d5b6b938659d..1450f6798607 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1803,8 +1803,8 @@ bool isNodeActive( OptionsNode* pNode, Module* pModule )
// search node in active module
if ( pModule->m_bActive )
{
- for ( size_t j = 0; j < pModule->m_aNodeList.size(); ++j )
- if ( pModule->m_aNodeList[j]->m_sId == pNode->m_sId )
+ for (OrderedEntry* j : pModule->m_aNodeList)
+ if ( j->m_sId == pNode->m_sId )
return true;
}
}
@@ -1997,22 +1997,21 @@ VectorOfNodes OfaTreeOptionsDialog::LoadNodes(
bool bAlreadyOpened = false;
if ( pNode->m_aGroupedLeaves.size() > 0 )
{
- for ( size_t k = 0;
- k < pNode->m_aGroupedLeaves.size(); ++k )
+ for (std::vector<OptionsLeaf*> & m_aGroupedLeave : pNode->m_aGroupedLeaves)
{
- if ( pNode->m_aGroupedLeaves[k].size() > 0 &&
- pNode->m_aGroupedLeaves[k][0]->m_sGroupId
+ if ( m_aGroupedLeave.size() > 0 &&
+ m_aGroupedLeave[0]->m_sGroupId
== sLeafGrpId )
{
sal_uInt32 l = 0;
- for ( ; l < pNode->m_aGroupedLeaves[k].size(); ++l )
+ for ( ; l < m_aGroupedLeave.size(); ++l )
{
- if ( pNode->m_aGroupedLeaves[k][l]->
+ if ( m_aGroupedLeave[l]->
m_nGroupIndex >= nLeafGrpIdx )
break;
}
- pNode->m_aGroupedLeaves[k].insert(
- pNode->m_aGroupedLeaves[k].begin() + l, pLeaf );
+ m_aGroupedLeave.insert(
+ m_aGroupedLeave.begin() + l, pLeaf );
bAlreadyOpened = true;
break;
}
@@ -2112,10 +2111,8 @@ static void lcl_insertLeaf(
void OfaTreeOptionsDialog::InsertNodes( const VectorOfNodes& rNodeList )
{
- for ( size_t i = 0; i < rNodeList.size(); ++i )
+ for (OptionsNode* pNode : rNodeList)
{
- OptionsNode* pNode = rNodeList[i];
-
if ( pNode->m_aLeaves.size() > 0 || pNode->m_aGroupedLeaves.size() > 0 )
{
sal_uInt32 j = 0;
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 4dccaf5238b5..2922a9c6bbe4 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -961,17 +961,14 @@ bool OfaAutocorrReplacePage::FillItemSet( SfxItemSet* )
std::vector<SvxAutocorrWord> aDeleteWords;
std::vector<SvxAutocorrWord> aNewWords;
- for (size_t i = 0; i < rStringChangeList.aDeletedEntries.size(); i++)
+ for (DoubleString & deleteEntry : rStringChangeList.aDeletedEntries)
{
- DoubleString& deleteEntry = rStringChangeList.aDeletedEntries[i];
SvxAutocorrWord aDeleteWord( deleteEntry.sShort, deleteEntry.sLong );
aDeleteWords.push_back( aDeleteWord );
}
- for (size_t i = 0; i < rStringChangeList.aNewEntries.size(); i++)
+ for (DoubleString & newEntry : rStringChangeList.aNewEntries)
{
- DoubleString& newEntry = rStringChangeList.aNewEntries[i];
-
//fdo#67697 if the user data is set then we want to retain the
//source formatting of the entry, so don't use the optimized
//text-only MakeCombinedChanges for this entry
@@ -1034,9 +1031,8 @@ void OfaAutocorrReplacePage::RefillReplaceBox(bool bFromReset,
if( aDoubleStringTable.find(eLang) != aDoubleStringTable.end() )
{
DoubleStringArray& rArray = aDoubleStringTable[eNewLanguage];
- for( size_t i = 0; i < rArray.size(); i++ )
+ for(DoubleString & rDouble : rArray)
{
- DoubleString& rDouble = rArray[i];
bool bTextOnly = nullptr == rDouble.pUserData;
// formatted text is only in Writer
if(bSWriter || bTextOnly)
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 416a582cc6a6..69c4adb785ab 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -169,8 +169,8 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
{
const SfxIntegerListItem* p = static_cast<const SfxIntegerListItem*>(pItem);
std::vector<sal_Int32> aUsedStyles = p->GetList();
- for (size_t i = 0, n = aUsedStyles.size(); i < n; ++i)
- maUsedBorderStyles.insert(static_cast<sal_Int16>(aUsedStyles[i]));
+ for (int aUsedStyle : aUsedStyles)
+ maUsedBorderStyles.insert(static_cast<sal_Int16>(aUsedStyle));
}
if (rCoreAttrs.HasItem(SID_ATTR_BORDER_DEFAULT_WIDTH, &pItem))
@@ -665,8 +665,8 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
{ svx::FRAMEBORDER_RIGHT,SvxBoxItemLine::RIGHT },
};
- for (sal_uInt32 i=0; i < SAL_N_ELEMENTS(eTypes1); ++i)
- aBoxItem.SetLine( m_pFrameSel->GetFrameBorderStyle( eTypes1[i].first ), eTypes1[i].second );
+ for (std::pair<svx::FrameBorderType,SvxBoxItemLine> i : eTypes1)
+ aBoxItem.SetLine( m_pFrameSel->GetFrameBorderStyle( i.first ), i.second );
aBoxItem.SetRemoveAdjacentCellBorder( mbRemoveAdjacentCellBorders );
@@ -676,8 +676,8 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
{ svx::FRAMEBORDER_HOR,SvxBoxInfoItemLine::HORI },
{ svx::FRAMEBORDER_VER,SvxBoxInfoItemLine::VERT }
};
- for (sal_uInt32 j=0; j < SAL_N_ELEMENTS(eTypes2); ++j)
- aBoxInfoItem.SetLine( m_pFrameSel->GetFrameBorderStyle( eTypes2[j].first ), eTypes2[j].second );
+ for (std::pair<svx::FrameBorderType,SvxBoxInfoItemLine> j : eTypes2)
+ aBoxInfoItem.SetLine( m_pFrameSel->GetFrameBorderStyle( j.first ), j.second );
aBoxInfoItem.EnableHor( mbHorEnabled );
aBoxInfoItem.EnableVer( mbVerEnabled );
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index da590149f576..e99c26b9cd30 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -390,8 +390,8 @@ void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType )
case AZ_HORIZONTAL:
m_pLB_ANSATZ_REL->Clear();
- for (size_t i = 0 ; i < m_aStrHorzList.size(); ++i)
- m_pLB_ANSATZ_REL->InsertEntry(m_aStrHorzList[i]);
+ for (OUString & i : m_aStrHorzList)
+ m_pLB_ANSATZ_REL->InsertEntry(i);
m_pLB_ANSATZ_REL->SelectEntryPos(nAnsatzRelPos);
m_pMF_ANSATZ->Hide();
@@ -403,8 +403,8 @@ void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType )
case AZ_VERTIKAL:
m_pLB_ANSATZ_REL->Clear();
- for (size_t i = 0 ; i < m_aStrVertList.size(); ++i)
- m_pLB_ANSATZ_REL->InsertEntry(m_aStrVertList[i]);
+ for (OUString & i : m_aStrVertList)
+ m_pLB_ANSATZ_REL->InsertEntry(i);
m_pLB_ANSATZ_REL->SelectEntryPos(nAnsatzRelPos);
m_pMF_ANSATZ->Hide();
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 9d7bdd71193a..763e701bc5f7 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -1136,11 +1136,11 @@ void SvxNumOptionsTabPage::GetI18nNumbering( ListBox& rFmtLB, sal_uInt16 nDoNotR
}
}
}
- for (size_t i=0; i<aRemove.size(); ++i)
+ for (unsigned short i : aRemove)
{
- if (aRemove[i] != nDontRemove)
+ if (i != nDontRemove)
{
- sal_Int32 nPos = rFmtLB.GetEntryPos( reinterpret_cast<void*>((sal_uLong)aRemove[i]));
+ sal_Int32 nPos = rFmtLB.GetEntryPos( reinterpret_cast<void*>((sal_uLong)i));
rFmtLB.RemoveEntry( nPos);
}
}
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index 30e1cd68fc5b..eb5cf570a298 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -468,11 +468,11 @@ static sal_uLong lcl_GetLBRelationsForRelations( const sal_uInt16 _nRel )
{
sal_uLong nLBRelations = 0L;
- for ( sal_uInt16 nRelMapPos = 0; nRelMapPos < SAL_N_ELEMENTS(aRelationMap); ++nRelMapPos )
+ for (RelationMap & nRelMapPos : aRelationMap)
{
- if ( aRelationMap[nRelMapPos].nRelation == _nRel )
+ if ( nRelMapPos.nRelation == _nRel )
{
- nLBRelations |= aRelationMap[nRelMapPos].nLBRelation;
+ nLBRelations |= nRelMapPos.nLBRelation;
}
}
@@ -659,12 +659,12 @@ void SvxSwPosSizeTabPage::setOptimalFrmWidth()
};
std::vector<SvxSwFramePosString::StringId> aFrames;
- for (size_t i = 0; i < SAL_N_ELEMENTS(aMaps); ++i)
+ for (const FrmMaps& aMap : aMaps)
{
- for (size_t j = 0; j < aMaps[i].nCount; ++j)
+ for (size_t j = 0; j < aMap.nCount; ++j)
{
- aFrames.push_back(aMaps[i].pMap[j].eStrId);
- aFrames.push_back(aMaps[i].pMap[j].eMirrorStrId);
+ aFrames.push_back(aMap.pMap[j].eStrId);
+ aFrames.push_back(aMap.pMap[j].eMirrorStrId);
}
}
@@ -700,12 +700,12 @@ void SvxSwPosSizeTabPage::setOptimalRelWidth()
};
std::vector<SvxSwFramePosString::StringId> aRels;
- for (size_t i = 0; i < SAL_N_ELEMENTS(aMaps); ++i)
+ for (const RelationMaps& aMap : aMaps)
{
- for (size_t j = 0; j < aMaps[i].nCount; ++j)
+ for (size_t j = 0; j < aMap.nCount; ++j)
{
- aRels.push_back(aMaps[i].pMap[j].eStrId);
- aRels.push_back(aMaps[i].pMap[j].eMirrorStrId);
+ aRels.push_back(aMap.pMap[j].eStrId);
+ aRels.push_back(aMap.pMap[j].eMirrorStrId);
}
}
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index a360db9d3073..e9837482ad5d 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -236,9 +236,8 @@ void SvxLineTabPage::dispose()
m_pSymbolMB = nullptr;
}
- for ( size_t i = 0, n = m_aGrfBrushItems.size(); i < n; ++i )
+ for (SvxBmpItemInfo* pInfo : m_aGrfBrushItems)
{
- SvxBmpItemInfo* pInfo = m_aGrfBrushItems[ i ];
delete pInfo->pBrushItem;
delete pInfo;
}