diff options
author | Einar Johan Trøan Sømåen | 2012-09-29 00:47:12 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-09-29 00:47:12 +0200 |
commit | afc21941e37a7481f5fe050d220968bdce43c873 (patch) | |
tree | f26f49578f9b10aa19aabcf8704f6e372a93c713 /engines/wintermute/ui/ui_object.cpp | |
parent | 67a7f5b3063c8d9634f43ee36ba26b18c2e6cd11 (diff) | |
download | scummvm-rg350-afc21941e37a7481f5fe050d220968bdce43c873.tar.gz scummvm-rg350-afc21941e37a7481f5fe050d220968bdce43c873.tar.bz2 scummvm-rg350-afc21941e37a7481f5fe050d220968bdce43c873.zip |
WINTERMUTE: Make scGetProperty use Common::String& instead of const char*
Diffstat (limited to 'engines/wintermute/ui/ui_object.cpp')
-rw-r--r-- | engines/wintermute/ui/ui_object.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/engines/wintermute/ui/ui_object.cpp b/engines/wintermute/ui/ui_object.cpp index 772561247d..8e5bae993c 100644 --- a/engines/wintermute/ui/ui_object.cpp +++ b/engines/wintermute/ui/ui_object.cpp @@ -360,13 +360,13 @@ bool UIObject::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack ////////////////////////////////////////////////////////////////////////// -ScValue *UIObject::scGetProperty(const char *name) { +ScValue *UIObject::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("ui_object"); return _scValue; } @@ -374,7 +374,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Name ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Name") == 0) { + else if (name == "Name") { _scValue->setString(getName()); return _scValue; } @@ -382,7 +382,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Parent (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Parent") == 0) { + else if (name == "Parent") { _scValue->setNative(_parent, true); return _scValue; } @@ -390,7 +390,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // ParentNotify ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "ParentNotify") == 0) { + else if (name == "ParentNotify") { _scValue->setBool(_parentNotify); return _scValue; } @@ -398,7 +398,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Width ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Width") == 0) { + else if (name == "Width") { _scValue->setInt(_width); return _scValue; } @@ -406,7 +406,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Height ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Height") == 0) { + else if (name == "Height") { _scValue->setInt(_height); return _scValue; } @@ -414,7 +414,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Visible ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Visible") == 0) { + else if (name == "Visible") { _scValue->setBool(_visible); return _scValue; } @@ -422,7 +422,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Disabled ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Disabled") == 0) { + else if (name == "Disabled") { _scValue->setBool(_disable); return _scValue; } @@ -430,7 +430,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Text ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Text") == 0) { + else if (name == "Text") { _scValue->setString(_text); return _scValue; } @@ -438,13 +438,13 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // NextSibling (RO) / PrevSibling (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "NextSibling") == 0 || strcmp(name, "PrevSibling") == 0) { + else if (name == "NextSibling" || name == "PrevSibling") { _scValue->setNULL(); if (_parent && _parent->_type == UI_WINDOW) { UIWindow *win = (UIWindow *)_parent; for (uint32 i = 0; i < win->_widgets.size(); i++) { if (win->_widgets[i] == this) { - if (strcmp(name, "NextSibling") == 0) { + if (name == "NextSibling") { if (i < win->_widgets.size() - 1) { _scValue->setNative(win->_widgets[i + 1], true); } |