Browse Source

+ fix bug #7266

git-svn-id: trunk@4503 -
joost 19 years ago
parent
commit
b0325225c3
1 changed files with 3 additions and 5 deletions
  1. 3 5
      fcl/db/dataset.inc

+ 3 - 5
fcl/db/dataset.inc

@@ -1309,10 +1309,7 @@ Procedure TDataset.DoInsertAppend(DoAppend : Boolean);
 
 
   // Put bookmark in edit buffer.
   // Put bookmark in edit buffer.
   if FRecordCount=0 then
   if FRecordCount=0 then
-    begin
-    fEOF := false;
-    SetBookmarkFlag(ActiveBuffer,bfBOF)
-    end
+    SetBookmarkFlag(ActiveBuffer,bfEOF)
   else
   else
     begin
     begin
     fBOF := false;
     fBOF := false;
@@ -1574,7 +1571,8 @@ end;
 Function TDataset.IsEmpty: Boolean;
 Function TDataset.IsEmpty: Boolean;
 
 
 begin
 begin
-  Result:=(Bof and Eof);
+  Result:=(fBof and fEof) and
+          (not (state = dsinsert)); // After an insert on an empty dataset, both fBof and fEof are true
 end;
 end;
 
 
 Function TDataset.IsLinkedTo(ADataSource: TDataSource): Boolean;
 Function TDataset.IsLinkedTo(ADataSource: TDataSource): Boolean;