From 399627b95721e6542fc0ef1d586a7aafe21fa541 Mon Sep 17 00:00:00 2001 From: lordjaxom Date: Sun, 23 Jan 2005 19:43:28 +0000 Subject: - fixed returning the false string "" --- xml/type.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'xml') diff --git a/xml/type.h b/xml/type.h index d94a38c..85e4527 100644 --- a/xml/type.h +++ b/xml/type.h @@ -1,5 +1,5 @@ /* - * $Id: type.h,v 1.5 2005/01/07 21:50:54 lordjaxom Exp $ + * $Id: type.h,v 1.6 2005/01/23 19:43:28 lordjaxom Exp $ */ #ifndef VDR_TEXT2SKIN_XML_TYPE_H @@ -54,18 +54,18 @@ public: }; inline std::string cxType::String(void) const { - if (mType != string) - return (const char*)itoa(mNumber); - return mString; + switch (mType) { + case number: return (const char*)itoa(mNumber); + case boolean: return mNumber != 0 ? "1" : ""; + default: return mString; + } } inline cxType::operator bool () const { switch (mType) { - case string: - return mString != ""; - default: - return mNumber != 0; + case string: return mString != ""; + default: return mNumber != 0; } } -- cgit v1.2.3