From e7c285e3423ddd660447f6a6fc6bbae25f99f386 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Fri, 26 Jan 2024 16:21:43 +0100 Subject: Apply C++11 fixits modernize-loop-convert modernize-deprecated-headers --- src/gui/widgets/browserbox.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/gui/widgets/browserbox.cpp') 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; -- cgit v1.2.3-70-g09d2