dbertoni 01/03/29 14:11:14
Modified: c/src/PlatformSupport DOMStringHelper.cpp
Log:
Better implementation for TranscodeFromLocalCodePage. Changed
DOMStringToDouble to use long conversion when possible.
Revision Changes Path
1.53 +9 -10 xml-xalan/c/src/PlatformSupport/DOMStringHelper.cpp
Index: DOMStringHelper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DOMStringHelper.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- DOMStringHelper.cpp 2001/02/16 19:44:39 1.52
+++ DOMStringHelper.cpp 2001/03/29 22:11:12 1.53
@@ -1075,23 +1075,18 @@
{
assert(data != 0);
+ XalanDOMCharVectorType theResult;
+
if (fTranscode == true)
{
- XalanDOMChar* theTranscodedData = XMLString::transcode(data);
-
- const XalanArrayAutoPtr<XalanDOMChar>
theJanitor(theTranscodedData);
-
// Create a vector which includes the terminating 0.
-
- return MakeXalanDOMCharVector(theTranscodedData);
+ TranscodeFromLocalCodePage(data, theResult, true);
}
else
{
// Include the terminating null byte...
const unsigned int theLength = strlen(data) + 1;
- XalanDOMCharVectorType theResult;
-
theResult.reserve(theLength);
#if defined(XALAN_NO_ALGORITHMS_WITH_BUILTINS)
@@ -1105,9 +1100,9 @@
data + theLength,
back_inserter(theResult));
#endif
-
- return theResult;
}
+
+ return theResult;
}
@@ -1472,6 +1467,10 @@
else if (DoubleSupport::isPositiveZero(theDouble) == true)
{
theResult = thePositiveZeroString;
+ }
+ else if (long(theDouble) == theDouble)
+ {
+ LongToDOMString(long(theDouble), theResult);
}
else
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]