summaryrefslogtreecommitdiff
path: root/src/gui/npcdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-01-20 19:01:23 +0300
committerAndrei Karas <akaras@inbox.ru>2013-01-20 19:29:26 +0300
commit531433248fbad49e2b8e9d90de9855f3ea9b2257 (patch)
tree33937a65d8b18934879824fa4c2a6183d53d5e73 /src/gui/npcdialog.cpp
parent48071e171de41a23197c7328ba038331a936e0eb (diff)
downloadmanaplus-531433248fbad49e2b8e9d90de9855f3ea9b2257.tar.gz
manaplus-531433248fbad49e2b8e9d90de9855f3ea9b2257.tar.bz2
manaplus-531433248fbad49e2b8e9d90de9855f3ea9b2257.tar.xz
manaplus-531433248fbad49e2b8e9d90de9855f3ea9b2257.zip
Another part with FOR_EACH changes.
Diffstat (limited to 'src/gui/npcdialog.cpp')
-rw-r--r--src/gui/npcdialog.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp
index f2067d847..31b13e91f 100644
--- a/src/gui/npcdialog.cpp
+++ b/src/gui/npcdialog.cpp
@@ -60,6 +60,8 @@
NpcDialog::DialogList NpcDialog::instances;
+typedef std::vector<Image *>::iterator ImageVectorIter;
+
NpcDialog::NpcDialog(const int npcId) :
Window(_("NPC"), false, nullptr, "npc.xml"),
gcn::ActionListener(),
@@ -209,8 +211,7 @@ NpcDialog::~NpcDialog()
delete mListScrollArea;
mListScrollArea = nullptr;
- for (std::vector<Image *>::iterator it = mImages.begin(),
- it_end = mImages.end(); it != it_end; ++ it)
+ FOR_EACH (ImageVectorIter, it, mImages)
{
if (*it)
(*it)->decRef();
@@ -378,8 +379,7 @@ const Image *NpcDialog::getImageAt(int i)
void NpcDialog::choiceRequest()
{
mItems.clear();
- for (std::vector<Image *>::iterator it = mImages.begin(),
- it_end = mImages.end(); it != it_end; ++ it)
+ FOR_EACH (ImageVectorIter, it, mImages)
{
if (*it)
(*it)->decRef();
@@ -459,8 +459,7 @@ bool NpcDialog::isInputFocused() const
bool NpcDialog::isAnyInputFocused()
{
- for (DialogList::const_iterator it = instances.begin(),
- it_end = instances.end(); it != it_end; ++it)
+ FOR_EACH (DialogList::const_iterator, it, instances)
{
if ((*it) && (*it)->isInputFocused())
return true;
@@ -519,8 +518,7 @@ NpcDialog *NpcDialog::getActive()
if (instances.size() == 1)
return instances.front();
- for (DialogList::const_iterator it = instances.begin(),
- it_end = instances.end(); it != it_end; ++it)
+ FOR_EACH (DialogList::const_iterator, it, instances)
{
if ((*it) && (*it)->isFocused())
return (*it);
@@ -531,8 +529,7 @@ NpcDialog *NpcDialog::getActive()
void NpcDialog::closeAll()
{
- for (DialogList::const_iterator it = instances.begin(),
- it_end = instances.end(); it != it_end; ++it)
+ FOR_EACH (DialogList::const_iterator, it, instances)
{
if (*it)
(*it)->close();