summaryrefslogtreecommitdiff
path: root/helpcompiler/source
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 /helpcompiler/source
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>
Diffstat (limited to 'helpcompiler/source')
-rw-r--r--helpcompiler/source/HelpCompiler.cxx4
-rw-r--r--helpcompiler/source/HelpLinker.cxx19
2 files changed, 11 insertions, 12 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 )
{