Skip to content

Commit 3232c7f

Browse files
committed
Fix LCLCocoa "Range check error" in InitializeGlobalStructures #12
1 parent 3b763c5 commit 3232c7f

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

Source/VirtualTrees.pas

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ interface
251251
CF_VRTFNOOBJS, // Unfortunately CF_RTF* is already defined as being
252252
// registration strings so I have to use different identifiers.
253253
CF_HTML,
254-
CF_CSV: Word;
254+
CF_CSV: TClipboardFormat;
255255

256256
MMXAvailable: Boolean; // necessary to know because the blend code uses MMX instructions
257257
IsWinVistaOrAbove: Boolean;
@@ -711,7 +711,7 @@ THitInfo = record
711711

712712
// OLE drag'n drop support
713713
TFormatEtcArray = array of TFormatEtc;
714-
TFormatArray = array of Word;
714+
TFormatArray = array of TClipboardFormat;
715715

716716
// IDataObject.SetData support
717717
TInternalStgMedium = packed record
@@ -3545,7 +3545,7 @@ TCustomVirtualStringTree = class(TBaseVirtualTree)
35453545
destructor Destroy(); override;
35463546
function AddChild(Parent: PVirtualNode; UserData: Pointer = nil): PVirtualNode; override;
35473547
function ComputeNodeHeight(Canvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex; S: String = ''): Integer; virtual;
3548-
function ContentToClipboard(Format: Word; Source: TVSTTextSourceType): HGLOBAL;
3548+
function ContentToClipboard(Format: TClipboardFormat; Source: TVSTTextSourceType): HGLOBAL;
35493549
procedure ContentToCustom(Source: TVSTTextSourceType);
35503550
function ContentToHTML(Source: TVSTTextSourceType; const Caption: String = ''): String;
35513551
function ContentToRTF(Source: TVSTTextSourceType): AnsiString;
@@ -4082,8 +4082,8 @@ TVirtualDrawTree = class(TCustomVirtualDrawTree)
40824082
// OLE Clipboard and drag'n drop helper
40834083
procedure EnumerateVTClipboardFormats(TreeClass: TVirtualTreeClass; const List: TStrings); overload;
40844084
procedure EnumerateVTClipboardFormats(TreeClass: TVirtualTreeClass; var Formats: TFormatEtcArray); overload;
4085-
function GetVTClipboardFormatDescription(AFormat: Word): string;
4086-
procedure RegisterVTClipboardFormat(AFormat: Word; TreeClass: TVirtualTreeClass; Priority: Cardinal); overload;
4085+
function GetVTClipboardFormatDescription(AFormat: TClipboardFormat): string;
4086+
procedure RegisterVTClipboardFormat(AFormat: TClipboardFormat; TreeClass: TVirtualTreeClass; Priority: Cardinal); overload;
40874087
function RegisterVTClipboardFormat(Description: string; TreeClass: TVirtualTreeClass; Priority: Cardinal;
40884088
tymed: Integer = TYMED_HGLOBAL; ptd: PDVTargetDevice = nil; dwAspect: Integer = DVASPECT_CONTENT;
40894089
lindex: Integer = -1): Word; overload;
@@ -4390,8 +4390,8 @@ TClipboardFormatList = class
43904390
const AllowedFormats: TClipboardFormats = nil); overload;
43914391
procedure EnumerateFormats(TreeClass: TVirtualTreeClass; const Formats: TStrings); overload;
43924392
function FindFormat(FormatString: string): PClipboardFormatListEntry; overload;
4393-
function FindFormat(FormatString: string; var Fmt: Word): TVirtualTreeClass; overload;
4394-
function FindFormat(Fmt: Word; out Description: string): TVirtualTreeClass; overload;
4393+
function FindFormat(FormatString: string; var Fmt: TClipboardFormat): TVirtualTreeClass; overload;
4394+
function FindFormat(Fmt: TClipboardFormat; out Description: string): TVirtualTreeClass; overload;
43954395
end;
43964396

43974397
var
@@ -4572,7 +4572,7 @@ function TClipboardFormatList.FindFormat(FormatString: string): PClipboardFormat
45724572

45734573
//----------------------------------------------------------------------------------------------------------------------
45744574

4575-
function TClipboardFormatList.FindFormat(FormatString: string; var Fmt: Word): TVirtualTreeClass;
4575+
function TClipboardFormatList.FindFormat(FormatString: string; var Fmt: TClipboardFormat): TVirtualTreeClass;
45764576

45774577
var
45784578
I: Integer;
@@ -4594,7 +4594,7 @@ function TClipboardFormatList.FindFormat(FormatString: string; var Fmt: Word): T
45944594

45954595
//----------------------------------------------------------------------------------------------------------------------
45964596

4597-
function TClipboardFormatList.FindFormat(Fmt: Word; out Description: string): TVirtualTreeClass;
4597+
function TClipboardFormatList.FindFormat(Fmt: TClipboardFormat; out Description: string): TVirtualTreeClass;
45984598

45994599
var
46004600
I: Integer;
@@ -4667,7 +4667,7 @@ procedure EnumerateVTClipboardFormats(TreeClass: TVirtualTreeClass; var Formats:
46674667

46684668
//----------------------------------------------------------------------------------------------------------------------
46694669

4670-
function GetVTClipboardFormatDescription(AFormat: Word): string;
4670+
function GetVTClipboardFormatDescription(AFormat: TClipboardFormat): string;
46714671

46724672
begin
46734673
if InternalClipboardFormats = nil then
@@ -4678,7 +4678,7 @@ function GetVTClipboardFormatDescription(AFormat: Word): string;
46784678

46794679
//----------------------------------------------------------------------------------------------------------------------
46804680

4681-
procedure RegisterVTClipboardFormat(AFormat: Word; TreeClass: TVirtualTreeClass; Priority: Cardinal);
4681+
procedure RegisterVTClipboardFormat(AFormat: TClipboardFormat; TreeClass: TVirtualTreeClass; Priority: Cardinal);
46824682

46834683
// Registers the given clipboard format for the given TreeClass.
46844684

@@ -12235,7 +12235,7 @@ function TClipboardFormats.Add(const S: string): Integer;
1223512235
// ancestors.
1223612236

1223712237
var
12238-
Format: Word;
12238+
Format: TClipboardFormat;
1223912239
RegisteredClass: TVirtualTreeClass;
1224012240

1224112241
begin
@@ -12254,7 +12254,7 @@ procedure TClipboardFormats.Insert(Index: Integer; const S: string);
1225412254
// ancestors.
1225512255

1225612256
var
12257-
Format: Word;
12257+
Format: TClipboardFormat;
1225812258
RegisteredClass: TVirtualTreeClass;
1225912259

1226012260
begin

Source/include/intf/dummyolemethods.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ end;
289289

290290
//----------------------------------------------------------------------------------------------------------------------
291291

292-
function TCustomVirtualStringTree.ContentToClipboard(Format: Word; Source: TVSTTextSourceType): HGLOBAL;
292+
function TCustomVirtualStringTree.ContentToClipboard(Format: TClipboardFormat; Source: TVSTTextSourceType): HGLOBAL;
293293

294294
// This method constructs a shareable memory object filled with string data in the required format. Supported are:
295295
// CF_TEXT - plain ANSI text (Unicode text is converted using the user's current locale)

Source/include/intf/win32/olemethods.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ end;
283283

284284
//----------------------------------------------------------------------------------------------------------------------
285285

286-
function TCustomVirtualStringTree.ContentToClipboard(Format: Word; Source: TVSTTextSourceType): HGLOBAL;
286+
function TCustomVirtualStringTree.ContentToClipboard(Format: TClipboardFormat; Source: TVSTTextSourceType): HGLOBAL;
287287

288288
// This method constructs a shareable memory object filled with string data in the required format. Supported are:
289289
// CF_TEXT - plain ANSI text (Unicode text is converted using the user's current locale)

Source/units/dummyactivex.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
interface
99

1010
uses
11-
{$ifdef Windows} Windows, {$endif} Classes, SysUtils, Types;
11+
{$ifdef Windows} Windows, {$endif} Classes, SysUtils, LCLType, Types;
1212

1313
const
1414
TYMED_HGLOBAL = 1;
@@ -102,7 +102,7 @@ type
102102

103103

104104
tagFORMATETC = Record
105-
CfFormat : Word {TCLIPFORMAT};
105+
CfFormat : TClipboardFormat;
106106
Ptd : PDVTARGETDEVICE;
107107
dwAspect : DWORD;
108108
lindex : Long;

0 commit comments

Comments
 (0)