mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 17:29:20 +02:00
* Fix for record no, recno tests pass
git-svn-id: trunk@30467 -
This commit is contained in:
parent
640efba580
commit
2412a2faa2
@ -509,8 +509,8 @@ function TFixedFormatDataSet.GetRecNo: Longint;
|
|||||||
var
|
var
|
||||||
BufPtr: TRecordBuffer;
|
BufPtr: TRecordBuffer;
|
||||||
begin
|
begin
|
||||||
Result := -1;
|
Result := 0;
|
||||||
if GetActiveRecBuf(BufPtr) then
|
if GetActiveRecBuf(BufPtr) and Not (State in dsEditModes) then
|
||||||
Result := PRecInfo(BufPtr + FRecInfoOfs)^.RecordNumber;
|
Result := PRecInfo(BufPtr + FRecInfoOfs)^.RecordNumber;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -737,7 +737,7 @@ begin
|
|||||||
FData[FCurRec] := BufToStore(ActiveBuffer);
|
FData[FCurRec] := BufToStore(ActiveBuffer);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
InternalAddRecord(ActiveBuffer, FALSE);
|
InternalAddRecord(ActiveBuffer, True);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFixedFormatDataSet.InternalEdit;
|
procedure TFixedFormatDataSet.InternalEdit;
|
||||||
@ -754,15 +754,24 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFixedFormatDataSet.InternalAddRecord(Buffer: Pointer; DoAppend: Boolean);
|
procedure TFixedFormatDataSet.InternalAddRecord(Buffer: Pointer; DoAppend: Boolean);
|
||||||
|
|
||||||
|
Var
|
||||||
|
I : Integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
FSaveChanges := TRUE;
|
FSaveChanges := TRUE;
|
||||||
Inc(FLastBookmark);
|
Inc(FLastBookmark);
|
||||||
if DoAppend then
|
if DoAppend then
|
||||||
|
begin
|
||||||
InternalLast;
|
InternalLast;
|
||||||
if (FCurRec >=0) then
|
|
||||||
FData.InsertObject(FCurRec, BufToStore(Buffer), TObject(Pointer(FLastBookmark)))
|
|
||||||
else
|
|
||||||
FData.AddObject(BufToStore(Buffer), TObject(Pointer(FLastBookmark)));
|
FData.AddObject(BufToStore(Buffer), TObject(Pointer(FLastBookmark)));
|
||||||
|
end
|
||||||
|
else if (FCurRec-FDataOffset>=0) then
|
||||||
|
begin
|
||||||
|
For I:=FCurRec+FDataOffset to FData.Count-1 do
|
||||||
|
FData.Objects[i]:=TObject(FCurRec+FDataOffset+1);
|
||||||
|
FData.InsertObject(FCurRec+FDataOffset, BufToStore(Buffer), TObject(Pointer(FCurRec)))
|
||||||
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFixedFormatDataSet.InternalGotoBookmark(ABookmark: Pointer);
|
procedure TFixedFormatDataSet.InternalGotoBookmark(ABookmark: Pointer);
|
||||||
|
Loading…
Reference in New Issue
Block a user