From d0adcf0e3c8a1db5e06bbbb8ae950ea5ebeeb8eb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 4 Jan 2015 15:50:56 +0300 Subject: Add stringmap typedefs. --- src/gui/skin.cpp | 2 +- src/gui/skin.h | 6 ++++-- src/gui/theme.cpp | 3 +-- src/gui/windows/equipmentwindow.cpp | 4 ++-- src/gui/windows/equipmentwindow.h | 3 ++- 5 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src/gui') diff --git a/src/gui/skin.cpp b/src/gui/skin.cpp index 42c93b80e..5ffd3c7c9 100644 --- a/src/gui/skin.cpp +++ b/src/gui/skin.cpp @@ -37,7 +37,7 @@ Skin::Skin(ImageRect *const restrict skin, const ImageRect *const restrict images, const std::string &filePath, const std::string &name, const int padding, const int titlePadding, - std::map *restrict const options) : + StringIntMap *restrict const options) : instances(1), mFilePath(filePath), mName(name), diff --git a/src/gui/skin.h b/src/gui/skin.h index 6350fd878..150c04eeb 100644 --- a/src/gui/skin.h +++ b/src/gui/skin.h @@ -25,6 +25,8 @@ #ifndef GUI_SKIN_H #define GUI_SKIN_H +#include "utils/stringmap.h" + #include #include @@ -42,7 +44,7 @@ class Skin final const std::string &name = "", const int padding = 3, const int titlePadding = 4, - std::map *restrict const options = nullptr); + StringIntMap *restrict const options = nullptr); A_DELETE_COPY(Skin) @@ -130,7 +132,7 @@ class Skin final Image *mStickyImageDown; /**< Sticky Button Image */ int mPadding; int mTitlePadding; - std::map *mOptions; + StringIntMap *mOptions; }; #endif // GUI_SKIN_H diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index be1433e87..9898aebfc 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -400,8 +400,7 @@ Skin *Theme::readSkin(const std::string &filename, const bool full) int stickySpacing = 3; int stickyPadding = 3; int resizePadding = 2; - std::map *const mOptions - = new std::map(); + StringIntMap *const mOptions = new StringIntMap; // iterate 's for_each_xml_child_node(widgetNode, rootNode) diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 17cb77621..e50b0c488 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -59,7 +59,7 @@ EquipmentWindow *equipmentWindow = nullptr; EquipmentWindow *beingEquipmentWindow = nullptr; static const int BOX_COUNT = 27; -std::map EquipmentWindow::mSlotNames; +StringIntMap EquipmentWindow::mSlotNames; EquipmentWindow::EquipmentWindow(Equipment *const equipment, Being *const being, @@ -689,7 +689,7 @@ void EquipmentWindow::prepareSlotNames() int EquipmentWindow::parseSlotName(const std::string &name) { - std::map::const_iterator it = mSlotNames.find(name); + StringIntMapCIter it = mSlotNames.find(name); if (it != mSlotNames.end()) return (*it).second; return -1; diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h index 0b6439f31..27526486a 100644 --- a/src/gui/windows/equipmentwindow.h +++ b/src/gui/windows/equipmentwindow.h @@ -28,6 +28,7 @@ #include "gui/widgets/window.h" +#include "utils/stringmap.h" #include "utils/xml.h" #include "listeners/actionlistener.h" @@ -125,7 +126,7 @@ class EquipmentWindow final : public Window, static int parseSlotName(const std::string &name) A_WARN_UNUSED; - static std::map mSlotNames; + static StringIntMap mSlotNames; Equipment *mEquipment; -- cgit v1.2.3-70-g09d2