lowercase: Fixes disalligned chars for

git-svn-id: trunk@32852 -
This commit is contained in:
sekelsenmat 2011-10-12 12:50:38 +00:00
parent 2640733df3
commit dc435d6380

View File

@ -1176,7 +1176,6 @@ var
// Language identification // Language identification
IsTurkish: Boolean; IsTurkish: Boolean;
c: Char; c: Char;
begin begin
Result:=AInStr; Result:=AInStr;
InStr := PChar(AInStr); InStr := PChar(AInStr);
@ -1238,7 +1237,6 @@ begin
// $C39F: ß already lowercase // $C39F: ß already lowercase
#$C3: #$C3:
begin begin
// $C39F: ß already lowercase
if InStr[1] in [#$80..#$9E] then if InStr[1] in [#$80..#$9E] then
begin begin
if (CounterDiff <> 0) then OutStr^ := InStr[0]; if (CounterDiff <> 0) then OutStr^ := InStr[0];
@ -1366,13 +1364,10 @@ begin
if (CounterDiff <> 0) then OutStr^ := InStr[0]; if (CounterDiff <> 0) then OutStr^ := InStr[0];
OutStr[1] := chr(ord(c) + 1); OutStr[1] := chr(ord(c) + 1);
end end
else else if (CounterDiff <> 0) then
begin begin
if (CounterDiff <> 0) then OutStr^ := InStr[0];
begin OutStr[1] :=c;
OutStr^ := InStr[0];
OutStr[1] :=c;
end;
end; end;
inc(InStr, 2); inc(InStr, 2);
inc(OutStr, 2); inc(OutStr, 2);
@ -1428,20 +1423,15 @@ begin
#$D1: #$D1:
begin begin
c := InStr[1]; c := InStr[1];
case c of if (c in [#$A0..#$BF]) and (ord(c) mod 2 = 0) then
#$A0..#$BF: begin
begin if (CounterDiff <> 0) then OutStr^ := InStr[0];
if ord(c) mod 2 = 0 then OutStr[1] := chr(ord(c) + 1);
begin end
if (CounterDiff <> 0) then OutStr^ := InStr[0]; else if (CounterDiff <> 0) then
OutStr[1] := chr(ord(c) + 1); begin
end OutStr^ := InStr[0];
else if (CounterDiff <> 0) then OutStr[1] := c;
begin
OutStr^ := InStr[0];
OutStr[1] := c;
end;
end;
end; end;
inc(InStr, 2); inc(InStr, 2);
inc(OutStr, 2); inc(OutStr, 2);
@ -1458,7 +1448,8 @@ begin
OutStr[1] := chr(ord(c) + 1); OutStr[1] := chr(ord(c) + 1);
end; end;
// #$81 is already lowercase // #$81 is already lowercase
#$81: // #$82-#$89 ???
#$81..#$89:
begin begin
if (CounterDiff <> 0) then if (CounterDiff <> 0) then
begin begin
@ -1466,7 +1457,6 @@ begin
OutStr[1] := c; OutStr[1] := c;
end; end;
end; end;
// #$82-#$89 ???
#$8A..#$BF: #$8A..#$BF:
begin begin
if ord(c) mod 2 = 0 then if ord(c) mod 2 = 0 then
@ -1485,11 +1475,10 @@ begin
inc(OutStr, 2); inc(OutStr, 2);
end; end;
else else
// Copy the character if the string was disaligned by previous changes // Copy the character if the string was disaligned by previous changes
if (CounterDiff <> 0) then if (CounterDiff <> 0) then OutStr^:=c;
OutStr^:=c; inc(InStr);
inc(InStr); inc(OutStr);
inc(OutStr);
end; // Case InStr^ end; // Case InStr^
end; // while end; // while