Skip to content

Commit

Permalink
Fixed #64: Instead of defining own TUIPropertyKey use TPropertyKey fr…
Browse files Browse the repository at this point in the history
…om unit "WinApi.ActiveX"
  • Loading branch information
Joachim Marder committed Sep 21, 2017
1 parent 93d951c commit 41419be
Showing 1 changed file with 2 additions and 39 deletions.
41 changes: 2 additions & 39 deletions Lib/UIRibbonApi.pas
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,8 @@ TPropVariantEx = record

{$REGION 'UIRibbonKeydef.h'}
type
TUIPropertyKey = packed record
public
FmtId: TGuid;
PId: DWord;
public
class operator Equal(const A, B: TUIPropertyKey): Boolean;
class operator Equal(const A: TUIPropertyKey; const B: TPropertyKey): Boolean;
class operator NotEqual(const A, B: TUIPropertyKey): Boolean;
class operator NotEqual(const A: TUIPropertyKey; const B: TPropertyKey): Boolean;
end;
PUIPropertyKey = ^TUIPropertyKey;
TUIPropertyKey = TPropertyKey;
PUIPropertyKey = PPropertyKey;

(*#define DEFINE_UIPROPERTYKEY(name, type, index) EXTERN_C \\
const PROPERTYKEY DECLSPEC_SELECTANY name = { { 0x00000000 + index, 0x7363, \\
Expand Down Expand Up @@ -659,32 +650,6 @@ implementation
SysUtils,
WinApiEx;

{$REGION 'UIRibbonKeydef.h'}

{ TUIPropertyKey }

class operator TUIPropertyKey.Equal(const A, B: TUIPropertyKey): Boolean;
begin
Result := CompareMem(@A, @B, SizeOf(TUIPropertyKey));
end;

class operator TUIPropertyKey.Equal(const A: TUIPropertyKey;
const B: TPropertyKey): Boolean;
begin
Result := CompareMem(@A, @B, SizeOf(TUIPropertyKey));
end;

class operator TUIPropertyKey.NotEqual(const A, B: TUIPropertyKey): Boolean;
begin
Result := not CompareMem(@A, @B, SizeOf(TUIPropertyKey));
end;

class operator TUIPropertyKey.NotEqual(const A: TUIPropertyKey;
const B: TPropertyKey): Boolean;
begin
Result := not CompareMem(@A, @B, SizeOf(TUIPropertyKey));
end;
{$ENDREGION 'UIRibbonKeydef.h'}

{$REGION 'UIRibbon.h/idl'}
function UIHsb(const Hue, Saturation, Brightness: Byte): TUIHsbColor; inline;
Expand Down Expand Up @@ -883,7 +848,5 @@ function UIPropertyToIUnknownArrayAlloc(const Key: TUIPropertyKey; const PropVar
end;
{$ENDREGION 'UIRibbonPropertyHelpers.h'}

initialization
Assert(SizeOf(TUIPropertyKey) = SizeOf(TPropertyKey));

end.

0 comments on commit 41419be

Please sign in to comment.