mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-07 18:07:49 +02:00
fcl-db: Fix SetBufListSize
This commit is contained in:
parent
a8fc74c941
commit
13ad0dfd3f
@ -1084,6 +1084,7 @@ type
|
||||
FBeforeScroll: TDataSetNotifyEvent;
|
||||
FBlobFieldCount: Longint;
|
||||
FBuffers : TBuffers;
|
||||
// The actual length of FBuffers is FBufferCount+1
|
||||
FBufferCount: Longint;
|
||||
FConstraints: TCheckConstraints;
|
||||
FDisableControlsCount : Integer;
|
||||
@ -1119,7 +1120,6 @@ type
|
||||
Procedure DoInsertAppend(DoAppend : Boolean);
|
||||
Procedure DoInternalOpen;
|
||||
Function GetBuffer (Index : longint) : TDataRecord;
|
||||
function GetBufferCount: Longint;
|
||||
function GetDataProxy: TDataProxy;
|
||||
Procedure RegisterDataSource(ADataSource : TDataSource);
|
||||
procedure SetConstraints(Value: TCheckConstraints);
|
||||
@ -1247,7 +1247,7 @@ type
|
||||
property CurrentRecord: Longint read FCurrentRecord;
|
||||
property BlobFieldCount: Longint read FBlobFieldCount;
|
||||
property Buffers[Index: Longint]: TDataRecord read GetBuffer;
|
||||
property BufferCount: Longint read GetBufferCount;
|
||||
property BufferCount: Longint read FBufferCount;
|
||||
property CalcBuffer: TDataRecord read FCalcBuffer;
|
||||
property CalcFieldsCount: Longint read FCalcFieldsCount;
|
||||
property InternalCalcFields: Boolean read FInternalCalcFields;
|
||||
@ -2776,11 +2776,6 @@ begin
|
||||
Result:=FBuffers[Index];
|
||||
end;
|
||||
|
||||
function TDataSet.GetBufferCount: Longint;
|
||||
begin
|
||||
Result:=Length(FBuffers);
|
||||
end;
|
||||
|
||||
function TDataSet.DoGetDataProxy: TDataProxy;
|
||||
|
||||
begin
|
||||
@ -3636,12 +3631,13 @@ begin
|
||||
If Value=FBufferCount Then
|
||||
exit;
|
||||
// Less buffers, shift buffers.
|
||||
if value>BufferCount then
|
||||
if value>FBufferCount then
|
||||
begin
|
||||
SetLength(FBuffers,Value+1); // FBuffers[FBufferCount] is used as a temp buffer
|
||||
For I:=FBufferCount to Value do
|
||||
FBuffers[i]:=AllocRecordBuffer;
|
||||
end
|
||||
else if value<BufferCount then
|
||||
else if value<FBufferCount then
|
||||
if (value>=0) and (FActiveRecord>Value-1) then
|
||||
begin
|
||||
for i := 0 to (FActiveRecord-Value) do
|
||||
@ -4850,7 +4846,7 @@ begin
|
||||
TempBuf := FBuffers[0];
|
||||
For I:=1 to FBufferCount do
|
||||
FBuffers[I-1]:=FBuffers[i];
|
||||
FBuffers[BufferCount]:=TempBuf;
|
||||
FBuffers[FBufferCount]:=TempBuf;
|
||||
end;
|
||||
|
||||
procedure TDataSet.ShiftBuffersForward;
|
||||
|
Loading…
Reference in New Issue
Block a user