win32: edit, spin edit: fix changing font at runtime. Issue #29873

git-svn-id: trunk@52030 -
This commit is contained in:
ondrej 2016-03-23 20:59:08 +00:00
parent fdeb9c3110
commit 4b6594212f
2 changed files with 4 additions and 2 deletions

View File

@ -374,7 +374,8 @@ end;
class procedure TWin32WSCustomFloatSpinEdit.SetFont(
const AWinControl: TWinControl; const AFont: TFont);
begin
inherited SetFont(AWinControl, AFont);
if not WSCheckHandleAllocated(AWinControl, 'SetFont') then Exit;
TWin32WSWinControl.SetFont(AWinControl, AFont);
ApplyMargins(AWinControl);
end;

View File

@ -1242,7 +1242,8 @@ end;
class procedure TWin32WSCustomEdit.SetFont(const AWinControl: TWinControl;
const AFont: TFont);
begin
inherited SetFont(AWinControl, AFont);
if not WSCheckHandleAllocated(AWinControl, 'SetFont') then Exit;
TWin32WSWinControl.SetFont(AWinControl, AFont);
ApplyMargins(AWinControl);
end;