mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Work around access violations in SynEdit, fixes issue #2358.
This commit is contained in:
@@ -2834,7 +2834,7 @@ begin
|
||||
for i := 1 to Length(S) do
|
||||
begin
|
||||
inc(j);
|
||||
CountOfAvgGlyphs := Ceil(fTextDrawer.TextWidth(S[i]) / fCharWidth);
|
||||
CountOfAvgGlyphs := Ceil(fTextDrawer.TextWidth(S[i]) / Max(fCharWidth,1));
|
||||
|
||||
if j + CountOfAvgGlyphs > Length(Result) then
|
||||
SetLength(Result, Length(Result) + 128);
|
||||
|
||||
@@ -935,8 +935,12 @@ procedure TheTextDrawer.ExtTextOut(X, Y: Integer; Options: TTextOutOptions;
|
||||
end;
|
||||
|
||||
begin
|
||||
InitETODist(GetCharWidth);
|
||||
AdjustLastCharWidthAndRect;
|
||||
try
|
||||
InitETODist(GetCharWidth);
|
||||
AdjustLastCharWidthAndRect;
|
||||
except
|
||||
// Suppress error in threaded applications
|
||||
end;
|
||||
UniversalExtTextOut(FDC, X, Y, Options, ARect, Text, Length, FETODist);
|
||||
end;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user