mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 17:50:19 +02:00
IDE: fixed crash if ANSI character map didn't contain a valid char values from Dmitry (issue #14189)
git-svn-id: trunk@21089 -
This commit is contained in:
parent
c87a7d7a49
commit
4956fbac7b
@ -161,7 +161,7 @@ begin
|
|||||||
if (Button = mbLeft) and (StringGrid1.MouseToGridZone(X, Y) = gzNormal) then
|
if (Button = mbLeft) and (StringGrid1.MouseToGridZone(X, Y) = gzNormal) then
|
||||||
begin
|
begin
|
||||||
StringGrid1.MouseToCell(X, Y, Col, Row);
|
StringGrid1.MouseToCell(X, Y, Col, Row);
|
||||||
if Assigned(OnInsertCharacter) then
|
if (StringGrid1.Cells[Col, Row] <> '') and (Assigned(OnInsertCharacter)) then
|
||||||
OnInsertCharacter(StringGrid1.Cells[Col, Row]);
|
OnInsertCharacter(StringGrid1.Cells[Col, Row]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -176,10 +176,15 @@ begin
|
|||||||
begin
|
begin
|
||||||
StringGrid1.MouseToCell(X, Y, Col, Row);
|
StringGrid1.MouseToCell(X, Y, Col, Row);
|
||||||
|
|
||||||
|
if StringGrid1.Cells[Col, Row] <> '' then
|
||||||
|
begin
|
||||||
CharOrd := Ord(UTF8ToAnsi(StringGrid1.Cells[Col, Row])[1]);
|
CharOrd := Ord(UTF8ToAnsi(StringGrid1.Cells[Col, Row])[1]);
|
||||||
CharInfoLabel.Caption := 'Decimal = ' + IntToStr(CharOrd) +
|
CharInfoLabel.Caption := 'Decimal = ' + IntToStr(CharOrd) +
|
||||||
', Hex = $' + HexStr(CharOrd, 2);
|
', Hex = $' + HexStr(CharOrd, 2);
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
CharInfoLabel.Caption := '-';
|
||||||
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
CharInfoLabel.Caption := '-';
|
CharInfoLabel.Caption := '-';
|
||||||
|
Loading…
Reference in New Issue
Block a user