lcl: TCustomBitBtn: do not store Glyph when set by Action, issue #27358, from BBaz

git-svn-id: trunk@47523 -
This commit is contained in:
mattias 2015-01-26 11:02:42 +00:00
parent 7832ffec7f
commit 04725947e0

View File

@ -100,10 +100,20 @@ begin
end;
function TCustomBitBtn.IsGlyphStored: Boolean;
var
act: TCustomAction;
begin
Result := (Kind = bkCustom) and (FButtonGlyph.Glyph <> nil)
and (not FButtonGlyph.Glyph.Empty)
and (FButtonGlyph.Glyph.Width>0) and (FButtonGlyph.Glyph.Height>0);
if Action <> nil then
begin
result := true;
act := TCustomAction(Action);
if (act.ActionList <> nil) and (act.ActionList.Images <> nil) and
(act.ImageIndex >= 0) and (act.ImageIndex < act.ActionList.Images.Count) then
result := false;
end
else Result := (Kind = bkCustom) and (FButtonGlyph.Glyph <> nil)
and (not FButtonGlyph.Glyph.Empty)
and (FButtonGlyph.Glyph.Width>0) and (FButtonGlyph.Glyph.Height>0);
end;
procedure TCustomBitBtn.SetGlyph(AValue: TBitmap);