Преглед на файлове

--- Merging r30016 into '.':
U rtl/os2/sysucode.inc
--- Recording mergeinfo for merge of r30016 into '.':
U .
--- Merging r32270 into '.':
G rtl/os2/sysucode.inc
--- Recording mergeinfo for merge of r32270 into '.':
G .

# revisions: 30016,32270

git-svn-id: branches/fixes_3_0@33866 -

marco преди 9 години
родител
ревизия
05349cdb81
променени са 1 файла, в които са добавени 23 реда и са изтрити 9 реда
  1. 23 9
      rtl/os2/sysucode.inc

+ 23 - 9
rtl/os2/sysucode.inc

@@ -752,7 +752,8 @@ begin
   DefCpRec.OS2CP := CPArr [0];
 (* Find out WinCP _without_ considering RtlUsesWinCP *)
   I := 1;
-  while (I <= MaxNonEqualCPMapping) and (CpXList [I].OS2CP <> OS2CP) do
+  while (I <= MaxNonEqualCPMapping) and (CpXList [I].OS2CP <> DefCpRec.OS2CP)
+                                                                             do
    Inc (I);
   if CpXList [I].OS2CP = CPArr [0] then
    DefCpRec.WinCP := CpXList [I].WinCP
@@ -1260,11 +1261,21 @@ begin
   { UniStrColl interprets null chars as end-of-string -> filter out }
   HS1 := NoNullsUnicodeString (S1);
   HS2 := NoNullsUnicodeString (S2);
+(*
+  if coLingIgnoreCase in Options then
+   begin
+    HS1:=OS2UpperUnicodeString(HS1);
+    HS2:=OS2UpperUnicodeString(HS2);
+{$WARNING TODO: Exclude null characters and convert to uppercase in one-pass}
+   end
+  else
+*)
   if coIgnoreCase in Options then
-    begin
+   begin
     HS1:=OS2UpperUnicodeString(HS1);
     HS2:=OS2UpperUnicodeString(HS2);
-    end;
+{$WARNING TODO: Exclude null characters and convert to uppercase in one-pass}
+   end;
   Result := Sys_UniStrColl (DefLocObj, PWideChar (HS1), PWideChar (HS2));
   if Result < -1 then
    Result := -1
@@ -1273,12 +1284,14 @@ begin
 end;
 
 
+(*
 function OS2CompareTextUnicodeString (const S1, S2: UnicodeString): PtrInt;
 begin
   Result := OS2CompareUnicodeString (OS2UpperUnicodeString (S1),
                                                    OS2UpperUnicodeString (S2));
 {$WARNING Language independent uppercase routine may not be appropriate for language dependent case insensitive comparison!}
 end;
+*)
 
 
 function OS2UpperAnsiString (const S: AnsiString): AnsiString;
@@ -1327,8 +1340,7 @@ begin
   character.
 *)
   if UniAPI then
-   Result := OS2LowerUnicodeString (S)
-{ Two implicit conversions... ;-) }
+   Result := AnsiString (OS2LowerUnicodeString (UnicodeString (S)))
   else
    begin
     Result := S;
@@ -1362,7 +1374,8 @@ var
   I, MaxLen: PtrUInt;
 begin
   if UniAPI then
-   Result := OS2CompareUnicodeString (S1, S2) (* implicit conversions *)
+   Result := OS2CompareUnicodeString (UnicodeString (S1), UnicodeString (S2),
+                                                                            [])
   else
 (* Older OS/2 versions without Unicode support do not provide direct means *)
 (* for case sensitive and codepage and language-aware string comparison.   *)
@@ -1431,8 +1444,8 @@ begin
   HSA2 := AnsiString (S2);
   if UniApi then
    begin
-    HSU1 := HSA1; (* implicit conversion *)
-    HSU2 := HSA2; (* implicit conversion *)
+    HSU1 := UnicodeString (HSA1);
+    HSU2 := UnicodeString (HSA2);
     Result := Sys_UniStrColl (DefLocObj, PWideChar (HSU1), PWideChar (HSU2));
     if Result < -1 then
      Result := -1
@@ -1450,7 +1463,8 @@ var
   I: PtrUInt;
 begin
   if UniAPI then
-   Result := OS2CompareTextUnicodeString (S1, S2) (* implicit conversions *)
+   Result := OS2CompareUnicodeString (UnicodeString (S1), UnicodeString (S2),
+                                                                [coIgnoreCase])
   else
    begin
 (* Let's use collation strings here as a fallback *)