diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-02 20:06:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-02 20:06:58 +0300 |
commit | 45a9bbd34cda3c784b935860a4cc616a0314a57c (patch) | |
tree | e4cee8daa007c727e3ce4511e24aebbbcc6bc9d8 /src/guichan | |
parent | 506bf9c3bd1ddeb70529876148140c6f7c91acf2 (diff) | |
download | manaplus-45a9bbd34cda3c784b935860a4cc616a0314a57c.tar.gz manaplus-45a9bbd34cda3c784b935860a4cc616a0314a57c.tar.bz2 manaplus-45a9bbd34cda3c784b935860a4cc616a0314a57c.tar.xz manaplus-45a9bbd34cda3c784b935860a4cc616a0314a57c.zip |
Replace guichan iterators to const_iterator if need.
Diffstat (limited to 'src/guichan')
-rw-r--r-- | src/guichan/basiccontainer.cpp | 22 | ||||
-rw-r--r-- | src/guichan/include/guichan/basiccontainer.hpp | 10 | ||||
-rw-r--r-- | src/guichan/widgets/window.cpp | 2 |
3 files changed, 22 insertions, 12 deletions
diff --git a/src/guichan/basiccontainer.cpp b/src/guichan/basiccontainer.cpp index d51968eb6..439535c9a 100644 --- a/src/guichan/basiccontainer.cpp +++ b/src/guichan/basiccontainer.cpp @@ -110,7 +110,7 @@ namespace gcn void BasicContainer::focusNext() { - WidgetListIterator it; + WidgetListConstIterator it; for (it = mWidgets.begin(); it != mWidgets.end(); ++ it) { @@ -118,7 +118,7 @@ namespace gcn break; } - WidgetListIterator end = it; + WidgetListConstIterator end = it; if (it == mWidgets.end()) it = mWidgets.begin(); @@ -140,7 +140,7 @@ namespace gcn void BasicContainer::focusPrevious() { - WidgetListReverseIterator it; + WidgetListCReverseIterator it; for (it = mWidgets.rbegin(); it != mWidgets.rend(); ++ it) { @@ -148,7 +148,7 @@ namespace gcn break; } - WidgetListReverseIterator end = it; + WidgetListCReverseIterator end = it; ++ it; @@ -178,7 +178,7 @@ namespace gcn x -= r.x; y -= r.y; - WidgetListReverseIterator it; + WidgetListCReverseIterator it; for (it = mWidgets.rbegin(); it != mWidgets.rend(); ++ it) { if ((*it)->isVisible() && (*it)->getDimension() @@ -203,7 +203,7 @@ namespace gcn if (mInternalFocusHandler != NULL) return; - WidgetListIterator iter; + WidgetListConstIterator iter; for (iter = mWidgets.begin(); iter != mWidgets.end(); ++ iter) { (*iter)->_setFocusHandler(focusHandler); @@ -243,7 +243,7 @@ namespace gcn void BasicContainer::clear() { - WidgetListIterator iter; + WidgetListConstIterator iter; for (iter = mWidgets.begin(); iter != mWidgets.end(); ++ iter) { @@ -259,7 +259,7 @@ namespace gcn { graphics->pushClipArea(getChildrenArea()); - WidgetListIterator iter; + WidgetListConstIterator iter; for (iter = mWidgets.begin(); iter != mWidgets.end(); ++ iter) { if ((*iter)->isVisible()) @@ -289,7 +289,7 @@ namespace gcn void BasicContainer::logicChildren() { - WidgetListIterator iter; + WidgetListConstIterator iter; for (iter = mWidgets.begin(); iter != mWidgets.end(); ++ iter) (*iter)->logic(); } @@ -324,7 +324,7 @@ namespace gcn { Widget::setInternalFocusHandler(focusHandler); - WidgetListIterator iter; + WidgetListConstIterator iter; for (iter = mWidgets.begin(); iter != mWidgets.end(); ++ iter) { if (mInternalFocusHandler == NULL) @@ -336,7 +336,7 @@ namespace gcn Widget* BasicContainer::findWidgetById(const std::string& id) { - WidgetListIterator iter; + WidgetListConstIterator iter; for (iter = mWidgets.begin(); iter != mWidgets.end(); ++ iter) { if ((*iter)->getId() == id) diff --git a/src/guichan/include/guichan/basiccontainer.hpp b/src/guichan/include/guichan/basiccontainer.hpp index 998e1f601..6163b6535 100644 --- a/src/guichan/include/guichan/basiccontainer.hpp +++ b/src/guichan/include/guichan/basiccontainer.hpp @@ -167,12 +167,22 @@ namespace gcn */ typedef WidgetList::iterator WidgetListIterator; + /** + * Typedef. + */ + typedef WidgetList::const_iterator WidgetListConstIterator; + /** * Typedef. */ typedef WidgetList::reverse_iterator WidgetListReverseIterator; /** + * Typedef. + */ + typedef WidgetList::const_reverse_iterator WidgetListCReverseIterator; + + /** * Holds all widgets of the basic container. */ WidgetList mWidgets; diff --git a/src/guichan/widgets/window.cpp b/src/guichan/widgets/window.cpp index 4779fb0ce..7b04981c2 100644 --- a/src/guichan/widgets/window.cpp +++ b/src/guichan/widgets/window.cpp @@ -279,7 +279,7 @@ namespace gcn void Window::resizeToContent() { - WidgetListIterator it; + WidgetListConstIterator it; int w = 0, h = 0; for (it = mWidgets.begin(); it != mWidgets.end(); it++) |