summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-28 10:24:35 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-04-28 09:31:29 +0000
commit91adb929d747ef1434fb1732fdbf51283fda78e8 (patch)
tree928b7d95ab0cb21d8a887f1f6b47d6af261f0d12
parent43b4903db3e925c652e25c34362490f8adc9c5ec (diff)
clang-tidy modernize-loop-convert in h-l/*
Change-Id: I843528327b25d18476f8959cabba16371213a48a Reviewed-on: https://gerrit.libreoffice.org/24460 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--helpcompiler/source/HelpCompiler.cxx4
-rw-r--r--helpcompiler/source/HelpLinker.cxx19
-rw-r--r--hwpfilter/source/hinfo.cxx12
-rw-r--r--i18npool/source/breakiterator/breakiteratorImpl.cxx10
-rw-r--r--i18npool/source/breakiterator/breakiterator_unicode.cxx4
-rw-r--r--i18npool/source/breakiterator/xdictionary.cxx18
-rw-r--r--i18npool/source/calendar/calendarImpl.cxx4
-rw-r--r--i18npool/source/characterclassification/characterclassificationImpl.cxx8
-rw-r--r--i18npool/source/collator/collatorImpl.cxx8
-rw-r--r--i18npool/source/inputchecker/inputsequencechecker.cxx8
-rw-r--r--i18npool/source/localedata/localedata.cxx37
-rw-r--r--i18npool/source/nativenumber/nativenumbersupplier.cxx4
-rw-r--r--i18nutil/source/utility/oneToOneMapping.cxx8
-rw-r--r--linguistic/source/dicimp.cxx4
-rw-r--r--linguistic/source/dlistimp.cxx6
-rw-r--r--linguistic/source/iprcache.cxx8
-rw-r--r--linguistic/source/misc.cxx4
-rw-r--r--lotuswordpro/source/filter/lwpdrawobj.cxx18
-rw-r--r--lotuswordpro/source/filter/lwplayout.cxx6
-rw-r--r--lotuswordpro/source/filter/lwprowlayout.cxx4
-rw-r--r--lotuswordpro/source/filter/lwpsortopt.cxx4
-rw-r--r--lotuswordpro/source/filter/xfilter/xfliststyle.cxx8
22 files changed, 98 insertions, 108 deletions
diff --git a/helpcompiler/source/HelpCompiler.cxx b/helpcompiler/source/HelpCompiler.cxx
index c25b69bc1933..91458e09e057 100644
--- a/helpcompiler/source/HelpCompiler.cxx
+++ b/helpcompiler/source/HelpCompiler.cxx
@@ -460,9 +460,9 @@ bool HelpCompiler::compile()
std::string title;
// returns a clone of the document with switch-cases resolved
std::string appl = module.substr(1);
- for (size_t i = 0; i < appl.length(); ++i)
+ for (char & i : appl)
{
- appl[i]=toupper(appl[i]);
+ i=toupper(i);
}
xmlNodePtr docResolved = clone(xmlDocGetRootElement(docResolvedOrg), appl);
myparser aparser(documentId, fileName, title);
diff --git a/helpcompiler/source/HelpLinker.cxx b/helpcompiler/source/HelpLinker.cxx
index 95821f172a4b..dcf195b77d86 100644
--- a/helpcompiler/source/HelpLinker.cxx
+++ b/helpcompiler/source/HelpLinker.cxx
@@ -210,9 +210,8 @@ namespace URLEncoder
static const char hex[17] = "0123456789ABCDEF";
std::string result;
- for (size_t i=0; i < rIn.length(); ++i)
+ for (char c : rIn)
{
- unsigned char c = rIn[i];
if (isalnum (c) || strchr (good, c))
result += c;
else {
@@ -242,21 +241,21 @@ void HelpLinker::addBookmark( FILE* pFile_DBHelp, std::string thishid,
std::vector<unsigned char> dataB(dataLen);
size_t i = 0;
dataB[i++] = static_cast<unsigned char>(fileLen);
- for (size_t j = 0; j < fileB.length(); ++j)
- dataB[i++] = static_cast<unsigned char>(fileB[j]);
+ for (char j : fileB)
+ dataB[i++] = static_cast<unsigned char>(j);
if (!anchorB.empty())
{
dataB[i++] = '#';
- for (size_t j = 0; j < anchorB.length(); ++j)
- dataB[i++] = anchorB[j];
+ for (char j : anchorB)
+ dataB[i++] = j;
}
dataB[i++] = static_cast<unsigned char>(jarfileB.length());
- for (size_t j = 0; j < jarfileB.length(); ++j)
- dataB[i++] = jarfileB[j];
+ for (char j : jarfileB)
+ dataB[i++] = j;
dataB[i++] = static_cast<unsigned char>(titleB.length());
- for (size_t j = 0; j < titleB.length(); ++j)
- dataB[i++] = titleB[j];
+ for (char j : titleB)
+ dataB[i++] = j;
if( pFile_DBHelp != nullptr )
{
diff --git a/hwpfilter/source/hinfo.cxx b/hwpfilter/source/hinfo.cxx
index 241ab2f80304..2e5d4b1c9a16 100644
--- a/hwpfilter/source/hinfo.cxx
+++ b/hwpfilter/source/hinfo.cxx
@@ -140,11 +140,11 @@ void HWPInfo::Read(HWPFile & hwpf)
hwpf.Read1b(&fnchar, 1);
hwpf.Read1b(&fnlinetype, 1);
// border layout
- for (int ii = 0; ii < 4; ++ii)
+ for (int & ii : bordermargin)
{
if (!hwpf.Read2b(tmp16))
return;
- bordermargin[ii] = tmp16;
+ ii = tmp16;
}
hwpf.Read2b(&borderline, 1);
@@ -217,13 +217,13 @@ void ParaShape::Read(HWPFile & hwpf)
hwpf.Read1b(&condense, 1);
hwpf.Read1b(&arrange_type, 1);
- for (int ii = 0; ii < MAXTABS; ii++)
+ for (TabSet & tab : tabs)
{
- hwpf.Read1b(&tabs[ii].type, 1);
- hwpf.Read1b(&tabs[ii].dot_continue, 1);
+ hwpf.Read1b(&tab.type, 1);
+ hwpf.Read1b(&tab.dot_continue, 1);
if (!hwpf.Read2b(tmp16))
return;
- tabs[ii].position = tmp16;
+ tab.position = tmp16;
}
hwpf.Read1b(&coldef.ncols, 1);
hwpf.Read1b(&coldef.separator, 1);
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index 7fa79cf62696..33ac5864a79c 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -39,8 +39,8 @@ BreakIteratorImpl::BreakIteratorImpl()
BreakIteratorImpl::~BreakIteratorImpl()
{
// Clear lookuptable
- for (size_t l = 0; l < lookupTable.size(); l++)
- delete lookupTable[l];
+ for (lookupTableItem* p : lookupTable)
+ delete p;
lookupTable.clear();
}
@@ -526,8 +526,7 @@ sal_Int16 BreakIteratorImpl::getScriptClass(sal_uInt32 currentChar)
bool SAL_CALL BreakIteratorImpl::createLocaleSpecificBreakIterator(const OUString& aLocaleName) throw( RuntimeException )
{
// to share service between same Language but different Country code, like zh_CN and zh_TW
- for (size_t l = 0; l < lookupTable.size(); l++) {
- lookupTableItem *listItem = lookupTable[l];
+ for (lookupTableItem* listItem : lookupTable) {
if (aLocaleName == listItem->aLocale.Language) {
xBI = listItem->xBI;
return true;
@@ -555,8 +554,7 @@ BreakIteratorImpl::getLocaleSpecificBreakIterator(const Locale& rLocale) throw (
else if (m_xContext.is()) {
aLocale = rLocale;
- for (size_t i = 0; i < lookupTable.size(); i++) {
- lookupTableItem *listItem = lookupTable[i];
+ for (lookupTableItem* listItem : lookupTable) {
if (rLocale == listItem->aLocale)
return xBI = listItem->xBI;
}
diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx
index f061d11001e5..8707dd452b83 100644
--- a/i18npool/source/breakiterator/breakiterator_unicode.cxx
+++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx
@@ -52,8 +52,8 @@ BreakIterator_Unicode::~BreakIterator_Unicode()
delete character.aBreakIterator;
delete sentence.aBreakIterator;
delete line.aBreakIterator;
- for (size_t i = 0; i < SAL_N_ELEMENTS(words); i++)
- delete words[i].aBreakIterator;
+ for (BI_Data & word : words)
+ delete word.aBreakIterator;
}
/*
diff --git a/i18npool/source/breakiterator/xdictionary.cxx b/i18npool/source/breakiterator/xdictionary.cxx
index 536b67e3edb8..551ce859592b 100644
--- a/i18npool/source/breakiterator/xdictionary.cxx
+++ b/i18npool/source/breakiterator/xdictionary.cxx
@@ -115,18 +115,18 @@ xdictionary::xdictionary(const sal_Char *lang) :
#endif
- for (sal_Int32 i = 0; i < CACHE_MAX; i++)
- cache[i].size = 0;
+ for (WordBreakCache & i : cache)
+ i.size = 0;
japaneseWordBreak = false;
}
xdictionary::~xdictionary()
{
- for (sal_Int32 i = 0; i < CACHE_MAX; i++) {
- if (cache[i].size > 0) {
- delete [] cache[i].contents;
- delete [] cache[i].wordboundary;
+ for (WordBreakCache & i : cache) {
+ if (i.size > 0) {
+ delete [] i.contents;
+ delete [] i.wordboundary;
}
}
}
@@ -147,11 +147,11 @@ void xdictionary::initDictionaryData(const sal_Char *pLang)
static std::vector< datacache > aLoadedCache;
osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() );
- for( size_t i = 0; i < aLoadedCache.size(); ++i )
+ for(datacache & i : aLoadedCache)
{
- if( !strcmp( pLang, aLoadedCache[ i ].maLang.getStr() ) )
+ if( !strcmp( pLang, i.maLang.getStr() ) )
{
- data = aLoadedCache[ i ].maData;
+ data = i.maData;
return;
}
}
diff --git a/i18npool/source/calendar/calendarImpl.cxx b/i18npool/source/calendar/calendarImpl.cxx
index 67a82dbb7795..48c4ad2d02a3 100644
--- a/i18npool/source/calendar/calendarImpl.cxx
+++ b/i18npool/source/calendar/calendarImpl.cxx
@@ -36,8 +36,8 @@ CalendarImpl::CalendarImpl(const Reference< XComponentContext > &rxContext) : m_
CalendarImpl::~CalendarImpl()
{
// Clear lookuptable
- for (size_t l = 0; l < lookupTable.size(); l++)
- delete lookupTable[l];
+ for (lookupTableItem* p : lookupTable)
+ delete p;
lookupTable.clear();
}
diff --git a/i18npool/source/characterclassification/characterclassificationImpl.cxx b/i18npool/source/characterclassification/characterclassificationImpl.cxx
index be40da7fb53f..41aa591bb148 100644
--- a/i18npool/source/characterclassification/characterclassificationImpl.cxx
+++ b/i18npool/source/characterclassification/characterclassificationImpl.cxx
@@ -36,8 +36,8 @@ CharacterClassificationImpl::CharacterClassificationImpl(
CharacterClassificationImpl::~CharacterClassificationImpl() {
// Clear lookuptable
- for (size_t l = 0; l < lookupTable.size(); l++)
- delete lookupTable[l];
+ for (lookupTableItem* p : lookupTable)
+ delete p;
lookupTable.clear();
}
@@ -160,8 +160,8 @@ CharacterClassificationImpl::getLocaleSpecificCharacterClassification(const Loca
if (cachedItem && cachedItem->equals(rLocale))
return cachedItem->xCI;
else {
- for (size_t i = 0; i < lookupTable.size(); i++) {
- cachedItem = lookupTable[i];
+ for (lookupTableItem* i : lookupTable) {
+ cachedItem = i;
if (cachedItem->equals(rLocale))
return cachedItem->xCI;
}
diff --git a/i18npool/source/collator/collatorImpl.cxx b/i18npool/source/collator/collatorImpl.cxx
index 874e3469f1f0..8b4919a68400 100644
--- a/i18npool/source/collator/collatorImpl.cxx
+++ b/i18npool/source/collator/collatorImpl.cxx
@@ -40,8 +40,8 @@ CollatorImpl::CollatorImpl( const Reference < XComponentContext >& rxContext ) :
CollatorImpl::~CollatorImpl()
{
// Clear lookuptable
- for (size_t l = 0; l < lookupTable.size(); l++)
- delete lookupTable[l];
+ for (lookupTableItem* p : lookupTable)
+ delete p;
lookupTable.clear();
}
@@ -170,8 +170,8 @@ void SAL_CALL
CollatorImpl::loadCachedCollator(const lang::Locale& rLocale, const OUString& rSortAlgorithm)
throw(RuntimeException)
{
- for (size_t i = 0; i < lookupTable.size(); i++) {
- cachedItem = lookupTable[i];
+ for (lookupTableItem* i : lookupTable) {
+ cachedItem = i;
if (cachedItem->equals(rLocale, rSortAlgorithm)) {
return;
}
diff --git a/i18npool/source/inputchecker/inputsequencechecker.cxx b/i18npool/source/inputchecker/inputsequencechecker.cxx
index b1e71c125910..69c8525985af 100644
--- a/i18npool/source/inputchecker/inputsequencechecker.cxx
+++ b/i18npool/source/inputchecker/inputsequencechecker.cxx
@@ -43,8 +43,8 @@ InputSequenceCheckerImpl::InputSequenceCheckerImpl(const char *pServiceName)
InputSequenceCheckerImpl::~InputSequenceCheckerImpl()
{
// Clear lookuptable
- for (size_t l = 0; l < lookupTable.size(); l++)
- delete lookupTable[l];
+ for (lookupTableItem* p : lookupTable)
+ delete p;
lookupTable.clear();
}
@@ -111,8 +111,8 @@ InputSequenceCheckerImpl::getInputSequenceChecker(sal_Char* rLanguage) throw (Ru
return cachedItem->xISC;
}
else {
- for (size_t l = 0; l < lookupTable.size(); l++) {
- cachedItem = lookupTable[l];
+ for (lookupTableItem* l : lookupTable) {
+ cachedItem = l;
if (cachedItem->aLanguage == rLanguage)
return cachedItem->xISC;
}
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx
index d8f5ed09371a..bfb59aac8864 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -484,26 +484,25 @@ oslGenericFunction SAL_CALL lcl_LookupTableHelper::getFunctionSymbolByName(
aFallback = LocaleDataImpl::getFirstLocaleServiceName( aFbLocale);
}
- for ( sal_Int16 i = 0; i < nbOfLocales; i++)
+ for (const auto & i : aLibTable)
{
- if (localeName.equalsAscii(aLibTable[i].pLocale) ||
- (bFallback && aFallback.equalsAscii(aLibTable[i].pLocale)))
+ if (localeName.equalsAscii(i.pLocale) ||
+ (bFallback && aFallback.equalsAscii(i.pLocale)))
{
#ifndef DISABLE_DYNLOADING
OUStringBuffer aBuf(sal::static_int_cast<int>(
- strlen(aLibTable[i].pLocale) + 1 + strlen(pFunction)));
+ strlen(i.pLocale) + 1 + strlen(pFunction)));
{
::osl::MutexGuard aGuard( maMutex );
- for (size_t l = 0; l < maLookupTable.size(); l++)
+ for (LocaleDataLookupTableItem* pCurrent : maLookupTable)
{
- LocaleDataLookupTableItem* pCurrent = maLookupTable[l];
- if (pCurrent->dllName == aLibTable[i].pLib)
+ if (pCurrent->dllName == i.pLib)
{
OSL_ASSERT( pOutCachedItem );
if( pOutCachedItem )
{
(*pOutCachedItem) = new LocaleDataLookupTableItem( *pCurrent );
- (*pOutCachedItem)->localeName = aLibTable[i].pLocale;
+ (*pOutCachedItem)->localeName = i.pLocale;
return (*pOutCachedItem)->module->getFunctionSymbol(
aBuf.appendAscii( pFunction).append( cUnder).
appendAscii( (*pOutCachedItem)->localeName).makeStringAndClear());
@@ -515,17 +514,17 @@ oslGenericFunction SAL_CALL lcl_LookupTableHelper::getFunctionSymbolByName(
}
// Library not loaded, load it and add it to the list.
#ifdef SAL_DLLPREFIX
- aBuf.ensureCapacity(strlen(aLibTable[i].pLib) + 6); // mostly "lib*.so"
- aBuf.append( SAL_DLLPREFIX ).appendAscii(aLibTable[i].pLib).append( SAL_DLLEXTENSION );
+ aBuf.ensureCapacity(strlen(i.pLib) + 6); // mostly "lib*.so"
+ aBuf.append( SAL_DLLPREFIX ).appendAscii(i.pLib).append( SAL_DLLEXTENSION );
#else
- aBuf.ensureCapacity(strlen(aLibTable[i].pLib) + 4); // mostly "*.dll"
- aBuf.appendAscii(aLibTable[i].pLib).appendAscii( SAL_DLLEXTENSION );
+ aBuf.ensureCapacity(strlen(i.pLib) + 4); // mostly "*.dll"
+ aBuf.appendAscii(i.pLib).appendAscii( SAL_DLLEXTENSION );
#endif
osl::Module *module = new osl::Module();
if ( module->loadRelative(&thisModule, aBuf.makeStringAndClear()) )
{
::osl::MutexGuard aGuard( maMutex );
- LocaleDataLookupTableItem* pNewItem = new LocaleDataLookupTableItem(aLibTable[i].pLib, module, aLibTable[i].pLocale);
+ LocaleDataLookupTableItem* pNewItem = new LocaleDataLookupTableItem(i.pLib, module, i.pLocale);
maLookupTable.push_back(pNewItem);
OSL_ASSERT( pOutCachedItem );
if( pOutCachedItem )
@@ -844,15 +843,15 @@ LocaleDataImpl::getAllFormats( const Locale& rLocale ) throw(RuntimeException, s
Sequence< FormatElement > seq(formatCount);
sal_Int32 f = 0;
- for (int s = 0; s < SECTIONS; ++s)
+ for (FormatSection & s : section)
{
- sal_Unicode const * const * const formatArray = section[s].formatArray;
+ sal_Unicode const * const * const formatArray = s.formatArray;
if ( formatArray )
{
- for (int i = 0, nOff = 0; i < section[s].formatCount; ++i, nOff += 7, ++f)
+ for (int i = 0, nOff = 0; i < s.formatCount; ++i, nOff += 7, ++f)
{
FormatElement elem(
- OUString(formatArray[nOff]).replaceAll(section[s].from, section[s].to),
+ OUString(formatArray[nOff]).replaceAll(s.from, s.to),
formatArray[nOff + 1],
formatArray[nOff + 2],
formatArray[nOff + 3],
@@ -1468,8 +1467,8 @@ LocaleDataImpl::getAllInstalledLocaleNames() throw(RuntimeException, std::except
Sequence< lang::Locale > seq( nbOfLocales );
sal_Int16 nInstalled = 0;
- for( sal_Int16 i=0; i<nbOfLocales; i++ ) {
- OUString name = OUString::createFromAscii( aLibTable[i].pLocale );
+ for(const auto & i : aLibTable) {
+ OUString name = OUString::createFromAscii( i.pLocale );
// Check if the locale is really available and not just in the table,
// don't allow fall backs.
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 2d7b254acf4a..6aa76d67612d 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -615,9 +615,9 @@ OUString SAL_CALL NativeNumberSupplierService::getNativeNumberString(const OUStr
sal_Unicode SAL_CALL NativeNumberSupplierService::getNativeNumberChar( const sal_Unicode inChar, const Locale& rLocale, sal_Int16 nNativeNumberMode ) throw(css::uno::RuntimeException)
{
if (nNativeNumberMode == NativeNumberMode::NATNUM0) { // Ascii
- for (sal_Int16 i = 0; i < NumberChar_Count; i++)
+ for (const auto & i : NumberChar)
for (sal_Int16 j = 0; j < 10; j++)
- if (inChar == NumberChar[i][j])
+ if (inChar == i[j])
return j;
return inChar;
}
diff --git a/i18nutil/source/utility/oneToOneMapping.cxx b/i18nutil/source/utility/oneToOneMapping.cxx
index 10d4a0af9406..bef181b7b67e 100644
--- a/i18nutil/source/utility/oneToOneMapping.cxx
+++ b/i18nutil/source/utility/oneToOneMapping.cxx
@@ -69,8 +69,8 @@ oneToOneMappingWithFlag::~oneToOneMappingWithFlag()
{
if( mbHasIndex )
{
- for (size_t i = 0; i < SAL_N_ELEMENTS(mpIndex); ++i)
- delete [] mpIndex[i];
+ for (UnicodePairWithFlag** i : mpIndex)
+ delete [] i;
}
}
@@ -80,8 +80,8 @@ void oneToOneMappingWithFlag::makeIndex()
{
int current = -1;
- for (size_t i = 0; i < SAL_N_ELEMENTS(mpIndex); ++i)
- mpIndex[i] = nullptr;
+ for (UnicodePairWithFlag**& i : mpIndex)
+ i = nullptr;
for( size_t k = 0; k < mnSize; k++ )
{
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index 2df71c08f171..80e424d8cefc 100644
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -470,9 +470,9 @@ sal_uLong DictionaryNeo::saveEntries(const OUString &rURL)
pStream->WriteLine(OString("---"));
if (0 != (nErr = pStream->GetError()))
return nErr;
- for (size_t i = 0; i < aEntries.size(); i++)
+ for (Reference<XDictionaryEntry> & aEntrie : aEntries)
{
- OString aOutStr = formatForSave(aEntries[i], eEnc);
+ OString aOutStr = formatForSave(aEntrie, eEnc);
pStream->WriteLine (aOutStr);
if (0 != (nErr = pStream->GetError()))
break;
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index 0bf680bd9501..bba17f95bf55 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -626,10 +626,10 @@ void DicList::CreateDicList()
// look for dictionaries
const OUString aWriteablePath( GetDictionaryWriteablePath() );
std::vector< OUString > aPaths( GetDictionaryPaths() );
- for (size_t i = 0; i < aPaths.size(); ++i)
+ for (OUString & aPath : aPaths)
{
- const bool bIsWriteablePath = (aPaths[i] == aWriteablePath);
- SearchForDictionaries( aDicList, aPaths[i], bIsWriteablePath );
+ const bool bIsWriteablePath = (aPath == aWriteablePath);
+ SearchForDictionaries( aDicList, aPath, bIsWriteablePath );
}
// create IgnoreAllList dictionary with empty URL (non persistent)
diff --git a/linguistic/source/iprcache.cxx b/linguistic/source/iprcache.cxx
index e5b38c0eb183..fbcbb446b25d 100644
--- a/linguistic/source/iprcache.cxx
+++ b/linguistic/source/iprcache.cxx
@@ -63,10 +63,10 @@ static void lcl_AddAsPropertyChangeListener(
{
if (xListener.is() && rPropSet.is())
{
- for (int i = 0; i < NUM_FLUSH_PROPS; ++i)
+ for (auto& aFlushPropertie : aFlushProperties)
{
rPropSet->addPropertyChangeListener(
- OUString::createFromAscii(aFlushProperties[i].pPropName), xListener );
+ OUString::createFromAscii(aFlushPropertie.pPropName), xListener );
}
}
}
@@ -78,10 +78,10 @@ static void lcl_RemoveAsPropertyChangeListener(
{
if (xListener.is() && rPropSet.is())
{
- for (int i = 0; i < NUM_FLUSH_PROPS; ++i)
+ for (auto& aFlushPropertie : aFlushProperties)
{
rPropSet->removePropertyChangeListener(
- OUString::createFromAscii(aFlushProperties[i].pPropName), xListener );
+ OUString::createFromAscii(aFlushPropertie.pPropName), xListener );
}
}
}
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index 4cb427d805be..1edcdf1ec48e 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -680,16 +680,14 @@ static const sal_uInt32 the_aDigitZeroes [] =
bool HasDigits( const OUString &rText )
{
- static const int nNumDigitZeroes = SAL_N_ELEMENTS(the_aDigitZeroes);
const sal_Int32 nLen = rText.getLength();
sal_Int32 i = 0;
while (i < nLen) // for all characters ...
{
const sal_uInt32 nCodePoint = rText.iterateCodePoints( &i ); // handle unicode surrogates correctly...
- for (int j = 0; j < nNumDigitZeroes; ++j) // ... check in all 0..9 ranges
+ for (unsigned int nDigitZero : the_aDigitZeroes) // ... check in all 0..9 ranges
{
- sal_uInt32 nDigitZero = the_aDigitZeroes[ j ];
if (nDigitZero > nCodePoint)
break;
if (/*nDigitZero <= nCodePoint &&*/ nCodePoint <= nDigitZero + 9)
diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 82e1fc5f9842..cab4dd260125 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -835,10 +835,10 @@ void LwpDrawEllipse::Read()
{
ReadClosedObjStyle();
- for (sal_uInt8 nC = 0; nC < 13; nC++)
+ for (SdwPoint & nC : m_aVector)
{
- m_pStream->ReadInt16( m_aVector[nC].x );
- m_pStream->ReadInt16( m_aVector[nC].y );
+ m_pStream->ReadInt16( nC.x );
+ m_pStream->ReadInt16( nC.y );
}
}
@@ -914,10 +914,10 @@ void LwpDrawArc::Read()
m_pStream->ReadUChar( m_aArcRec.aPenColor.unused );
m_pStream->ReadUChar( m_aArcRec.nLineEnd );
- for (sal_uInt8 nC = 0; nC < 4; nC++)
+ for (SdwPoint & nC : m_aVector)
{
- m_pStream->ReadInt16( m_aVector[nC].x );
- m_pStream->ReadInt16( m_aVector[nC].y );
+ m_pStream->ReadInt16( nC.x );
+ m_pStream->ReadInt16( nC.y );
}
}
@@ -1194,10 +1194,10 @@ void LwpDrawTextArt::CreateFWPath(XFDrawPath* pPath)
void LwpDrawTextArt::Read()
{
- for (sal_uInt8 nC = 0; nC < 4; nC++)
+ for (SdwPoint & nC : m_aVector)
{
- m_pStream->ReadInt16( m_aVector[nC].x );
- m_pStream->ReadInt16( m_aVector[nC].y );
+ m_pStream->ReadInt16( nC.x );
+ m_pStream->ReadInt16( nC.y );
}
ReadClosedObjStyle();
diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx
index c70153c02991..3e80d8a6fd0a 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -826,11 +826,11 @@ XFBorders* LwpMiddleLayout::GetXFBorders()
LwpBorderStuff::BorderType pType[] = { LwpBorderStuff::LEFT, LwpBorderStuff::RIGHT,
LwpBorderStuff::TOP, LwpBorderStuff::BOTTOM };
- for (sal_uInt8 nC = 0; nC < 4; nC++)
+ for (LwpBorderStuff::BorderType & nC : pType)
{
- if (pBorderStuff->HasSide(pType[nC]))
+ if (pBorderStuff->HasSide(nC))
{
- LwpParaStyle::ApplySubBorder(pBorderStuff, pType[nC], pXFBorders);
+ LwpParaStyle::ApplySubBorder(pBorderStuff, nC, pXFBorders);
}
}
return pXFBorders;
diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx b/lotuswordpro/source/filter/lwprowlayout.cxx
index 906c09cdb052..a936f0e1e251 100644
--- a/lotuswordpro/source/filter/lwprowlayout.cxx
+++ b/lotuswordpro/source/filter/lwprowlayout.cxx
@@ -445,10 +445,8 @@ void LwpRowLayout::CollectMergeInfo()
*/
void LwpRowLayout::SetCellSplit(sal_uInt16 nEffectRows)
{
- LwpConnectedCellLayout* pConnCell;
- for (size_t i=0; i<m_ConnCellList.size(); i++)
+ for (LwpConnectedCellLayout* pConnCell : m_ConnCellList)
{
- pConnCell = m_ConnCellList[i];
sal_uInt16 nRowSpan = pConnCell->GetRowID()+pConnCell->GetNumrows();
if ( nRowSpan > nEffectRows )
{
diff --git a/lotuswordpro/source/filter/lwpsortopt.cxx b/lotuswordpro/source/filter/lwpsortopt.cxx
index 886bac534ebe..e740ec95cae2 100644
--- a/lotuswordpro/source/filter/lwpsortopt.cxx
+++ b/lotuswordpro/source/filter/lwpsortopt.cxx
@@ -79,9 +79,9 @@ void LwpSortOption::Read(LwpObjectStream *pStrm)
m_nCount = pStrm->QuickReaduInt16();
m_nFlags = pStrm->QuickReaduInt16();
m_nText = pStrm->QuickReaduInt8();
- for(sal_uInt8 i=0; i<3; i++)
+ for(LwpSortKey & key : m_Keys)
{
- m_Keys[i].Read(pStrm);
+ key.Read(pStrm);
}
pStrm->SkipExtra();
}
diff --git a/lotuswordpro/source/filter/xfilter/xfliststyle.cxx b/lotuswordpro/source/filter/xfilter/xfliststyle.cxx
index 7f7e868247f7..b989875221be 100644
--- a/lotuswordpro/source/filter/xfilter/xfliststyle.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfliststyle.cxx
@@ -209,10 +209,9 @@ XFListStyle& XFListStyle::operator=(const XFListStyle& other)
XFListStyle::~XFListStyle()
{
- for( int i=0; i<10; i++ )
+ for(XFListLevel* p : m_pListLevels)
{
- if( m_pListLevels[i] )
- delete m_pListLevels[i];
+ delete p;
}
}
@@ -318,9 +317,8 @@ void XFListStyle::ToXml(IXFStream *pStrm)
pAttrList->AddAttribute("style:parent-style-name",GetParentStyleName());
pStrm->StartElement( "text:list-style" );
- for( int i=0; i<10; i++ )
+ for(XFListLevel* pLevel : m_pListLevels)
{
- XFListLevel *pLevel = m_pListLevels[i];
if( pLevel )
pLevel->ToXml(pStrm);
}