* Fixed cwstring for Android after latest widestring manager changes.

git-svn-id: trunk@32538 -
This commit is contained in:
yury 2015-11-26 18:14:26 +00:00
parent 17358aa3ed
commit 6f8e9ad23e

View File

@ -264,29 +264,17 @@ begin
Result:=_CompareStr(s1, s2);
exit;
end;
if (coIgnoreCase in Options) then begin
err:=0;
Result:=u_strCaseCompare(PUnicodeChar(s1), Length(s1), PUnicodeChar(s2), Length(s2), U_COMPARE_CODE_POINT_ORDER, err);
end
else begin
InitThreadData;
if (coIgnoreCase in Options) then
u_strCaseCompare(PUnicodeChar(s1), Length(s1), PUnicodeChar(s2), Length(s2), U_COMPARE_CODE_POINT_ORDER, err)
else
if DefColl <> nil then
Result:=ucol_strcoll(DefColl, PUnicodeChar(s1), Length(s1), PUnicodeChar(s2), Length(s2))
else
Result:=u_strCompare(PUnicodeChar(s1), Length(s1), PUnicodeChar(s2), Length(s2), True);
end;
function CompareTextUnicodeString(const s1, s2 : UnicodeString; Options : TCompareOptions): PtrInt;
const
U_COMPARE_CODE_POINT_ORDER = $8000;
var
err: UErrorCode;
begin
if hlibICU = 0 then begin
// fallback implementation
Result:=_CompareStr(UpperUnicodeString(s1), UpperUnicodeString(s2));
exit;
end;
err:=0;
Result:=u_strCaseCompare(PUnicodeChar(s1), Length(s1), PUnicodeChar(s2), Length(s2), U_COMPARE_CODE_POINT_ORDER, err);
end;
function UpperAnsiString(const s : AnsiString) : AnsiString;
@ -430,11 +418,6 @@ begin
Result:=CompareUnicodeString(s1, s2, Options);
end;
function CompareTextWideString(const s1, s2 : WideString): PtrInt;
begin
Result:=CompareTextUnicodeString(s1, s2,[coIgnoreCase]);
end;
Procedure SetCWideStringManager;
Var
CWideStringManager : TUnicodeStringManager;