You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@locus.apache.org on 2000/07/25 16:42:29 UTC
cvs commit: xml-xalan/c/src/ICUBridge ICUBridgeCollationCompareFunctor.cpp
dbertoni 00/07/25 07:42:29
Modified: c/src/ICUBridge ICUBridgeCollationCompareFunctor.cpp
Log:
Added some code to work around DOMString issues.
Revision Changes Path
1.3 +19 -2 xml-xalan/c/src/ICUBridge/ICUBridgeCollationCompareFunctor.cpp
Index: ICUBridgeCollationCompareFunctor.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/ICUBridge/ICUBridgeCollationCompareFunctor.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ICUBridgeCollationCompareFunctor.cpp 2000/07/12 21:45:39 1.2
+++ ICUBridgeCollationCompareFunctor.cpp 2000/07/25 14:42:29 1.3
@@ -95,6 +95,10 @@
+static UChar dummy = 0;
+
+
+
int
ICUBridgeCollationCompareFunctor::operator()(
const XalanDOMChar* theLHS,
@@ -108,8 +112,21 @@
{
assert(m_collator != 0);
+#if defined(XALAN_ICU_BRIDGE_UCHAR_MISMATCH)
+ return m_collator->compare(
+ ICUBridge::XalanDOMCharStringToUnicodeString(lhs),
+ ICUBridge::XalanDOMCharStringToUnicodeString(rhs));
+#else
+ // $$$ ToDo: This code is necessary because DOMStrings can
+ // have a null representation.
+ const XalanDOMChar* const lhs = theLHS == 0 ? &dummy : theLHS;
+ const XalanDOMChar* const rhs = theRHS == 0 ? &dummy : theRHS;
+
return m_collator->compare(
- ICUBridge::XalanDOMCharStringToUnicodeString(theLHS),
- ICUBridge::XalanDOMCharStringToUnicodeString(theRHS));
+ lhs,
+ length(lhs),
+ rhs,
+ length(rhs));
+#endif
}
}