Browse Source

+ Fixed applyupdates for empty datasets

git-svn-id: trunk@2440 -
joost 19 years ago
parent
commit
bc4e23b9c2
1 changed files with 8 additions and 5 deletions
  1. 8 5
      fcl/db/bufdataset.inc

+ 8 - 5
fcl/db/bufdataset.inc

@@ -605,8 +605,10 @@ var SaveBookmark : Integer;
 
 begin
   CheckBrowseMode;
-  if IsEmpty then exit;
-  SaveBookMark := GetRecNo;
+  
+  // There is no bookmark available if the dataset is empty
+  if not IsEmpty then
+    SaveBookMark := GetRecNo;
 
   r := 0;
   while r < Length(FUpdateBuffer) do
@@ -652,12 +654,13 @@ begin
       end;
     inc(r);
     end;
-  if not GetDeleted(pbyte(FBBuffers[savebookmark])) then
+  if not IsEmpty then
     begin
     InternalGotoBookMark(@SaveBookMark);
     Resync([rmExact,rmCenter]);
-    end;
-
+    end
+  else
+    InternalFirst;
 end;
 
 procedure TBufDataset.InternalPost;