summaryrefslogtreecommitdiff
path: root/src/gui/widgets/browserbox.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:21:43 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-29 14:18:06 +0100
commite7c285e3423ddd660447f6a6fc6bbae25f99f386 (patch)
tree1d700f09a5e96a2a0d390af30581097bdec0bf77 /src/gui/widgets/browserbox.cpp
parente1a7c1d0ca30c2c4a293ffbff6b9c51c881d23e3 (diff)
downloadmana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.tar.gz
mana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.tar.bz2
mana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.tar.xz
mana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.zip
Apply C++11 fixits
modernize-loop-convert modernize-deprecated-headers
Diffstat (limited to 'src/gui/widgets/browserbox.cpp')
-rw-r--r--src/gui/widgets/browserbox.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index d5b853b2..2fe3b5b1 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -185,9 +185,8 @@ void BrowserBox::addRow(const std::string &row)
int tildeWidth = font->getWidth(tilde);
int x = 0;
- for (auto i = mTextRows.begin(); i != mTextRows.end(); i++)
+ for (auto row : mTextRows)
{
- std::string row = *i;
for (unsigned int j = 0; j < row.size(); ++j)
{
std::string character = row.substr(j, 1);
@@ -316,11 +315,8 @@ void BrowserBox::draw(gcn::Graphics *graphics)
}
}
- for (auto i = mLineParts.begin();
- i != mLineParts.end();
- i ++)
+ for (auto &part : mLineParts)
{
- const LinePart &part = *i;
if (part.getY() + 50 < mYStart)
continue;
if (part.getY() > yEnd)
@@ -385,9 +381,8 @@ int BrowserBox::calcHeight()
mLineParts.clear();
- for (auto i = mTextRows.begin(); i != mTextRows.end(); i++)
+ for (auto row : mTextRows)
{
- const std::string row = *(i);
bool wrapped = false;
x = 0;