You've already forked lazarus-ccr
thtmlport: Fixes a crash
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1922 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -651,10 +651,14 @@ begin
|
|||||||
if cchMultiByte < 0 then {Null terminated?}
|
if cchMultiByte < 0 then {Null terminated?}
|
||||||
s := lpMultiByteStr
|
s := lpMultiByteStr
|
||||||
else
|
else
|
||||||
|
begin
|
||||||
|
if lpMultiByteStr = nil then s := ''
|
||||||
|
else
|
||||||
begin
|
begin
|
||||||
SetLength(s, cchMultiByte);
|
SetLength(s, cchMultiByte);
|
||||||
Move(lpMultiByteStr^, s[1], cchMultiByte);
|
Move(lpMultiByteStr^, s[1], cchMultiByte);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
if CodePage = CP_UTF8 then
|
if CodePage = CP_UTF8 then
|
||||||
begin
|
begin
|
||||||
w := UTF8Decode(s);
|
w := UTF8Decode(s);
|
||||||
|
@@ -693,12 +693,11 @@ var
|
|||||||
ExtS: TSize;
|
ExtS: TSize;
|
||||||
Ints: ^Integers;
|
Ints: ^Integers;
|
||||||
L, H, I: integer;
|
L, H, I: integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Extent := 0;
|
Extent := 0;
|
||||||
Result := 0;
|
Result := 0;
|
||||||
if (Width <= 0) or (Max = 0) then
|
if (Width <= 0) or (Max = 0) then
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
{$IFDEF MSWINDOWS} //Only compile if GetTextExtentExPointW exists
|
{$IFDEF MSWINDOWS} //Only compile if GetTextExtentExPointW exists
|
||||||
if not IsWin32Platform then
|
if not IsWin32Platform then
|
||||||
|
@@ -2438,13 +2438,12 @@ if ColorStrings = nil then
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ColorFromString(S: string; NeedPound: boolean; var Color: TColor): boolean;
|
|
||||||
{Translate StyleSheet color string to Color. If NeedPound is true, a '#' sign
|
{Translate StyleSheet color string to Color. If NeedPound is true, a '#' sign
|
||||||
is required to preceed a hexidecimal value.}
|
is required to preceed a hexidecimal value.}
|
||||||
|
function ColorFromString(S: string; NeedPound: boolean; var Color: TColor): boolean;
|
||||||
const
|
const
|
||||||
LastS: string = '?&%@';
|
LastS: string = '?&%@';
|
||||||
LastColor: TColor = 0;
|
LastColor: TColor = 0;
|
||||||
|
|
||||||
var
|
var
|
||||||
I, Rd, Bl: integer;
|
I, Rd, Bl: integer;
|
||||||
S1: string;
|
S1: string;
|
||||||
|
Reference in New Issue
Block a user