summaryrefslogtreecommitdiff
path: root/src/guichan/basiccontainer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-23 02:46:01 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-23 02:48:43 +0300
commita69a87c5a81ddbf25a25c5549259da550d207bda (patch)
tree59f1a919b327912395ab84bab1684118bf0379be /src/guichan/basiccontainer.cpp
parente646f2fae3f323b7faa26aa9540524d1765211ee (diff)
downloadmv-a69a87c5a81ddbf25a25c5549259da550d207bda.tar.gz
mv-a69a87c5a81ddbf25a25c5549259da550d207bda.tar.bz2
mv-a69a87c5a81ddbf25a25c5549259da550d207bda.tar.xz
mv-a69a87c5a81ddbf25a25c5549259da550d207bda.zip
Improve a bit iterators again.
Diffstat (limited to 'src/guichan/basiccontainer.cpp')
-rw-r--r--src/guichan/basiccontainer.cpp39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/guichan/basiccontainer.cpp b/src/guichan/basiccontainer.cpp
index 76b671cfb..c74748622 100644
--- a/src/guichan/basiccontainer.cpp
+++ b/src/guichan/basiccontainer.cpp
@@ -66,8 +66,8 @@ namespace gcn
void BasicContainer::moveToTop(Widget* widget)
{
- WidgetListIterator iter;
- for (iter = mWidgets.begin(); iter != mWidgets.end(); ++ iter)
+ for (WidgetListIterator iter = mWidgets.begin();
+ iter != mWidgets.end(); ++ iter)
{
if (*iter == widget)
{
@@ -179,8 +179,8 @@ namespace gcn
x -= r.x;
y -= r.y;
- WidgetListCReverseIterator it;
- for (it = mWidgets.rbegin(); it != mWidgets.rend(); ++ it)
+ for (WidgetListCReverseIterator it = mWidgets.rbegin();
+ it != mWidgets.rend(); ++ it)
{
if ((*it)->isVisible() && (*it)->getDimension()
.isPointInRect(x, y))
@@ -204,8 +204,8 @@ namespace gcn
if (mInternalFocusHandler)
return;
- WidgetListConstIterator iter;
- for (iter = mWidgets.begin(); iter != mWidgets.end(); ++ iter)
+ for (WidgetListConstIterator iter = mWidgets.begin();
+ iter != mWidgets.end(); ++ iter)
{
(*iter)->_setFocusHandler(focusHandler);
}
@@ -226,8 +226,8 @@ namespace gcn
void BasicContainer::remove(Widget* widget)
{
- WidgetListIterator iter;
- for (iter = mWidgets.begin(); iter != mWidgets.end(); ++ iter)
+ for (WidgetListIterator iter = mWidgets.begin();
+ iter != mWidgets.end(); ++ iter)
{
if (*iter == widget)
{
@@ -244,9 +244,8 @@ namespace gcn
void BasicContainer::clear()
{
- WidgetListConstIterator iter;
-
- for (iter = mWidgets.begin(); iter != mWidgets.end(); ++ iter)
+ for (WidgetListConstIterator iter = mWidgets.begin();
+ iter != mWidgets.end(); ++ iter)
{
(*iter)->_setFocusHandler(nullptr);
(*iter)->_setParent(nullptr);
@@ -260,8 +259,8 @@ namespace gcn
{
graphics->pushClipArea(getChildrenArea());
- WidgetListConstIterator iter;
- for (iter = mWidgets.begin(); iter != mWidgets.end(); ++ iter)
+ for (WidgetListConstIterator iter = mWidgets.begin();
+ iter != mWidgets.end(); ++ iter)
{
if ((*iter)->isVisible())
{
@@ -290,9 +289,11 @@ namespace gcn
void BasicContainer::logicChildren()
{
- WidgetListConstIterator iter;
- for (iter = mWidgets.begin(); iter != mWidgets.end(); ++ iter)
+ for (WidgetListConstIterator iter = mWidgets.begin();
+ iter != mWidgets.end(); ++ iter)
+ {
(*iter)->logic();
+ }
}
void BasicContainer::showWidgetPart(Widget* widget, Rectangle area)
@@ -325,8 +326,8 @@ namespace gcn
{
Widget::setInternalFocusHandler(focusHandler);
- WidgetListConstIterator iter;
- for (iter = mWidgets.begin(); iter != mWidgets.end(); ++ iter)
+ for (WidgetListConstIterator iter = mWidgets.begin();
+ iter != mWidgets.end(); ++ iter)
{
if (!mInternalFocusHandler)
(*iter)->_setFocusHandler(_getFocusHandler());
@@ -337,8 +338,8 @@ namespace gcn
Widget* BasicContainer::findWidgetById(const std::string& id)
{
- WidgetListConstIterator iter;
- for (iter = mWidgets.begin(); iter != mWidgets.end(); ++ iter)
+ for (WidgetListConstIterator iter = mWidgets.begin();
+ iter != mWidgets.end(); ++ iter)
{
if ((*iter)->getId() == id)
return (*iter);