diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-07-14 01:31:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-07-14 01:31:22 +0300 |
commit | 311c175f3184103950c72bc5c775174597430b83 (patch) | |
tree | ad022dc44a1c4177b3d53bf0d7eaa5a1736c8cf1 /src/gui/windows | |
parent | 16bcb81b0509725e4546bcb3c390ca3c1bb7e7b1 (diff) | |
download | ManaVerse-311c175f3184103950c72bc5c775174597430b83.tar.gz ManaVerse-311c175f3184103950c72bc5c775174597430b83.tar.bz2 ManaVerse-311c175f3184103950c72bc5c775174597430b83.tar.xz ManaVerse-311c175f3184103950c72bc5c775174597430b83.zip |
Replace std::vector into macro STD_VECTOR.
In most case it equal to std::vector except debug modes.
Now it can be also mse::mstd::vector, but sadly this class not support
all required features.
Diffstat (limited to 'src/gui/windows')
35 files changed, 126 insertions, 126 deletions
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index b2249f66c..fe980dd33 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -462,7 +462,7 @@ void BuyDialog::sort() { if ((mSortDropDown != nullptr) && (mShopItems != nullptr)) { - std::vector<ShopItem*> &items = mShopItems->items(); + STD_VECTOR<ShopItem*> &items = mShopItems->items(); switch (mSortDropDown->getSelected()) { case 1: @@ -646,7 +646,7 @@ void BuyDialog::action(const ActionEvent &event) } else if (eventId == "confirm") { - std::vector<ShopItem*> &items = mShopItems->allItems(); + STD_VECTOR<ShopItem*> &items = mShopItems->allItems(); if (mNpcId == fromInt(Market, BeingId)) { @@ -773,10 +773,10 @@ void BuyDialog::closeAll() void BuyDialog::applyNameFilter(const std::string &filter) { - std::vector<ShopItem*> &items = mShopItems->allItems(); + STD_VECTOR<ShopItem*> &items = mShopItems->allItems(); std::string filterStr = filter; toLower(filterStr); - FOR_EACH (std::vector<ShopItem*>::iterator, it, items) + FOR_EACH (STD_VECTOR<ShopItem*>::iterator, it, items) { ShopItem *const item = *it; if (item == nullptr) diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index 4d4e7b35b..9037ac614 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -149,9 +149,9 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, setContentSize(w, h); mPlayer->setGender(Gender::MALE); - const std::vector<BeingSlot> &items = CharDB::getDefaultItems(); + const STD_VECTOR<BeingSlot> &items = CharDB::getDefaultItems(); int i = 1; - for (std::vector<BeingSlot>::const_iterator it = items.begin(), + for (STD_VECTOR<BeingSlot>::const_iterator it = items.begin(), it_fend = items.end(); it != it_fend; ++ it, i ++) @@ -443,7 +443,7 @@ void CharCreateDialog::action(const ActionEvent &event) // Attempt to create the character mCreateButton->setEnabled(false); - std::vector<int> atts; + STD_VECTOR<int> atts; const size_t sz = mAttributeSlider.size(); for (size_t i = 0; i < sz; i++) { diff --git a/src/gui/windows/charcreatedialog.h b/src/gui/windows/charcreatedialog.h index 6775adc9f..5c4fdfcc3 100644 --- a/src/gui/windows/charcreatedialog.h +++ b/src/gui/windows/charcreatedialog.h @@ -127,9 +127,9 @@ class CharCreateDialog final : public Window, Button *mActionButton; Button *mRotateButton; - std::vector<Slider*> mAttributeSlider; - std::vector<Label*> mAttributeLabel; - std::vector<Label*> mAttributeValue; + STD_VECTOR<Slider*> mAttributeSlider; + STD_VECTOR<Label*> mAttributeLabel; + STD_VECTOR<Label*> mAttributeValue; Label *mAttributesLeft; Button *mCreateButton; diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index 00fafdf1f..c44464de1 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -491,7 +491,7 @@ void CharSelectDialog::attemptCharacterSelect(const int index) void CharSelectDialog::setCharacters(const Net::Characters &characters) { // Reset previous characters - FOR_EACH (std::vector<CharacterDisplay*>::const_iterator, + FOR_EACH (STD_VECTOR<CharacterDisplay*>::const_iterator, iter, mCharacterEntries) { if (*iter != nullptr) diff --git a/src/gui/windows/charselectdialog.h b/src/gui/windows/charselectdialog.h index 23d0d22cd..9cf56bfd6 100644 --- a/src/gui/windows/charselectdialog.h +++ b/src/gui/windows/charselectdialog.h @@ -124,7 +124,7 @@ class CharSelectDialog final : public Window, Button *mRenameButton; CharacterViewBase *mCharacterView; - std::vector<CharacterDisplay*> mCharacterEntries; + STD_VECTOR<CharacterDisplay*> mCharacterEntries; Net::CharServerHandler *mCharServerHandler; TextDialog *mDeleteDialog; diff --git a/src/gui/windows/emotewindow.cpp b/src/gui/windows/emotewindow.cpp index 981fb0b11..e82d9986f 100644 --- a/src/gui/windows/emotewindow.cpp +++ b/src/gui/windows/emotewindow.cpp @@ -169,7 +169,7 @@ void EmoteWindow::show() if (dictionary != nullptr) { mTextModel->clear(); - const std::vector<std::string> &texts = TextDb::getTexts(); + const STD_VECTOR<std::string> &texts = TextDb::getTexts(); FOR_EACH (StringVectCIter, it, texts) { mTextModel->add(dictionary->getStr(*it)); diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 1a95f4eee..a859ef02b 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -159,9 +159,9 @@ EquipmentWindow::~EquipmentWindow() delete mEquipment->getBackend(); delete2(mEquipment) } - FOR_EACH (std::vector<EquipmentPage*>::iterator, it, mPages) + FOR_EACH (STD_VECTOR<EquipmentPage*>::iterator, it, mPages) { - std::vector<EquipmentBox*> &boxes = (*it)->boxes; + STD_VECTOR<EquipmentBox*> &boxes = (*it)->boxes; delete_all(boxes); boxes.clear(); delete *it; @@ -187,12 +187,12 @@ void EquipmentWindow::draw(Graphics *const graphics) int i = 0; Font *const font = getFont(); const int fontHeight = font->getHeight(); - const std::vector<EquipmentBox*> &boxes = mPages[mSelectedTab]->boxes; + const STD_VECTOR<EquipmentBox*> &boxes = mPages[mSelectedTab]->boxes; if (mLastRedraw) { mVertexes->clear(); - FOR_EACH (std::vector<EquipmentBox*>::const_iterator, it, boxes) + FOR_EACH (STD_VECTOR<EquipmentBox*>::const_iterator, it, boxes) { const EquipmentBox *const box = *it; if (box == nullptr) @@ -226,7 +226,7 @@ void EquipmentWindow::draw(Graphics *const graphics) i = 0; const int projSlot = inventoryHandler->getProjectileSlot(); - for (std::vector<EquipmentBox*>::const_iterator it = boxes.begin(), + for (STD_VECTOR<EquipmentBox*>::const_iterator it = boxes.begin(), it_end = boxes.end(); it != it_end; ++ it, ++ i) { const EquipmentBox *const box = *it; @@ -274,9 +274,9 @@ void EquipmentWindow::safeDraw(Graphics *const graphics) int i = 0; Font *const font = getFont(); const int fontHeight = font->getHeight(); - const std::vector<EquipmentBox*> &boxes = mPages[mSelectedTab]->boxes; + const STD_VECTOR<EquipmentBox*> &boxes = mPages[mSelectedTab]->boxes; - for (std::vector<EquipmentBox*>::const_iterator it = boxes.begin(), + for (STD_VECTOR<EquipmentBox*>::const_iterator it = boxes.begin(), it_end = boxes.end(); it != it_end; ++ it, ++ i) { const EquipmentBox *const box = *it; @@ -301,7 +301,7 @@ void EquipmentWindow::safeDraw(Graphics *const graphics) i = 0; const int projSlot = inventoryHandler->getProjectileSlot(); - for (std::vector<EquipmentBox*>::const_iterator it = boxes.begin(), + for (STD_VECTOR<EquipmentBox*>::const_iterator it = boxes.begin(), it_end = boxes.end(); it != it_end; ++ it, ++ i) { const EquipmentBox *const box = *it; @@ -408,8 +408,8 @@ const Item *EquipmentWindow::getItem(const int x, const int y) const int i = 0; - std::vector<EquipmentBox*> &boxes = mPages[mSelectedTab]->boxes; - for (std::vector<EquipmentBox*>::const_iterator it = boxes.begin(), + STD_VECTOR<EquipmentBox*> &boxes = mPages[mSelectedTab]->boxes; + for (STD_VECTOR<EquipmentBox*>::const_iterator it = boxes.begin(), it_end = boxes.end(); it != it_end; ++ it, ++ i) { const EquipmentBox *const box = *it; @@ -446,8 +446,8 @@ void EquipmentWindow::mousePressed(MouseEvent& event) bool inBox(false); - std::vector<EquipmentBox*> &boxes = mPages[mSelectedTab]->boxes; - for (std::vector<EquipmentBox*>::const_iterator it = boxes.begin(), + STD_VECTOR<EquipmentBox*> &boxes = mPages[mSelectedTab]->boxes; + for (STD_VECTOR<EquipmentBox*>::const_iterator it = boxes.begin(), it_end = boxes.end(); it != it_end; ++ it, ++ i) { const EquipmentBox *const box = *it; @@ -535,8 +535,8 @@ void EquipmentWindow::mouseReleased(MouseEvent &event) { const int x = event.getX(); const int y = event.getY(); - std::vector<EquipmentBox*> &boxes = mPages[mSelectedTab]->boxes; - for (std::vector<EquipmentBox*>::const_iterator + STD_VECTOR<EquipmentBox*> &boxes = mPages[mSelectedTab]->boxes; + for (STD_VECTOR<EquipmentBox*>::const_iterator it = boxes.begin(), it_end = boxes.end(); it != it_end; ++ it) { @@ -712,7 +712,7 @@ void EquipmentWindow::loadSlot(XmlNodeConstPtr slotNode, if (imageIndex >= 0 && imageIndex < CAST_S32(imageset->size())) image = imageset->get(imageIndex); - std::vector<EquipmentBox*> &boxes = mPages[page]->boxes; + STD_VECTOR<EquipmentBox*> &boxes = mPages[page]->boxes; if (boxes[slot] != nullptr) { EquipmentBox *const box = boxes[slot]; @@ -811,7 +811,7 @@ void EquipmentWindow::addBox(const int idx, int x, int y, const int imageIndex) x += getPadding(); y += getTitleBarHeight() + mYPadding; - std::vector<EquipmentBox*> &boxes = mPages[0]->boxes; + STD_VECTOR<EquipmentBox*> &boxes = mPages[0]->boxes; boxes[idx] = new EquipmentBox(x, y, image); if (x < mMinX) @@ -837,7 +837,7 @@ int EquipmentWindow::addPage(const std::string &name) { EquipmentPage *const page = new EquipmentPage; mPages.push_back(page); - std::vector<EquipmentBox*> &boxes = page->boxes; + STD_VECTOR<EquipmentBox*> &boxes = page->boxes; boxes.reserve(BOX_COUNT); for (int f = 0; f < BOX_COUNT; f ++) diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h index 9bd9dd26f..b36174095 100644 --- a/src/gui/windows/equipmentwindow.h +++ b/src/gui/windows/equipmentwindow.h @@ -141,7 +141,7 @@ class EquipmentWindow final : public Window, Image *mSlotBackground; Image *mSlotHighlightedBackground; ImageCollection *mVertexes A_NONNULLPOINTER; - std::vector<EquipmentPage*> mPages; + STD_VECTOR<EquipmentPage*> mPages; TabStrip *mTabs; Color mHighlightColor; Color mBorderColor; diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp index 52f91af06..063f1a29f 100644 --- a/src/gui/windows/mailwindow.cpp +++ b/src/gui/windows/mailwindow.cpp @@ -182,7 +182,7 @@ void MailWindow::removeMail(const int id) mMailModel->clear(); - FOR_EACH (std::vector<MailMessage*>::iterator, it, mMessages) + FOR_EACH (STD_VECTOR<MailMessage*>::iterator, it, mMessages) { MailMessage *message = *it; if ((message != nullptr) && message->id == id) @@ -193,7 +193,7 @@ void MailWindow::removeMail(const int id) } } - FOR_EACH (std::vector<MailMessage*>::iterator, it, mMessages) + FOR_EACH (STD_VECTOR<MailMessage*>::iterator, it, mMessages) { MailMessage *message = *it; if (message != nullptr) @@ -223,7 +223,7 @@ void MailWindow::showMessage(MailMessage *const mail) void MailWindow::viewNext(const int id) { - FOR_EACH (std::vector<MailMessage*>::iterator, it, mMessages) + FOR_EACH (STD_VECTOR<MailMessage*>::iterator, it, mMessages) { MailMessage *message = *it; if ((message != nullptr) && message->id == id) @@ -247,7 +247,7 @@ void MailWindow::viewNext(const int id) void MailWindow::viewPrev(const int id) { - FOR_EACH (std::vector<MailMessage*>::iterator, it, mMessages) + FOR_EACH (STD_VECTOR<MailMessage*>::iterator, it, mMessages) { MailMessage *message = *it; if ((message != nullptr) && message->id == id) diff --git a/src/gui/windows/mailwindow.h b/src/gui/windows/mailwindow.h index eee7e26bd..40be426d6 100644 --- a/src/gui/windows/mailwindow.h +++ b/src/gui/windows/mailwindow.h @@ -68,7 +68,7 @@ class MailWindow final : public Window, void createMail(const std::string &to); private: - std::vector<MailMessage*> mMessages; + STD_VECTOR<MailMessage*> mMessages; std::map<int, MailMessage*> mMessagesMap; ExtendedNamesModel *mMailModel; ExtendedListBox *mListBox; diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index ec27469ad..ba92a0739 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -55,7 +55,7 @@ MiniStatusWindow *miniStatusWindow = nullptr; extern volatile int tick_time; -typedef std::vector <ProgressBar*>::const_iterator ProgressBarVectorCIter; +typedef STD_VECTOR <ProgressBar*>::const_iterator ProgressBarVectorCIter; MiniStatusWindow::MiniStatusWindow() : Window("MiniStatus", Modal_false, nullptr, "ministatus.xml"), diff --git a/src/gui/windows/ministatuswindow.h b/src/gui/windows/ministatuswindow.h index 83d7052ae..4221673a8 100644 --- a/src/gui/windows/ministatuswindow.h +++ b/src/gui/windows/ministatuswindow.h @@ -85,7 +85,7 @@ class MiniStatusWindow final : public Window, void slotsChanged(const Inventory *const inventory) override final; - std::vector <ProgressBar*> &getBars() A_WARN_UNUSED + STD_VECTOR <ProgressBar*> &getBars() A_WARN_UNUSED { return mBars; } Rect getChildrenArea() override final A_WARN_UNUSED; @@ -122,9 +122,9 @@ class MiniStatusWindow final : public Window, void saveBars() const; - std::vector <ProgressBar*> mBars; + STD_VECTOR <ProgressBar*> mBars; std::map <std::string, ProgressBar*> mBarNames; - std::vector<AnimatedSprite *> mIcons; + STD_VECTOR<AnimatedSprite *> mIcons; /* * Mini Status Bars diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index 25c1899a0..fb38dcc72 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -92,7 +92,7 @@ NpcDialog::DialogList NpcDialog::instances; NpcDialogs NpcDialog::mNpcDialogs; -typedef std::vector<Image *>::iterator ImageVectorIter; +typedef STD_VECTOR<Image *>::iterator ImageVectorIter; NpcDialog::NpcDialog(const BeingId npcId) : // TRANSLATORS: npc dialog name @@ -1275,7 +1275,7 @@ void NpcDialog::createSkinControls() if (mDialogInfo == nullptr) return; - FOR_EACH (std::vector<NpcImageInfo*>::const_iterator, + FOR_EACH (STD_VECTOR<NpcImageInfo*>::const_iterator, it, mDialogInfo->menu.images) { @@ -1288,7 +1288,7 @@ void NpcDialog::createSkinControls() mSkinContainer->add(icon); } } - FOR_EACH (std::vector<NpcTextInfo*>::const_iterator, + FOR_EACH (STD_VECTOR<NpcTextInfo*>::const_iterator, it, mDialogInfo->menu.texts) { @@ -1314,7 +1314,7 @@ void NpcDialog::createSkinControls() box->addRow(*it2); } } - FOR_EACH (std::vector<NpcButtonInfo*>::const_iterator, + FOR_EACH (STD_VECTOR<NpcButtonInfo*>::const_iterator, it, mDialogInfo->menu.buttons) { @@ -1347,7 +1347,7 @@ std::string NpcDialog::complexItemToStr(const ComplexItem *const item) std::string str; if (item != nullptr) { - const std::vector<Item*> &items = item->getChilds(); + const STD_VECTOR<Item*> &items = item->getChilds(); const size_t sz = items.size(); if (sz == 0u) return str; diff --git a/src/gui/windows/npcdialog.h b/src/gui/windows/npcdialog.h index 8e041b087..4680d774d 100644 --- a/src/gui/windows/npcdialog.h +++ b/src/gui/windows/npcdialog.h @@ -279,7 +279,7 @@ class NpcDialog final : public Window, // Used for choice input StringVect mItems; - std::vector<Image *> mImages; + STD_VECTOR<Image *> mImages; ExtendedListBox *mItemList A_NONNULLPOINTER; ScrollArea *mListScrollArea A_NONNULLPOINTER; Container *mSkinContainer A_NONNULLPOINTER; @@ -308,7 +308,7 @@ class NpcDialog final : public Window, NpcInputStateT mInputState; NpcActionStateT mActionState; - std::vector<Widget*> mSkinControls; + STD_VECTOR<Widget*> mSkinControls; std::string mSkinName; PlayerBox *mPlayerBox A_NONNULLPOINTER; Being *mAvatarBeing; diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp index 51254e9a0..5a5608d4e 100644 --- a/src/gui/windows/outfitwindow.cpp +++ b/src/gui/windows/outfitwindow.cpp @@ -148,7 +148,7 @@ void OutfitWindow::load() std::string buf; std::stringstream ss(outfit); - std::vector<int> tokens; + STD_VECTOR<int> tokens; while (ss >> buf) tokens.push_back(atoi(buf.c_str())); @@ -164,7 +164,7 @@ void OutfitWindow::load() tokens.clear(); - std::vector<unsigned char> tokens2; + STD_VECTOR<unsigned char> tokens2; while (ss2 >> buf) tokens2.push_back(CAST_U8(atoi(buf.c_str()))); @@ -734,7 +734,7 @@ std::string OutfitWindow::getOutfitString() const continue; const ItemColor color = mItemColors[mCurrentOutfit][i]; - std::vector<int> ids; + STD_VECTOR<int> ids; ids.push_back(id); ids.push_back(CAST_S32(color)); diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp index af9f19369..1eb2da841 100644 --- a/src/gui/windows/questswindow.cpp +++ b/src/gui/windows/questswindow.cpp @@ -187,10 +187,10 @@ void QuestsWindow::rebuild(const bool playSound) mQuestLinks.clear(); mQuestReverseLinks.clear(); StringVect &names = mQuestsModel->getNames(); - std::vector<Image*> &images = mQuestsModel->getImages(); - std::vector<QuestItem*> complete; - std::vector<QuestItem*> incomplete; - std::vector<QuestItem*> hidden; + STD_VECTOR<Image*> &images = mQuestsModel->getImages(); + STD_VECTOR<QuestItem*> complete; + STD_VECTOR<QuestItem*> incomplete; + STD_VECTOR<QuestItem*> hidden; int updatedQuest = -1; int newCompleteStatus = -1; @@ -198,8 +198,8 @@ void QuestsWindow::rebuild(const bool playSound) { const int var = (*it).first; const QuestVar &val = (*it).second; - const std::vector<QuestItem*> &quests = (*mQuests)[var]; - FOR_EACH (std::vector<QuestItem*>::const_iterator, it2, quests) + const STD_VECTOR<QuestItem*> &quests = (*mQuests)[var]; + FOR_EACH (STD_VECTOR<QuestItem*>::const_iterator, it2, quests) { if (*it2 == nullptr) continue; @@ -225,7 +225,7 @@ void QuestsWindow::rebuild(const bool playSound) int k = 0; - for (std::vector<QuestItem*>::const_iterator it = complete.begin(), + for (STD_VECTOR<QuestItem*>::const_iterator it = complete.begin(), it_end = complete.end(); it != it_end; ++ it, k ++) { QuestItem *const quest = *it; @@ -250,7 +250,7 @@ void QuestsWindow::rebuild(const bool playSound) } } - for (std::vector<QuestItem*>::const_iterator it = incomplete.begin(), + for (STD_VECTOR<QuestItem*>::const_iterator it = incomplete.begin(), it_end = incomplete.end(); it != it_end; ++ it, k ++) { QuestItem *const quest = *it; @@ -274,7 +274,7 @@ void QuestsWindow::rebuild(const bool playSound) } } - FOR_EACH (std::vector<QuestItem*>::const_iterator, it, hidden) + FOR_EACH (STD_VECTOR<QuestItem*>::const_iterator, it, hidden) (*it)->completeFlag = -1; if (updatedQuest == -1 || updatedQuest >= CAST_S32( @@ -310,14 +310,14 @@ void QuestsWindow::showQuest(const QuestItem *const quest) if (quest == nullptr) return; - const std::vector<QuestItemText> &texts = quest->texts; + const STD_VECTOR<QuestItemText> &texts = quest->texts; const QuestVar &var = (*mVars)[quest->var]; const std::string var1 = toString(var.var1); const std::string var2 = toString(var.var2); const std::string var3 = toString(var.var3); const std::string timeStr = timeDiffToString(var.time1); mText->clearRows(); - FOR_EACH (std::vector<QuestItemText>::const_iterator, it, texts) + FOR_EACH (STD_VECTOR<QuestItemText>::const_iterator, it, texts) { const QuestItemText &data = *it; std::string text = data.text; @@ -379,7 +379,7 @@ void QuestsWindow::setMap(const Map *const map) return; const std::string name = mMap->getProperty("shortName"); - FOR_EACHP (std::vector<QuestEffect*>::const_iterator, it, mAllEffects) + FOR_EACHP (STD_VECTOR<QuestEffect*>::const_iterator, it, mAllEffects) { const QuestEffect *const effect = *it; if ((effect != nullptr) && name == effect->map) @@ -394,7 +394,7 @@ void QuestsWindow::updateEffects() NpcQuestEffectMap oldNpc = mNpcEffects; mNpcEffects.clear(); - FOR_EACH (std::vector<const QuestEffect*>::const_iterator, + FOR_EACH (STD_VECTOR<const QuestEffect*>::const_iterator, it, mMapEffects) { const QuestEffect *const effect = *it; diff --git a/src/gui/windows/questswindow.h b/src/gui/windows/questswindow.h index b5be44d12..680ae6271 100644 --- a/src/gui/windows/questswindow.h +++ b/src/gui/windows/questswindow.h @@ -86,14 +86,14 @@ class QuestsWindow final : public Window, Button *mCloseButton A_NONNULLPOINTER; Image *mCompleteIcon; Image *mIncompleteIcon; - std::vector<const QuestEffect*> mMapEffects; + STD_VECTOR<const QuestEffect*> mMapEffects; NpcQuestVarMap *mVars; - std::map<int, std::vector<QuestItem*> > *mQuests; - std::vector<QuestEffect*> *mAllEffects; + std::map<int, STD_VECTOR<QuestItem*> > *mQuests; + STD_VECTOR<QuestEffect*> *mAllEffects; // npc effects for current map and values: npc, effect NpcQuestEffectMap mNpcEffects; - std::vector<QuestItem*> mQuestLinks; + STD_VECTOR<QuestItem*> mQuestLinks; std::map<int, int> mQuestReverseLinks; int mNewQuestEffectId; int mCompleteQuestEffectId; diff --git a/src/gui/windows/quitdialog.cpp b/src/gui/windows/quitdialog.cpp index e04b28d18..b9ef417c3 100644 --- a/src/gui/windows/quitdialog.cpp +++ b/src/gui/windows/quitdialog.cpp @@ -229,8 +229,8 @@ void QuitDialog::keyPressed(KeyEvent &event) if (dir != 0) { - std::vector<RadioButton*>::const_iterator it = mOptions.begin(); - const std::vector<RadioButton*>::const_iterator + STD_VECTOR<RadioButton*>::const_iterator it = mOptions.begin(); + const STD_VECTOR<RadioButton*>::const_iterator it_end = mOptions.end(); for (; it < it_end; ++it) diff --git a/src/gui/windows/quitdialog.h b/src/gui/windows/quitdialog.h index 1e0197f87..e12e13e7b 100644 --- a/src/gui/windows/quitdialog.h +++ b/src/gui/windows/quitdialog.h @@ -67,7 +67,7 @@ class QuitDialog final : public Window, private: void placeOption(ContainerPlacer &placer, RadioButton *const option); - std::vector<RadioButton*> mOptions; + STD_VECTOR<RadioButton*> mOptions; RadioButton *mLogoutQuit A_NONNULLPOINTER; RadioButton *mForceQuit A_NONNULLPOINTER; diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index 6093b67b4..ab630e960 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -505,7 +505,7 @@ static void loadHostsGroup(XmlNodeConstPtr node, } static void loadServerSourcesList(XmlNodeConstPtr node, - std::vector<ServerUrlInfo> &list) + STD_VECTOR<ServerUrlInfo> &list) { for_each_xml_child_node(urlNode, node) { diff --git a/src/gui/windows/serverinfowindow.cpp b/src/gui/windows/serverinfowindow.cpp index d1eb8cb44..20f8d5f42 100644 --- a/src/gui/windows/serverinfowindow.cpp +++ b/src/gui/windows/serverinfowindow.cpp @@ -136,14 +136,14 @@ void ServerInfoWindow::showServerInfo() mBrowserBox->updateHeight(); } -void ServerInfoWindow::addSourcesList(const std::vector<ServerUrlInfo> &list, +void ServerInfoWindow::addSourcesList(const STD_VECTOR<ServerUrlInfo> &list, const std::string &comment) { if (!list.empty()) { mBrowserBox->addRow(""); mBrowserBox->addRow(comment); - FOR_EACH (std::vector<ServerUrlInfo>::const_iterator, it, list) + FOR_EACH (STD_VECTOR<ServerUrlInfo>::const_iterator, it, list) { const ServerUrlInfo &info = *it; addServerComment(info.url, diff --git a/src/gui/windows/serverinfowindow.h b/src/gui/windows/serverinfowindow.h index 810c5b0c3..d872b1fdf 100644 --- a/src/gui/windows/serverinfowindow.h +++ b/src/gui/windows/serverinfowindow.h @@ -51,7 +51,7 @@ class ServerInfoWindow final : public Window, protected: void showServerInfo(); - void addSourcesList(const std::vector<ServerUrlInfo> &list, + void addSourcesList(const STD_VECTOR<ServerUrlInfo> &list, const std::string &comment); void addServerComment(const std::string &url, diff --git a/src/gui/windows/setupwindow.cpp b/src/gui/windows/setupwindow.cpp index 40354f62a..6228ecd45 100644 --- a/src/gui/windows/setupwindow.cpp +++ b/src/gui/windows/setupwindow.cpp @@ -317,7 +317,7 @@ void SetupWindow::widgetResized(const Event &event) const int height = area.height; const int width = area.width; mPanel->setDimension(Rect(5, 5, width - 10, height - 40)); - FOR_EACH (std::vector<Button*>::iterator, it, mButtons) + FOR_EACH (STD_VECTOR<Button*>::iterator, it, mButtons) { Button *const btn = *it; x -= btn->getWidth() + mButtonPadding; diff --git a/src/gui/windows/setupwindow.h b/src/gui/windows/setupwindow.h index cb8a3af18..79a11a469 100644 --- a/src/gui/windows/setupwindow.h +++ b/src/gui/windows/setupwindow.h @@ -82,7 +82,7 @@ class SetupWindow final : public Window, std::list<SetupTab*> mTabs; std::list<Window*> mWindowsToReset; - std::vector<Button*> mButtons; + STD_VECTOR<Button*> mButtons; SetupTab *mModsTab; SetupTab *mQuickTab; Button *mResetWindows; diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index 9ff15b024..0e55bcca1 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -318,7 +318,7 @@ void ShopWindow::action(const ActionEvent &event) } else { - std::vector<ShopItem*> &items = mBuyShopItems->items(); + STD_VECTOR<ShopItem*> &items = mBuyShopItems->items(); if (!items.empty()) { buyingStoreHandler->create(mSellShopName, @@ -337,12 +337,12 @@ void ShopWindow::action(const ActionEvent &event) } else { - std::vector<ShopItem*> &oldItems = mSellShopItems->items(); - std::vector<ShopItem*> items; + STD_VECTOR<ShopItem*> &oldItems = mSellShopItems->items(); + STD_VECTOR<ShopItem*> items; const Inventory *const inv = PlayerInfo::getCartInventory(); if (inv == nullptr) return; - FOR_EACH (std::vector<ShopItem*>::iterator, it, oldItems) + FOR_EACH (STD_VECTOR<ShopItem*>::iterator, it, oldItems) { ShopItem *const item = *it; if (item == nullptr) @@ -551,7 +551,7 @@ void ShopWindow::loadList() const std::string str = line; if (!str.empty()) { - std::vector<int> tokens; + STD_VECTOR<int> tokens; std::stringstream ss(str); while (ss >> buf) @@ -600,8 +600,8 @@ void ShopWindow::saveList() const return; } - std::vector<ShopItem*> items = mBuyShopItems->items(); - FOR_EACH (std::vector<ShopItem*>::const_iterator, it, items) + STD_VECTOR<ShopItem*> items = mBuyShopItems->items(); + FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items) { ShopItem *const item = *(it); if (item != nullptr) @@ -609,7 +609,7 @@ void ShopWindow::saveList() const } items = mSellShopItems->items(); - FOR_EACH (std::vector<ShopItem*>::const_iterator, it, items) + FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items) { if ((*it) == nullptr) continue; @@ -672,9 +672,9 @@ void ShopWindow::announce(ShopItems *const list, const int mode) if (mAnnounceButton != nullptr) mAnnounceButton->setEnabled(false); - std::vector<ShopItem*> items = list->items(); + STD_VECTOR<ShopItem*> items = list->items(); - FOR_EACH (std::vector<ShopItem*>::const_iterator, it, items) + FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items) { const ShopItem *const item = *(it); if (item->getQuantity() > 1) @@ -760,9 +760,9 @@ void ShopWindow::giveList(const std::string &nick, const int mode) if (inv == nullptr) return; - std::vector<ShopItem*> items = list->items(); + STD_VECTOR<ShopItem*> items = list->items(); - FOR_EACH (std::vector<ShopItem*>::const_iterator, it, items) + FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items) { const ShopItem *const item = *(it); if (item == nullptr) @@ -1064,13 +1064,13 @@ bool ShopWindow::findShopItem(const ShopItem *const shopItem, if (shopItem == nullptr) return false; - std::vector<ShopItem*> items; + STD_VECTOR<ShopItem*> items; if (mode == SELL) items = mSellShopItems->items(); else items = mBuyShopItems->items(); - FOR_EACH (std::vector<ShopItem*>::const_iterator, it, items) + FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items) { const ShopItem *const item = *(it); if (item == nullptr) diff --git a/src/gui/windows/shortcutwindow.cpp b/src/gui/windows/shortcutwindow.cpp index 61a7e6b45..1bb35d3f1 100644 --- a/src/gui/windows/shortcutwindow.cpp +++ b/src/gui/windows/shortcutwindow.cpp @@ -243,7 +243,7 @@ void ShortcutWindow::widgetMoved(const Event& event) Window::widgetMoved(event); if (mItems != nullptr) mItems->setRedraw(true); - FOR_EACH (std::vector<ShortcutContainer*>::iterator, it, mPages) + FOR_EACH (STD_VECTOR<ShortcutContainer*>::iterator, it, mPages) (*it)->setRedraw(true); } diff --git a/src/gui/windows/shortcutwindow.h b/src/gui/windows/shortcutwindow.h index 0486dd830..f21c505c5 100644 --- a/src/gui/windows/shortcutwindow.h +++ b/src/gui/windows/shortcutwindow.h @@ -86,7 +86,7 @@ class ShortcutWindow final : public Window ScrollArea *mScrollArea A_NONNULLPOINTER; TabbedArea *mTabs; - std::vector<ShortcutContainer*> mPages; + STD_VECTOR<ShortcutContainer*> mPages; int mButtonIndex; static int mBoxesWidth; diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index 52dd067ea..ae6b72a35 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -732,7 +732,7 @@ void SkillDialog::useItem(const int itemId, if (!data.empty()) { - std::vector<int> vect; + STD_VECTOR<int> vect; splitToIntVector(vect, data, ' '); const size_t sz = vect.size(); if (sz > 0) @@ -1250,7 +1250,7 @@ void SkillDialog::addSkillDuration(SkillInfo *const skill) if (skill == nullptr) return; - FOR_EACH (std::vector<SkillInfo*>::const_iterator, it, mDurations) + FOR_EACH (STD_VECTOR<SkillInfo*>::const_iterator, it, mDurations) { if ((*it)->id == skill->id) return; @@ -1260,7 +1260,7 @@ void SkillDialog::addSkillDuration(SkillInfo *const skill) void SkillDialog::slowLogic() { - FOR_EACH_SAFE (std::vector<SkillInfo*>::iterator, it, mDurations) + FOR_EACH_SAFE (STD_VECTOR<SkillInfo*>::iterator, it, mDurations) { SkillInfo *const skill = *it; if (skill != nullptr) diff --git a/src/gui/windows/skilldialog.h b/src/gui/windows/skilldialog.h index 0c19f9308..ab65f9f1b 100644 --- a/src/gui/windows/skilldialog.h +++ b/src/gui/windows/skilldialog.h @@ -219,7 +219,7 @@ class SkillDialog final : public Window, typedef std::map<int, SkillInfo*> SkillMap; SkillMap mSkills; - std::vector<SkillInfo*> mDurations; + STD_VECTOR<SkillInfo*> mDurations; TabbedArea *mTabs A_NONNULLPOINTER; std::list<Tab*> mDeleteTabs; Label *mPointsLabel A_NONNULLPOINTER; diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp index 6553c8dc5..e313cbc77 100644 --- a/src/gui/windows/statuswindow.cpp +++ b/src/gui/windows/statuswindow.cpp @@ -236,8 +236,8 @@ void StatusWindow::addTabs() { // TRANSLATORS: status window tab name addTabBasic(_("Basic")); - const std::vector<std::string> &pages = StatDb::getPages(); - FOR_EACH(std::vector<std::string>::const_iterator, it, pages) + const STD_VECTOR<std::string> &pages = StatDb::getPages(); + FOR_EACH(STD_VECTOR<std::string>::const_iterator, it, pages) { addTab(*it); } diff --git a/src/gui/windows/statuswindow.h b/src/gui/windows/statuswindow.h index ddeee2d4c..01277c220 100644 --- a/src/gui/windows/statuswindow.h +++ b/src/gui/windows/statuswindow.h @@ -100,7 +100,7 @@ class StatusWindow final : public Window, static std::string translateLetter(const char *const letters); static std::string translateLetter2(const std::string &letters); - std::vector<StatsPage*> mPages; + STD_VECTOR<StatsPage*> mPages; TabbedArea *mTabs A_NONNULLPOINTER; Label *mLvlLabel A_NONNULLPOINTER; diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index db7d48c36..3858b0a5e 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -75,10 +75,10 @@ const std::string updateServer5 /** * Load the given file into a vector of updateFiles. */ -static std::vector<UpdateFile> loadXMLFile(const std::string &fileName, +static STD_VECTOR<UpdateFile> loadXMLFile(const std::string &fileName, const bool loadMods) { - std::vector<UpdateFile> files; + STD_VECTOR<UpdateFile> files; XML::Document doc(fileName, UseVirtFs_false, SkipError_false); XmlNodeConstPtrConst rootNode = doc.rootNode(); @@ -129,9 +129,9 @@ static std::vector<UpdateFile> loadXMLFile(const std::string &fileName, return files; } -static std::vector<UpdateFile> loadTxtFile(const std::string &fileName) +static STD_VECTOR<UpdateFile> loadTxtFile(const std::string &fileName) { - std::vector<UpdateFile> files; + STD_VECTOR<UpdateFile> files; std::ifstream fileHandler; fileHandler.open(fileName.c_str(), std::ios::in); @@ -242,7 +242,7 @@ UpdaterWindow::UpdaterWindow(const std::string &restrict updateHost, if (mUpdateHost.empty()) { - const std::vector<std::string> &mirrors = settings.updateMirrors; + const STD_VECTOR<std::string> &mirrors = settings.updateMirrors; if (mirrors.begin() != mirrors.end()) mUpdateHost = *mirrors.begin(); mSkipPatches = true; @@ -613,8 +613,8 @@ void UpdaterWindow::download() } else { - const std::vector<std::string> &mirrors = settings.updateMirrors; - FOR_EACH (std::vector<std::string>::const_iterator, it, mirrors) + const STD_VECTOR<std::string> &mirrors = settings.updateMirrors; + FOR_EACH (STD_VECTOR<std::string>::const_iterator, it, mirrors) { mDownload->addMirror(pathJoin(*it, mCurrentFile)); @@ -683,7 +683,7 @@ void UpdaterWindow::loadUpdates() void UpdaterWindow::loadLocalUpdates(const std::string &dir) { - std::vector<UpdateFile> updateFiles = loadXMLFile( + STD_VECTOR<UpdateFile> updateFiles = loadXMLFile( pathJoin(dir, xmlUpdateFile), false); @@ -716,7 +716,7 @@ void UpdaterWindow::loadLocalUpdates(const std::string &dir) void UpdaterWindow::unloadUpdates(const std::string &dir) { - std::vector<UpdateFile> updateFiles = loadXMLFile( + STD_VECTOR<UpdateFile> updateFiles = loadXMLFile( pathJoin(dir, xmlUpdateFile), true); @@ -742,7 +742,7 @@ void UpdaterWindow::unloadUpdates(const std::string &dir) void UpdaterWindow::loadManaPlusUpdates(const std::string &dir) { std::string fixPath = dir + "/fix"; - std::vector<UpdateFile> updateFiles = loadXMLFile( + STD_VECTOR<UpdateFile> updateFiles = loadXMLFile( pathJoin(fixPath, xmlUpdateFile), false); @@ -772,7 +772,7 @@ void UpdaterWindow::loadManaPlusUpdates(const std::string &dir) void UpdaterWindow::unloadManaPlusUpdates(const std::string &dir) { const std::string fixPath = dir + "/fix"; - const std::vector<UpdateFile> updateFiles = loadXMLFile( + const STD_VECTOR<UpdateFile> updateFiles = loadXMLFile( pathJoin(fixPath, xmlUpdateFile), true); @@ -1100,7 +1100,7 @@ void UpdaterWindow::loadFile(std::string file) } void UpdaterWindow::loadMods(const std::string &dir, - const std::vector<UpdateFile> &updateFiles) + const STD_VECTOR<UpdateFile> &updateFiles) { ModDB::load(); std::string modsString = serverConfig.getValue("mods", ""); @@ -1127,7 +1127,7 @@ void UpdaterWindow::loadMods(const std::string &dir, } } - std::vector<UpdateFile> updateFiles2 = loadXMLFile( + STD_VECTOR<UpdateFile> updateFiles2 = loadXMLFile( pathJoin(fixPath, xmlUpdateFile), true); diff --git a/src/gui/windows/updaterwindow.h b/src/gui/windows/updaterwindow.h index f4d2a80f6..661168a9f 100644 --- a/src/gui/windows/updaterwindow.h +++ b/src/gui/windows/updaterwindow.h @@ -137,7 +137,7 @@ class UpdaterWindow final : public Window, static unsigned long getFileHash(const std::string &filePath); static void loadMods(const std::string &dir, - const std::vector<UpdateFile> &updateFiles); + const STD_VECTOR<UpdateFile> &updateFiles); static void loadDirMods(const std::string &dir); @@ -199,10 +199,10 @@ class UpdaterWindow final : public Window, Net::Download *mDownload; /** List of files to download. */ - std::vector<UpdateFile> mUpdateFiles; + STD_VECTOR<UpdateFile> mUpdateFiles; /** List of temp files to download. */ - std::vector<UpdateFile> mTempUpdateFiles; + STD_VECTOR<UpdateFile> mTempUpdateFiles; std::string mUpdateServerPath; diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index c1e5ffb12..79fe66a4f 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -245,7 +245,7 @@ void WhoIsOnline::updateWindow(size_t numOnline) std::sort(mNeutral.begin(), mNeutral.end(), nameCompare); std::sort(mDisregard.begin(), mDisregard.end(), nameCompare); bool addedFromSection(false); - FOR_EACH (std::vector<OnlinePlayer*>::const_iterator, it, mFriends) + FOR_EACH (STD_VECTOR<OnlinePlayer*>::const_iterator, it, mFriends) { mBrowserBox->addRow((*it)->getText()); addedFromSection = true; @@ -255,7 +255,7 @@ void WhoIsOnline::updateWindow(size_t numOnline) mBrowserBox->addRow("---"); addedFromSection = false; } - FOR_EACH (std::vector<OnlinePlayer*>::const_iterator, it, mEnemy) + FOR_EACH (STD_VECTOR<OnlinePlayer*>::const_iterator, it, mEnemy) { mBrowserBox->addRow((*it)->getText()); addedFromSection = true; @@ -265,7 +265,7 @@ void WhoIsOnline::updateWindow(size_t numOnline) mBrowserBox->addRow("---"); addedFromSection = false; } - FOR_EACH (std::vector<OnlinePlayer*>::const_iterator, it, mNeutral) + FOR_EACH (STD_VECTOR<OnlinePlayer*>::const_iterator, it, mNeutral) { mBrowserBox->addRow((*it)->getText()); addedFromSection = true; @@ -273,7 +273,7 @@ void WhoIsOnline::updateWindow(size_t numOnline) if (addedFromSection == true && !mDisregard.empty()) mBrowserBox->addRow("---"); - FOR_EACH (std::vector<OnlinePlayer*>::const_iterator, it, mDisregard) + FOR_EACH (STD_VECTOR<OnlinePlayer*>::const_iterator, it, mDisregard) mBrowserBox->addRow((*it)->getText()); if (mScrollArea->getVerticalMaxScroll() < @@ -324,7 +324,7 @@ void WhoIsOnline::handlerPlayerRelation(const std::string &nick, } } -void WhoIsOnline::loadList(const std::vector<OnlinePlayer*> &list) +void WhoIsOnline::loadList(const STD_VECTOR<OnlinePlayer*> &list) { mBrowserBox->clearRows(); const size_t numOnline = list.size(); @@ -336,7 +336,7 @@ void WhoIsOnline::loadList(const std::vector<OnlinePlayer*> &list) mShowLevel = config.getBoolValue("showlevel"); - FOR_EACH (std::vector<OnlinePlayer*>::const_iterator, it, list) + FOR_EACH (STD_VECTOR<OnlinePlayer*>::const_iterator, it, list) { OnlinePlayer *player = *it; const std::string nick = player->getNick(); diff --git a/src/gui/windows/whoisonline.h b/src/gui/windows/whoisonline.h index 9f2fdf705..0eb316197 100644 --- a/src/gui/windows/whoisonline.h +++ b/src/gui/windows/whoisonline.h @@ -65,7 +65,7 @@ class WhoIsOnline final : public Window, void loadWebList(); #endif // TMWA_SUPPORT - void loadList(const std::vector<OnlinePlayer*> &list); + void loadList(const STD_VECTOR<OnlinePlayer*> &list); void handleLink(const std::string& link, MouseEvent *event) override final; @@ -154,10 +154,10 @@ class WhoIsOnline final : public Window, std::set<OnlinePlayer*> mOnlinePlayers; std::set<std::string> mOnlineNicks; - std::vector<OnlinePlayer*> mFriends; - std::vector<OnlinePlayer*> mNeutral; - std::vector<OnlinePlayer*> mDisregard; - std::vector<OnlinePlayer*> mEnemy; + STD_VECTOR<OnlinePlayer*> mFriends; + STD_VECTOR<OnlinePlayer*> mNeutral; + STD_VECTOR<OnlinePlayer*> mDisregard; + STD_VECTOR<OnlinePlayer*> mEnemy; /** Byte count currently downloaded in mMemoryBuffer. */ int mDownloadedBytes; |