summaryrefslogtreecommitdiff
path: root/src/textfile_gui.cpp
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2018-09-23 12:23:54 +0100
committerPeterN <peter@fuzzle.org>2019-03-26 20:15:57 +0000
commita690936ed75e96627be0e2ecafee2360a71e8d3c (patch)
tree1221c131b8fe3a51cf43a6bd7d89a51c431c559d /src/textfile_gui.cpp
parent56ae855dc20b27593c9a454d5a09d8f892a6c71f (diff)
downloadopenttd-a690936ed75e96627be0e2ecafee2360a71e8d3c.tar.xz
Codechange: Replace SmallVector::Length() with std::vector::size()
Diffstat (limited to 'src/textfile_gui.cpp')
-rw-r--r--src/textfile_gui.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp
index 018888d0b..e9706c752 100644
--- a/src/textfile_gui.cpp
+++ b/src/textfile_gui.cpp
@@ -86,7 +86,7 @@ uint TextfileWindow::GetContentHeight()
int max_width = this->GetWidget<NWidgetCore>(WID_TF_BACKGROUND)->current_x - WD_FRAMETEXT_LEFT - WD_FRAMERECT_RIGHT;
uint height = 0;
- for (uint i = 0; i < this->lines.Length(); i++) {
+ for (uint i = 0; i < this->lines.size(); i++) {
height += GetStringHeight(this->lines[i], max_width, FS_MONO);
}
@@ -113,10 +113,10 @@ void TextfileWindow::SetupScrollbars()
this->hscroll->SetCount(0);
} else {
uint max_length = 0;
- for (uint i = 0; i < this->lines.Length(); i++) {
+ for (uint i = 0; i < this->lines.size(); i++) {
max_length = max(max_length, GetStringBoundingBox(this->lines[i], FS_MONO).width);
}
- this->vscroll->SetCount(this->lines.Length() * FONT_HEIGHT_MONO);
+ this->vscroll->SetCount(this->lines.size() * FONT_HEIGHT_MONO);
this->hscroll->SetCount(max_length + WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT);
}
@@ -152,7 +152,7 @@ void TextfileWindow::SetupScrollbars()
int line_height = FONT_HEIGHT_MONO;
int y_offset = -this->vscroll->GetPosition();
- for (uint i = 0; i < this->lines.Length(); i++) {
+ for (uint i = 0; i < this->lines.size(); i++) {
if (IsWidgetLowered(WID_TF_WRAPTEXT)) {
y_offset = DrawStringMultiLine(0, right - x, y_offset, bottom - y, this->lines[i], TC_WHITE, SA_TOP | SA_LEFT, false, FS_MONO);
} else {
@@ -184,7 +184,7 @@ void TextfileWindow::SetupScrollbars()
/* virtual */ const char *TextfileWindow::NextString()
{
- if (this->search_iterator >= this->lines.Length()) return NULL;
+ if (this->search_iterator >= this->lines.size()) return NULL;
return this->lines[this->search_iterator++];
}