diff --git a/src/widgets/container.cpp b/src/widgets/container.cpp index d97991f..9b5e9b5 100644 --- a/src/widgets/container.cpp +++ b/src/widgets/container.cpp @@ -167,26 +167,25 @@ namespace gcn graphics->pushClipArea(getChildrenArea()); std::list children = getChildren(); - std::list::iterator iter; - for (iter = children.begin(); iter != children.end(); ++iter) + for (const auto& iter : children) { - if ((*iter)->isVisible()) + if (iter->isVisible()) { // If the widget has a frame, // draw it before drawing the widget - if ((*iter)->getFrameSize() > 0) + if (iter->getFrameSize() > 0) { - Rectangle rec = (*iter)->getDimension(); - rec.x -= (*iter)->getFrameSize(); - rec.y -= (*iter)->getFrameSize(); - rec.width += 2 * (*iter)->getFrameSize(); - rec.height += 2 * (*iter)->getFrameSize(); + Rectangle rec = iter->getDimension(); + rec.x -= static_cast(iter->getFrameSize()); + rec.y -= static_cast(iter->getFrameSize()); + rec.width += static_cast(2 * iter->getFrameSize()); + rec.height += static_cast(2 * iter->getFrameSize()); graphics->pushClipArea(rec); - (*iter)->drawFrame(graphics); + iter->drawFrame(graphics); graphics->popClipArea(); } - graphics->pushClipArea((*iter)->getDimension()); - (*iter)->draw(graphics); + graphics->pushClipArea(iter->getDimension()); + iter->draw(graphics); graphics->popClipArea(); } }