From 621d5507ff28165a39e9e606d2c8c1d10cedbd50 Mon Sep 17 00:00:00 2001 From: PeiYong Zhang <peiyongz@apache.org> Date: Tue, 31 Aug 2004 20:52:25 +0000 Subject: [PATCH] Return additional double value for decimal remove tz_hh/tz_mm git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@176016 13f79535-47bb-0310-9956-ffa450edef68 --- src/xercesc/framework/psvi/XSValue.cpp | 20 ++++++++++++++++---- src/xercesc/framework/psvi/XSValue.hpp | 10 ++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/xercesc/framework/psvi/XSValue.cpp b/src/xercesc/framework/psvi/XSValue.cpp index 1041abf64..82959a875 100644 --- a/src/xercesc/framework/psvi/XSValue.cpp +++ b/src/xercesc/framework/psvi/XSValue.cpp @@ -56,6 +56,10 @@ /* * $Log$ + * Revision 1.7 2004/08/31 20:52:25 peiyongz + * Return additional double value for decimal + * remove tz_hh/tz_mm + * * Revision 1.6 2004/08/31 15:14:47 peiyongz * remove XSValueContext * @@ -1209,6 +1213,7 @@ XSValue::getActValNumerics(const XMLCh* const content if (datatype == XSValue::dt_decimal) { + //Prepare for the quadruplet XMLBigDecimal data(content, manager); int totalDigit = data.getTotalDigit(); @@ -1248,6 +1253,14 @@ XSValue::getActValNumerics(const XMLCh* const content ) return 0; + //Prepare the double value + XMLDouble data2(content, manager); + if (data2.isDataConverted()) + { + status = st_InvalidRange; + return 0; + } + XSValue* retVal = new (manager) XSValue(manager); retVal->fData.f_decimal.f_sign = data.getSign(); @@ -1255,6 +1268,8 @@ XSValue::getActValNumerics(const XMLCh* const content retVal->fData.f_decimal.f_fraction = actValFract.f_ulong; retVal->fData.f_decimal.f_integral = actValInt.f_ulong; + retVal->fData.f_decimal.f_dvalue = data2.getValue(); + return retVal; } else if (datatype == XSValue::dt_float) @@ -1592,10 +1607,7 @@ XSValue::getActValDateTimes(const XMLCh* const content retVal->fData.f_datetime.f_hour = coreDate.fValue[XMLDateTime::Hour]; retVal->fData.f_datetime.f_min = coreDate.fValue[XMLDateTime::Minute]; retVal->fData.f_datetime.f_second = coreDate.fValue[XMLDateTime::Second]; - retVal->fData.f_datetime.f_milisec = coreDate.fValue[XMLDateTime::MiliSecond]; - retVal->fData.f_datetime.f_utc = coreDate.fValue[XMLDateTime::utc]; - retVal->fData.f_datetime.f_tz_hh = coreDate.fTimeZone[XMLDateTime::hh]; - retVal->fData.f_datetime.f_tz_mm = coreDate.fTimeZone[XMLDateTime::mm]; + retVal->fData.f_datetime.f_milisec = coreDate.fMiliSecond; return retVal; } diff --git a/src/xercesc/framework/psvi/XSValue.hpp b/src/xercesc/framework/psvi/XSValue.hpp index d0140bf35..000be5df5 100644 --- a/src/xercesc/framework/psvi/XSValue.hpp +++ b/src/xercesc/framework/psvi/XSValue.hpp @@ -56,6 +56,10 @@ /* * $Log$ + * Revision 1.7 2004/08/31 20:52:25 peiyongz + * Return additional double value for decimal + * remove tz_hh/tz_mm + * * Revision 1.6 2004/08/31 15:14:47 peiyongz * remove XSValueContext * @@ -236,10 +240,8 @@ public: int f_hour; int f_min; int f_second; - int f_milisec; - int f_utc; - int f_tz_hh; - int f_tz_mm; + double f_milisec; + } f_datetime; } fData; -- GitLab