summaryrefslogtreecommitdiff
path: root/src/os/windows
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-02-17 11:20:52 +0000
committerPeterN <peter@fuzzle.org>2019-03-26 20:15:57 +0000
commitab711e6942757d775c08c31a6c32d488feba1dba (patch)
treed102dc6d0e6b9c33e7205b63e3360ebd720a3ebb /src/os/windows
parent297fd3dda3abe353ebe2fe77c67b011e24d403bc (diff)
downloadopenttd-ab711e6942757d775c08c31a6c32d488feba1dba.tar.xz
Codechange: Replaced SmallVector::[Begin|End]() with std alternatives
Diffstat (limited to 'src/os/windows')
-rw-r--r--src/os/windows/string_uniscribe.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/os/windows/string_uniscribe.cpp b/src/os/windows/string_uniscribe.cpp
index ec0e02639..a3fd35d0a 100644
--- a/src/os/windows/string_uniscribe.cpp
+++ b/src/os/windows/string_uniscribe.cpp
@@ -282,8 +282,8 @@ static std::vector<SCRIPT_ITEM> UniscribeItemizeString(UniscribeParagraphLayoutF
if (length == 0) return NULL;
/* Can't layout our in-built sprite fonts. */
- for (FontMap::const_iterator i = fontMapping.Begin(); i != fontMapping.End(); i++) {
- if (i->second->fc->IsBuiltInFont()) return NULL;
+ for (auto const &pair : fontMapping) {
+ if (pair.second->fc->IsBuiltInFont()) return NULL;
}
/* Itemize text. */
@@ -296,12 +296,12 @@ static std::vector<SCRIPT_ITEM> UniscribeItemizeString(UniscribeParagraphLayoutF
int cur_pos = 0;
std::vector<SCRIPT_ITEM>::iterator cur_item = items.begin();
- for (FontMap::const_iterator i = fontMapping.Begin(); i != fontMapping.End(); i++) {
- while (cur_pos < i->first && cur_item != items.end() - 1) {
+ for (auto const &i : fontMapping) {
+ while (cur_pos < i.first && cur_item != items.end() - 1) {
/* Add a range that spans the intersection of the remaining item and font run. */
- int stop_pos = min(i->first, (cur_item + 1)->iCharPos);
+ int stop_pos = min(i.first, (cur_item + 1)->iCharPos);
assert(stop_pos - cur_pos > 0);
- ranges.push_back(UniscribeRun(cur_pos, stop_pos - cur_pos, i->second, cur_item->a));
+ ranges.push_back(UniscribeRun(cur_pos, stop_pos - cur_pos, i.second, cur_item->a));
/* Shape the range. */
if (!UniscribeShapeRun(buff, ranges.back())) {
@@ -448,8 +448,8 @@ static std::vector<SCRIPT_ITEM> UniscribeItemizeString(UniscribeParagraphLayoutF
int UniscribeParagraphLayout::UniscribeLine::GetLeading() const
{
int leading = 0;
- for (const UniscribeVisualRun * const *run = this->Begin(); run != this->End(); run++) {
- leading = max(leading, (*run)->GetLeading());
+ for (const UniscribeVisualRun *run : *this) {
+ leading = max(leading, run->GetLeading());
}
return leading;
@@ -462,8 +462,8 @@ int UniscribeParagraphLayout::UniscribeLine::GetLeading() const
int UniscribeParagraphLayout::UniscribeLine::GetWidth() const
{
int length = 0;
- for (const UniscribeVisualRun * const *run = this->Begin(); run != this->End(); run++) {
- length += (*run)->GetAdvance();
+ for (const UniscribeVisualRun *run : *this) {
+ length += run->GetAdvance();
}
return length;