summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/sdlfont.cpp2
-rw-r--r--src/gui/widgets/browserbox.cpp12
-rw-r--r--src/gui/widgets/extendednamesmodel.cpp3
-rw-r--r--src/gui/widgets/itemcontainer.cpp12
-rw-r--r--src/gui/widgets/setuptouchitem.cpp3
-rw-r--r--src/gui/widgets/tabbedarea.cpp6
-rw-r--r--src/gui/widgets/tabstrip.cpp3
-rw-r--r--src/gui/widgets/vertcontainer.cpp6
-rw-r--r--src/gui/widgets/windowcontainer.cpp3
9 files changed, 15 insertions, 35 deletions
diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp
index 0f4629ef8..a205bbdc0 100644
--- a/src/gui/sdlfont.cpp
+++ b/src/gui/sdlfont.cpp
@@ -280,7 +280,7 @@ void SDLFont::drawString(gcn::Graphics *const graphics,
int cnt = 0;
#endif
- FOR_EACH (CacheIterator, i, cache)
+ FOR_EACHP (CacheIterator, i, cache)
{
if (chunk == (*i))
{
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index e931c7626..8236dbdd3 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -253,8 +253,7 @@ void BrowserBox::addRow(const std::string &row, const bool atTop)
const int hyphenWidth = font->getWidth(hyphen);
unsigned x = 0;
- for (TextRowCIter i = mTextRows.begin(), i_end = mTextRows.end();
- i != i_end; ++ i)
+ FOR_EACH (TextRowCIter, i, mTextRows)
{
std::string tempRow = *i;
for (unsigned int j = 0, sz = static_cast<unsigned int>(
@@ -413,8 +412,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
gcn::Font *const font = getFont();
- for (LinePartCIter i = mLineParts.begin(), i_end = mLineParts.end();
- i != i_end; ++i)
+ FOR_EACH (LinePartCIter, i, mLineParts)
{
const LinePart &part = *i;
if (part.mY + 50 < mYStart)
@@ -465,8 +463,7 @@ int BrowserBox::calcHeight()
mLineParts.clear();
- for (TextRowCIter i = mTextRows.begin(), i_end = mTextRows.end();
- i != i_end; ++ i)
+ FOR_EACH (TextRowCIter, i, mTextRows)
{
const std::string row = *(i);
bool wrapped = false;
@@ -753,8 +750,7 @@ std::string BrowserBox::getTextAtPos(const int x, const int y) const
int lastY = 0;
- for (LinePartCIter i = mLineParts.begin(), i_end = mLineParts.end();
- i != i_end; ++i)
+ FOR_EACH (LinePartCIter, i, mLineParts)
{
const LinePart &part = *i;
if (part.mY + 50 < mYStart)
diff --git a/src/gui/widgets/extendednamesmodel.cpp b/src/gui/widgets/extendednamesmodel.cpp
index 015d4d685..90deb999c 100644
--- a/src/gui/widgets/extendednamesmodel.cpp
+++ b/src/gui/widgets/extendednamesmodel.cpp
@@ -59,8 +59,7 @@ const Image *ExtendedNamesModel::getImageAt(int i)
void ExtendedNamesModel::clear()
{
mNames.clear();
- for (std::vector<Image*>::iterator it = mImages.begin(),
- it_end = mImages.end(); it != it_end; ++ it)
+ FOR_EACH (std::vector<Image*>::iterator, it, mImages)
{
if (*it)
(*it)->decRef();
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 42c9bafcf..e11e27fd6 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -354,9 +354,7 @@ Item *ItemContainer::getSelectedItem() const
void ItemContainer::distributeValueChangedEvent()
{
- for (SelectionListenerIterator i = mSelectionListeners.begin(),
- i_end = mSelectionListeners.end();
- i != i_end; ++i)
+ FOR_EACH (SelectionListenerIterator, i, mSelectionListeners)
{
if (*i)
{
@@ -576,8 +574,7 @@ void ItemContainer::updateMatrix()
int jMult = j * mGridColumns;
const int maxSize = mGridRows * mGridColumns;
- for (std::vector<ItemIdPair*>::const_iterator iter = sortedItems.begin(),
- iter_end = sortedItems.end(); iter != iter_end; ++ iter)
+ FOR_EACH (std::vector<ItemIdPair*>::const_iterator, iter, sortedItems)
{
if (jMult >= maxSize)
break;
@@ -593,11 +590,8 @@ void ItemContainer::updateMatrix()
}
}
- for (int idx = j * mGridColumns + i;
- idx < maxSize; idx ++)
- {
+ for (int idx = j * mGridColumns + i; idx < maxSize; idx ++)
mShowMatrix[idx] = -1;
- }
for (size_t idx = 0, sz = sortedItems.size(); idx < sz; idx ++)
delete sortedItems[idx];
diff --git a/src/gui/widgets/setuptouchitem.cpp b/src/gui/widgets/setuptouchitem.cpp
index 7cb84ae81..8f8ec500c 100644
--- a/src/gui/widgets/setuptouchitem.cpp
+++ b/src/gui/widgets/setuptouchitem.cpp
@@ -56,8 +56,7 @@ TouchActionsModel::TouchActionsModel() :
std::sort(data.begin(), data.end(), touchActionSorter);
int cnt = 0;
- for (std::vector<SetupActionData*>::iterator it = data.begin(),
- it_end = data.end(); it != it_end; ++ it)
+ FOR_EACH (std::vector<SetupActionData*>::iterator, it, data)
{
const SetupActionData *data1 = *it;
mNames.push_back(data1->name);
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index e930ab60d..b0999fbd4 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -343,8 +343,7 @@ int TabbedArea::getSelectedTabIndex() const
void TabbedArea::setSelectedTabByName(const std::string &name)
{
- for (TabContainer::const_iterator itr = mTabs.begin(),
- itr_end = mTabs.end(); itr != itr_end; ++itr)
+ FOR_EACH (TabContainer::const_iterator, itr, mTabs)
{
if ((*itr).first && (*itr).first->getCaption() == name)
{
@@ -430,8 +429,7 @@ void TabbedArea::widgetResized(const gcn::Event &event A_UNUSED)
void TabbedArea::updateTabsWidth()
{
mTabsWidth = 0;
- for (TabContainer::const_iterator itr = mTabs.begin(),
- itr_end = mTabs.end(); itr != itr_end; ++itr)
+ FOR_EACH (TabContainer::const_iterator, itr, mTabs)
{
if ((*itr).first)
mTabsWidth += (*itr).first->getWidth();
diff --git a/src/gui/widgets/tabstrip.cpp b/src/gui/widgets/tabstrip.cpp
index 2ecbb5eed..e0a4b0461 100644
--- a/src/gui/widgets/tabstrip.cpp
+++ b/src/gui/widgets/tabstrip.cpp
@@ -57,8 +57,7 @@ void TabStrip::action(const gcn::ActionEvent &event)
gcn::Widget *const widget = event.getSource();
if (static_cast<Button*>(widget)->isPressed2())
{
- for (WidgetListConstIterator iter = mWidgets.begin();
- iter != mWidgets.end(); ++ iter)
+ FOR_EACH (WidgetListConstIterator, iter, mWidgets)
{
if (*iter != widget)
{
diff --git a/src/gui/widgets/vertcontainer.cpp b/src/gui/widgets/vertcontainer.cpp
index 0bda6c869..c8bc862ee 100644
--- a/src/gui/widgets/vertcontainer.cpp
+++ b/src/gui/widgets/vertcontainer.cpp
@@ -79,10 +79,6 @@ void VertContainer::clear()
void VertContainer::widgetResized(const gcn::Event &event A_UNUSED)
{
- for (std::vector<gcn::Widget*>::const_iterator
- it = mResizableWidgets.begin(), it_end = mResizableWidgets.end();
- it != it_end; ++ it)
- {
+ FOR_EACH (std::vector<gcn::Widget*>::const_iterator, it, mResizableWidgets)
(*it)->setWidth(getWidth());
- }
}
diff --git a/src/gui/widgets/windowcontainer.cpp b/src/gui/widgets/windowcontainer.cpp
index 1c4b926f5..2447e12e4 100644
--- a/src/gui/widgets/windowcontainer.cpp
+++ b/src/gui/widgets/windowcontainer.cpp
@@ -54,8 +54,7 @@ void WindowContainer::scheduleDelete(gcn::Widget *const widget)
void WindowContainer::adjustAfterResize(const int oldScreenWidth,
const int oldScreenHeight)
{
- for (WidgetListIterator i = mWidgets.begin(), i_end = mWidgets.end();
- i != i_end; ++i)
+ FOR_EACH (WidgetListIterator, i, mWidgets)
{
if (Window *const window = dynamic_cast<Window*>(*i))
window->adjustPositionAfterResize(oldScreenWidth, oldScreenHeight);