From 970e191a457f94ff31316c423c6e977a206a3ab5 Mon Sep 17 00:00:00 2001 From: ondrej Date: Tue, 8 May 2018 20:50:40 +0000 Subject: [PATCH] LCL: LCLGlyphs: add IgnoreMissingResources git-svn-id: trunk@57849 - --- lcl/imglist.pp | 3 +++ lcl/include/imglist.inc | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/lcl/imglist.pp b/lcl/imglist.pp index ee621da4ca..c01e3280ea 100644 --- a/lcl/imglist.pp +++ b/lcl/imglist.pp @@ -433,6 +433,7 @@ type ImageIndex: Integer; // the image index in TLCLGlyphs end; private + FIgnoreMissingResources: Boolean; FImageIndexes: TAvgLvlTree; FLoadResolutions: array of Integer; public @@ -441,6 +442,8 @@ type constructor Create(AOwner: TComponent); override; destructor Destroy; override; + + property IgnoreMissingResources: Boolean read FIgnoreMissingResources write FIgnoreMissingResources; end; function LCLGlyphs: TLCLGlyphs; diff --git a/lcl/include/imglist.inc b/lcl/include/imglist.inc index 3fe8e0120c..bf1d69b0ea 100644 --- a/lcl/include/imglist.inc +++ b/lcl/include/imglist.inc @@ -2713,6 +2713,7 @@ begin FImageIndexes := TAvgLvlTree.Create(@TLCLGlyphs_TEntry_Compare); Scaled := True; + FIgnoreMissingResources := True; end; destructor TLCLGlyphs.Destroy; @@ -2729,6 +2730,10 @@ function TLCLGlyphs.GetImageIndex(const AResourceName: string): Integer; var G: TCustomBitmap; begin + if FIgnoreMissingResources and (ResolutionWidth<>Width) + and (FindResource(HInstance, PChar(AResourceName), RT_RCDATA)=0) then + Exit; + G := GetDefaultGlyph(AResourceName, MulDiv(ResolutionWidth, 100, 16)); try if ResolutionWidth=Width then