diff options
author | Cameron Cawley | 2019-08-10 14:50:33 +0100 |
---|---|---|
committer | Cameron Cawley | 2019-08-10 14:50:33 +0100 |
commit | 9052a16887f21190865812cbe887b250d91074ae (patch) | |
tree | 3a7367e41025b52f2b9531bbe86b0ff61da87ec0 /graphics/macgui | |
parent | 1632fba91e672c2e3ee2bbc15cfcccd1c0fe3533 (diff) | |
download | scummvm-rg350-9052a16887f21190865812cbe887b250d91074ae.tar.gz scummvm-rg350-9052a16887f21190865812cbe887b250d91074ae.tar.bz2 scummvm-rg350-9052a16887f21190865812cbe887b250d91074ae.zip |
GRAPHICS: MACGUI: Use Common::String for addMenuItem and addMenuSubItem
Diffstat (limited to 'graphics/macgui')
-rw-r--r-- | graphics/macgui/macmenu.cpp | 10 | ||||
-rw-r--r-- | graphics/macgui/macmenu.h | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp index 97ad2a6d98..a966f98616 100644 --- a/graphics/macgui/macmenu.cpp +++ b/graphics/macgui/macmenu.cpp @@ -75,7 +75,7 @@ struct MacMenuSubItem { bool enabled; Common::Rect bbox; - MacMenuSubItem(const char *t, int a, int s = 0, char sh = 0, bool e = true) : text(t), unicode(false), action(a), style(s), shortcut(sh), enabled(e) {} + MacMenuSubItem(const Common::String &t, int a, int s = 0, char sh = 0, bool e = true) : text(t), unicode(false), action(a), style(s), shortcut(sh), enabled(e) {} MacMenuSubItem(const Common::U32String &t, int a, int s = 0, char sh = 0, bool e = true) : unicodeText(t), unicode(true), action(a), style(s), shortcut(sh), enabled(e) {} }; @@ -89,7 +89,7 @@ struct MacMenuItem { Common::Rect bbox; Common::Rect subbbox; - MacMenuItem(const char *n) : name(n), unicode(false) {} + MacMenuItem(const Common::String &n) : name(n), unicode(false) {} MacMenuItem(const Common::U32String &n) : unicodeName(n), unicode(true) {} }; @@ -260,7 +260,7 @@ void MacMenu::addStaticMenus(const MacMenuData *data) { calcDimensions(); } -int MacMenu::addMenuItem(const char *name) { +int MacMenu::addMenuItem(const Common::String &name) { MacMenuItem *i = new MacMenuItem(name); _items.push_back(i); @@ -274,7 +274,7 @@ int MacMenu::addMenuItem(const Common::U32String &name) { return _items.size() - 1; } -void MacMenu::addMenuSubItem(int id, const char *text, int action, int style, char shortcut, bool enabled) { +void MacMenu::addMenuSubItem(int id, const Common::String &text, int action, int style, char shortcut, bool enabled) { _items[id]->subitems.push_back(new MacMenuSubItem(text, action, style, shortcut, enabled)); calcMenuBounds(_items[id]); @@ -378,7 +378,7 @@ void MacMenu::createSubMenuFromString(int id, const char *str, int commandId) { } } - menu->subitems.push_back(new MacMenuSubItem(item.c_str(), commandId, style, shortcut, enabled)); + menu->subitems.push_back(new MacMenuSubItem(item, commandId, style, shortcut, enabled)); } item.clear(); diff --git a/graphics/macgui/macmenu.h b/graphics/macgui/macmenu.h index 717a0ce835..388e662938 100644 --- a/graphics/macgui/macmenu.h +++ b/graphics/macgui/macmenu.h @@ -57,9 +57,9 @@ public: void addStaticMenus(const MacMenuData *data); void calcDimensions(); - int addMenuItem(const char *name); + int addMenuItem(const Common::String &name); int addMenuItem(const Common::U32String &name); - void addMenuSubItem(int id, const char *text, int action, int style = 0, char shortcut = 0, bool enabled = true); + void addMenuSubItem(int id, const Common::String &text, int action, int style = 0, char shortcut = 0, bool enabled = true); void addMenuSubItem(int id, const Common::U32String &text, int action, int style = 0, char shortcut = 0, bool enabled = true); void createSubMenuFromString(int id, const char *string, int commandId); void clearSubMenu(int id); |