Browse Source

+ Latest patch from Micha Nelissen

michael 21 years ago
parent
commit
806c2ff3ee
1 changed files with 10 additions and 12 deletions
  1. 10 12
      fcl/db/dataset.inc

+ 10 - 12
fcl/db/dataset.inc

@@ -924,7 +924,7 @@ Function TDataset.ActiveBuffer: PChar;
 
 
 begin
 begin
 {$ifdef dsdebug}
 {$ifdef dsdebug}
-//  Writeln ('Active buffer requested. Returning:',ActiveRecord);
+  Writeln ('Active buffer requested. Returning:',ActiveRecord);
 {$endif}
 {$endif}
   Result:=FBuffers[ActiveRecord];
   Result:=FBuffers[ActiveRecord];
 end;
 end;
@@ -1573,15 +1573,15 @@ begin
 {$endif}
 {$endif}
     { throw an exception if not found.
     { throw an exception if not found.
       Normally the descendant should do this if DoCheck is true. }
       Normally the descendant should do this if DoCheck is true. }
-    If GetRecord(Fbuffers[FRecordCount-1],gmcurrent,True)<>grOk Then
+    If GetRecord(Fbuffers[0],gmcurrent,True)<>grOk Then
       DatabaseError(SNoSuchRecord,Self);
       DatabaseError(SNoSuchRecord,Self);
     end
     end
   else
   else
     { Can we find a record in the neighbourhood ?
     { Can we find a record in the neighbourhood ?
       Use Shortcut evaluation for this, or we'll have some funny results. }
       Use Shortcut evaluation for this, or we'll have some funny results. }
-    If (GetRecord(Fbuffers[FRecordCount-1],gmcurrent,True)<>grOk) and
-       (GetRecord(Fbuffers[FRecordCount-1],gmprior,True)<>grOk) and
-       (GetRecord(Fbuffers[FRecordCount-1],gmprior,True)<>grOk) then
+    If (GetRecord(Fbuffers[0],gmcurrent,True)<>grOk) and
+       (GetRecord(Fbuffers[0],gmprior,True)<>grOk) and
+       (GetRecord(Fbuffers[0],gmNext,True)<>grOk) then
        begin
        begin
 {$ifdef dsdebug}
 {$ifdef dsdebug}
        Writeln ('Resync: fuzzy resync');
        Writeln ('Resync: fuzzy resync');
@@ -1600,9 +1600,8 @@ begin
     // keep current position.
     // keep current position.
     ShiftCount:=FActiveRecord;
     ShiftCount:=FActiveRecord;
   // Reposition on 0
   // Reposition on 0
-  ShiftBuffers(0,FRecordCount-1);
 {$ifdef dsdebug}
 {$ifdef dsdebug}
-    Writeln ('Resync: activating buffers');
+  Writeln ('Resync: activating buffers');
 {$endif}
 {$endif}
   ActivateBuffers;
   ActivateBuffers;
   try
   try
@@ -1614,10 +1613,6 @@ begin
       Inc(Count);
       Inc(Count);
     FActiveRecord:=Count;
     FActiveRecord:=Count;
     // fill rest of buffers, adjust ActiveBuffer.
     // fill rest of buffers, adjust ActiveBuffer.
-{$ifdef dsdebug}
-    Writeln ('Resync: Set current record to ',FRecordCount,' records');
-{$endif}
-    SetCurrentRecord(FRecordCount-1);
     GetNextRecords;
     GetNextRecords;
     Inc(FActiveRecord,GetPriorRecords);
     Inc(FActiveRecord,GetPriorRecords);
   finally
   finally
@@ -1765,7 +1760,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.16  2004-08-02 15:13:42  michael
+  Revision 1.17  2004-08-03 19:08:48  michael
+  + Latest patch from Micha Nelissen
+
+  Revision 1.16  2004/08/02 15:13:42  michael
   + Patch from Micha Nelissen to implement Delete method
   + Patch from Micha Nelissen to implement Delete method
 
 
   Revision 1.15  2004/07/25 11:32:40  michael
   Revision 1.15  2004/07/25 11:32:40  michael