Skip to content

Commit fad6f07

Browse files
committed
Adjust coding style and remove extra field introduced in #10
1 parent 00f3721 commit fad6f07

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

Source/VirtualTrees.pas

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,6 @@ TVTHeader = class(TPersistent)
12691269
FFixedAreaConstraints: TVTFixedAreaConstraints; // Percentages for the fixed area (header, fixed columns).
12701270
FImages: TCustomImageList;
12711271
FImageChangeLink: TChangeLink; // connections to the image list to get notified about changes
1272-
FSortDolumn: TColumnIndex;
12731272
{$IF LCL_FullVersion >= 2000000}
12741273
FImagesWidth: Integer;
12751274
{$IFEND}
@@ -5234,56 +5233,56 @@ function GetScalePercent: Integer;
52345233
end;
52355234
{$IFEND}
52365235

5237-
function BuildResourceName(ResourceName: String): String;
5236+
function BuildResourceName(const ResourceName: String): String;
52385237
var
5239-
percent: Integer;
5238+
Percent: Integer;
52405239
begin
52415240
Result := ResourceName;
52425241
{$IF LCL_FullVersion >= 2000000}
5243-
percent := GetScalePercent;
5244-
if percent = 150 then
5242+
Percent := GetScalePercent;
5243+
if Percent = 150 then
52455244
Result := Result + '_150'
5246-
else if percent <> 100 then
5245+
else if Percent <> 100 then
52475246
Result := Result + '_200';
52485247
{$IFEND}
52495248
end;
52505249

52515250
//----------------------------------------------------------------------------------------------------------------------
52525251

52535252
// Support resources with bmp as well as png
5254-
procedure LoadBitmapFromResource(ABitmap: TBitmap; AResName: String);
5253+
procedure LoadBitmapFromResource(Bitmap: TBitmap; const ResourceName: String);
52555254
var
5256-
bm: TCustomBitmap;
5255+
ResourceBitmap: TCustomBitmap;
52575256
begin
5258-
bm := CreateBitmapFromResourceName(0, BuildResourceName(AResName));
5257+
ResourceBitmap := CreateBitmapFromResourceName(0, BuildResourceName(ResourceName));
52595258
try
5260-
bm.Transparent := true;
5261-
ABitmap.Assign(bm);
5259+
ResourceBitmap.Transparent := True;
5260+
Bitmap.Assign(ResourceBitmap);
52625261
finally
5263-
bm.Free;
5262+
ResourceBitmap.Free;
52645263
end;
52655264
end;
52665265

52675266
function CreateCheckImageList(CheckKind: TCheckImageKind): TImageList;
52685267
{$IF LCL_FullVersion >= 2000000}
52695268
var
5270-
bm: TCustomBitmap;
5271-
resName: String;
5269+
Bitmap: TCustomBitmap;
5270+
ResourceName: String;
52725271
{$ENDIF}
52735272
begin
52745273
Result := TImageList.Create(nil);
52755274
Result.Height := 16;
52765275
Result.Width := 16;
52775276
{$IF LCL_FullVersion >= 2000000}
52785277
Result.RegisterResolutions([16, 24, 32]);
5279-
Result.Scaled := true;
5280-
resname := BuildResourceName(CheckImagesStrings[CheckKind]);
5281-
bm := CreateBitmapFromResourceName(0, resname);
5278+
Result.Scaled := True;
5279+
Resourcename := BuildResourceName(CheckImagesStrings[CheckKind]);
5280+
Bitmap := CreateBitmapFromResourceName(0, ResourceName);
52825281
try
5283-
bm.Transparent := true;
5284-
Result.AddSliced(bm, 25, 1);
5282+
Bitmap.Transparent := True;
5283+
Result.AddSliced(Bitmap, 25, 1);
52855284
finally
5286-
bm.Free;
5285+
Bitmap.Free;
52875286
end;
52885287
{$ELSE}
52895288
Result.AddResourceName(0, CheckImagesStrings[CheckKind], clFuchsia);

0 commit comments

Comments
 (0)