From 4af3eca831b83882d245b051424bc47b41a35393 Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Sun, 14 Nov 2004 18:52:22 +0000 Subject: [PATCH] Prefer compile-time errors to run-time errors This was SVN commit r1311. --- source/gui/GUIutil.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/source/gui/GUIutil.cpp b/source/gui/GUIutil.cpp index 5ad67cf7c6..a843c65cb2 100755 --- a/source/gui/GUIutil.cpp +++ b/source/gui/GUIutil.cpp @@ -11,20 +11,13 @@ gee@pyro.nu using namespace std; -template -bool __ParseString(const CStr& Value, T &tOutput) -{ - // TODO Gee: Unsupported, report error/warning - return false; -} - template <> bool __ParseString(const CStr& Value, bool &Output) { - if (Value == (CStr)"true") + if (Value == "true") Output = true; else - if (Value == (CStr)"false") + if (Value == "false") Output = false; else return false; @@ -160,13 +153,13 @@ bool __ParseString(const CStr& Value, CSize &Output) template <> bool __ParseString(const CStr &Value, EAlign &Output) { - if (Value == (CStr)"left") + if (Value == "left") Output = EAlign_Left; else - if (Value == (CStr)"center") + if (Value == "center") Output = EAlign_Center; else - if (Value == (CStr)"right") + if (Value == "right") Output = EAlign_Right; else return false; @@ -177,13 +170,13 @@ bool __ParseString(const CStr &Value, EAlign &Output) template <> bool __ParseString(const CStr &Value, EVAlign &Output) { - if (Value == (CStr)"top") + if (Value == "top") Output = EVAlign_Top; else - if (Value == (CStr)"center") + if (Value == "center") Output = EVAlign_Center; else - if (Value == (CStr)"bottom") + if (Value == "bottom") Output = EVAlign_Bottom; else return false;