From 6f120164ede32b4287ee13a51f39140b339fbe60 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 21 Nov 2007 13:58:30 +0000 Subject: INTEGRATION: CWS dba24c (1.30.132); FILE MERGED 2007/10/15 12:00:37 oj 1.30.132.1: #i78438# convert string to bool extended --- connectivity/source/commontools/FValue.cxx | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'connectivity/source') diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx index 84b2cfdc393b..bf5368744ca9 100644 --- a/connectivity/source/commontools/FValue.cxx +++ b/connectivity/source/commontools/FValue.cxx @@ -4,9 +4,9 @@ * * $RCSfile: FValue.cxx,v $ * - * $Revision: 1.30 $ + * $Revision: 1.31 $ * - * last change: $Author: obo $ $Date: 2006-09-17 01:58:37 $ + * last change: $Author: ihi $ $Date: 2007-11-21 14:58:30 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1035,9 +1035,26 @@ sal_Bool ORowSetValue::getBool() const { case DataType::CHAR: case DataType::VARCHAR: + case DataType::LONGVARCHAR: + { + const ::rtl::OUString sValue(m_aValue.m_pString); + const static ::rtl::OUString s_sTrue(RTL_CONSTASCII_USTRINGPARAM("true")); + const static ::rtl::OUString s_sFalse(RTL_CONSTASCII_USTRINGPARAM("false")); + if ( sValue.equalsIgnoreAsciiCase(s_sTrue) ) + { + bRet = sal_True; + break; + } + else if ( sValue.equalsIgnoreAsciiCase(s_sFalse) ) + { + bRet = sal_False; + break; + } + } + // run through case DataType::DECIMAL: case DataType::NUMERIC: - case DataType::LONGVARCHAR: + bRet = ::rtl::OUString(m_aValue.m_pString).toInt32() != 0; break; case DataType::BIGINT: -- cgit