diff --git a/apps/openmw/mwgui/spellbuyingwindow.cpp b/apps/openmw/mwgui/spellbuyingwindow.cpp index 970651372..4d89ee8c2 100644 --- a/apps/openmw/mwgui/spellbuyingwindow.cpp +++ b/apps/openmw/mwgui/spellbuyingwindow.cpp @@ -23,7 +23,6 @@ namespace MWGui SpellBuyingWindow::SpellBuyingWindow(MWBase::WindowManager& parWindowManager) : WindowBase("openmw_spell_buying_window.layout", parWindowManager) , ContainerBase(NULL) // no drag&drop - , mSpellsWidgetMap() , mCurrentY(0) , mLastPos(0) { @@ -58,7 +57,7 @@ namespace MWGui mSelect->getHeight()); } - void SpellBuyingWindow::addSpell(std::string spellId) + void SpellBuyingWindow::addSpell(const std::string& spellId) { const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(spellId); int price = spell->data.cost*MWBase::Environment::get().getWorld()->getStore().gameSettings.search("fSpellValueMult")->f; @@ -85,7 +84,7 @@ namespace MWGui mSpellsWidgetMap.clear(); } - void SpellBuyingWindow::startSpellBuying(MWWorld::Ptr actor) + void SpellBuyingWindow::startSpellBuying(const MWWorld::Ptr& actor) { center(); mActor = actor; @@ -94,7 +93,7 @@ namespace MWGui MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer(); MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player); MWMechanics::Spells& playerSpells = stats.getSpells(); - /// \todo get spell list via class interface + /// \todo get spell list via MWWorld::Class interface std::vector spellList = actor.get()->base->spells.list; for (std::vector::const_iterator it = spellList.begin(); it != spellList.end(); ++it) { @@ -172,8 +171,7 @@ namespace MWGui return; mLastPos = pos; - unsigned int i; - for (i=0;igetChildCount();i++) + for (unsigned int i=0;igetChildCount();i++) { MyGUI::Widget* toMove; toMove = mSpellsClientWidget->getChildAt(i); diff --git a/apps/openmw/mwgui/spellbuyingwindow.hpp b/apps/openmw/mwgui/spellbuyingwindow.hpp index 66cec2f2a..6f94e91b2 100644 --- a/apps/openmw/mwgui/spellbuyingwindow.hpp +++ b/apps/openmw/mwgui/spellbuyingwindow.hpp @@ -25,7 +25,7 @@ namespace MWGui public: SpellBuyingWindow(MWBase::WindowManager& parWindowManager); - void startSpellBuying(MWWorld::Ptr actor); + void startSpellBuying(const MWWorld::Ptr& actor); protected: MyGUI::Button* mCancelButton; @@ -45,7 +45,7 @@ namespace MWGui void updateScroller(); void onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos); void onMouseWheel(MyGUI::Widget* _sender, int _rel); - void addSpell(std::string spellID); + void addSpell(const std::string& spellID); void clearSpells(); int mLastPos,mCurrentY;