summaryrefslogtreecommitdiff
path: root/src/gfx_layout.cpp
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-02-18 22:39:06 +0000
committerPeterN <peter@fuzzle.org>2019-03-26 20:15:57 +0000
commita0f36a50e6324f570985f5010eb0543ec0673aeb (patch)
tree09f9c9abd097acc244f80366da42cb8702c7ed19 /src/gfx_layout.cpp
parentca2f33c6d025c0c45fb4bc472493290445312de5 (diff)
downloadopenttd-a0f36a50e6324f570985f5010eb0543ec0673aeb.tar.xz
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
Diffstat (limited to 'src/gfx_layout.cpp')
-rw-r--r--src/gfx_layout.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp
index 786e07408..ee0ba1533 100644
--- a/src/gfx_layout.cpp
+++ b/src/gfx_layout.cpp
@@ -150,7 +150,7 @@ public:
ICULine(icu::ParagraphLayout::Line *l) : l(l)
{
for (int i = 0; i < l->countRuns(); i++) {
- *this->Append() = new ICUVisualRun(l->getVisualRun(i));
+ this->push_back(new ICUVisualRun(l->getVisualRun(i)));
}
}
~ICULine() { delete l; }
@@ -498,7 +498,7 @@ const ParagraphLayouter::Line *FallbackParagraphLayout::NextLine(int max_width)
if (*this->buffer == '\0') {
/* Only a newline. */
this->buffer = NULL;
- *l->Append() = new FallbackVisualRun(this->runs.Begin()->second, this->buffer, 0, 0);
+ l->push_back(new FallbackVisualRun(this->runs.Begin()->second, this->buffer, 0, 0));
return l;
}
@@ -527,7 +527,7 @@ const ParagraphLayouter::Line *FallbackParagraphLayout::NextLine(int max_width)
if (this->buffer == next_run) {
int w = l->GetWidth();
- *l->Append() = new FallbackVisualRun(iter->second, begin, this->buffer - begin, w);
+ l->push_back(new FallbackVisualRun(iter->second, begin, this->buffer - begin, w));
iter++;
assert(iter != this->runs.End());
@@ -574,7 +574,7 @@ const ParagraphLayouter::Line *FallbackParagraphLayout::NextLine(int max_width)
if (l->size() == 0 || last_char - begin != 0) {
int w = l->GetWidth();
- *l->Append() = new FallbackVisualRun(iter->second, begin, last_char - begin, w);
+ l->push_back(new FallbackVisualRun(iter->second, begin, last_char - begin, w));
}
return l;
}
@@ -720,7 +720,7 @@ Layouter::Layouter(const char *str, int maxw, TextColour colour, FontSize fontsi
/* Copy all lines into a local cache so we can reuse them later on more easily. */
const ParagraphLayouter::Line *l;
while ((l = line.layout->NextLine(maxw)) != NULL) {
- *this->Append() = l;
+ this->push_back(l);
}
} while (c != '\0');
@@ -834,7 +834,7 @@ Font *Layouter::GetFont(FontSize size, TextColour colour)
if (it != fonts[size].End()) return it->second;
Font *f = new Font(size, colour);
- *fonts[size].Append() = FontColourMap::Pair(colour, f);
+ fonts[size].emplace_back(colour, f);
return f;
}