Skip to content

Commit c2e86aa

Browse files
author
Joachim Marder
committed
Fixed warnings: W1025 Unsupported language feature: 'class constructor'
1 parent 20a2fb0 commit c2e86aa

File tree

1 file changed

+8
-34
lines changed

1 file changed

+8
-34
lines changed

Lib/UIRibbonCommands.pas

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,6 @@ TUICommand = class abstract(TComponent, IUICommandHandler)
214214
procedure Notify(const Flag: Integer); virtual;
215215

216216
property Alive: Boolean read FAlive write SetAlive;
217-
public
218-
class constructor Create;
219-
class destructor Destroy;
220217
{$ENDREGION 'Internal Declarations'}
221218
public
222219
constructor Create(const Ribbon: TObject{TUIRibbon}; const CommandId: Cardinal); reintroduce; virtual;
@@ -1195,9 +1192,6 @@ TUIImage = class(TInterfacedObject, IUIImage)
11951192
private
11961193
{ IUIImage }
11971194
function GetBitmap: HBITMAP; safecall;
1198-
public
1199-
class constructor Create;
1200-
class destructor Destroy;
12011195
{$ENDREGION 'Internal Declarations'}
12021196
public
12031197
{ Creates an image from a resource. This must be a regular BITMAP resource. }
@@ -1858,11 +1852,6 @@ constructor TUICommand.Create(const Ribbon: TObject;
18581852
// FFramework.InvalidateUICommand(FCommandId, [UIInvalidationsProperty], @UI_PKEY_SmallImage);
18591853
end;
18601854

1861-
class constructor TUICommand.Create;
1862-
begin
1863-
FProperties := TUICommandExecutionProperties.Create;
1864-
end;
1865-
18661855
destructor TUICommand.Destroy;
18671856
begin
18681857
Notifier.Remove(Self);
@@ -1945,11 +1934,6 @@ procedure TUICommand.DoUpdate(const Prop: TUIProperty;
19451934
end;
19461935
end;
19471936

1948-
class destructor TUICommand.Destroy;
1949-
begin
1950-
FProperties.Free;
1951-
end;
1952-
19531937
function TUICommand.Execute(CommandId: UInt32; Verb: _UIExecutionVerb;
19541938
Key: PUIPropertyKey; CurrentValue: PPropVariant;
19551939
CommandExecutionProperties: IUISimplePropertySet): HRESULT;
@@ -4050,6 +4034,12 @@ function TUIRecentItem.GetPropertyValue(const Prop: TUIProperty): TValue;
40504034
constructor TUIImage.Create(const ResourceId: Integer);
40514035
begin
40524036
inherited Create;
4037+
if (FImageFactory = nil) then
4038+
begin
4039+
if not Succeeded(CoCreateInstance(CLSID_UIRibbonImageFromBitmapFactory, nil,
4040+
CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER, IUnknown, FImageFactory)) then
4041+
FImageFactory := nil;
4042+
end;
40534043
Load(ResourceId);
40544044
end;
40554045

@@ -4156,24 +4146,6 @@ function TUIImage.CreatePreMultipliedBitmap(const Bitmap: HBitmap): HBitmap;
41564146
end;
41574147
end;
41584148

4159-
class constructor TUIImage.Create;
4160-
var
4161-
Intf: IInterface;
4162-
begin
4163-
if (FImageFactory = nil) then
4164-
begin
4165-
if Succeeded(CoCreateInstance(CLSID_UIRibbonImageFromBitmapFactory, nil,
4166-
CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER, IUnknown, Intf))
4167-
then
4168-
FImageFactory := Intf as IUIImageFromBitmap;
4169-
end;
4170-
end;
4171-
4172-
class destructor TUIImage.Destroy;
4173-
begin
4174-
FImageFactory := nil;
4175-
end;
4176-
41774149
procedure TUIImage.DoChanged;
41784150
begin
41794151
if Assigned(FOnChanged) then
@@ -4354,8 +4326,10 @@ initialization
43544326
Initialize;
43554327
{$ENDIF}
43564328
Notifier := TNotifier.Create;
4329+
TUICommand.FProperties := TUICommandExecutionProperties.Create;
43574330

43584331
finalization
4332+
TUICommand.FProperties.Free;
43594333
Notifier.Free;
43604334

43614335
end.

0 commit comments

Comments
 (0)