summaryrefslogtreecommitdiff
path: root/src/gui/widgets/layout.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/layout.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/layout.cpp')
-rw-r--r--src/gui/widgets/layout.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/gui/widgets/layout.cpp b/src/gui/widgets/layout.cpp
index ac8488e0..3659baa1 100644
--- a/src/gui/widgets/layout.cpp
+++ b/src/gui/widgets/layout.cpp
@@ -71,15 +71,12 @@ void LayoutCell::computeSizes()
{
assert(mType == ARRAY);
- for (auto
- i = mArray->mCells.begin(), i_end = mArray->mCells.end();
- i != i_end; ++i)
+ for (auto &row : mArray->mCells)
{
- for (auto
- j = i->begin(), j_end = i->end(); j != j_end; ++j)
+ for (auto cell : row)
{
- LayoutCell *cell = *j;
- if (cell && cell->mType == ARRAY) cell->computeSizes();
+ if (cell && cell->mType == ARRAY)
+ cell->computeSizes();
}
}
@@ -93,13 +90,11 @@ LayoutArray::LayoutArray(): mSpacing(4)
LayoutArray::~LayoutArray()
{
- for (auto
- i = mCells.begin(), i_end = mCells.end(); i != i_end; ++i)
+ for (auto &row : mCells)
{
- for (auto
- j = i->begin(), j_end = i->end(); j != j_end; ++j)
+ for (auto &cell : row)
{
- delete *j;
+ delete cell;
}
}
}
@@ -133,10 +128,9 @@ void LayoutArray::resizeGrid(int w, int h)
mSizes[0].resize(w, Layout::AUTO_DEF);
}
- for (auto
- i = mCells.begin(), i_end = mCells.end(); i != i_end; ++i)
+ for (auto &row : mCells)
{
- i->resize(w, nullptr);
+ row.resize(w, nullptr);
}
}