Browse Source

+ Small fix for close so it does not check browsemode

michael 21 years ago
parent
commit
06c3cc3bd0
2 changed files with 18 additions and 9 deletions
  1. 12 6
      fcl/db/dataset.inc
  2. 6 3
      fcl/db/db.pp

+ 12 - 6
fcl/db/dataset.inc

@@ -333,16 +333,16 @@ begin
     DoAfterOpen;
     DoAfterScroll;
   except
-    SetState(dsInactive);
-    DoInternalClose;
+    DoInternalClose(false);
     raise;
   end;
 end;
 
-Procedure TDataset.DoInternalClose;
+Procedure TDataset.DoInternalClose(DoCheck : Boolean);
 
 begin
-  CheckBrowsemode;
+  if DoCheck then
+    CheckBrowsemode;
   FreeFieldBuffers;
   ClearBuffers;
   SetBufListSize(-1);
@@ -665,7 +665,7 @@ begin
     If Value then
       DoInternalOpen
     else
-      DoInternalClose;
+      DoInternalClose(True);
   FActive:=Value;
 end;
 
@@ -701,6 +701,9 @@ begin
 {$endif}
 
   SetBufListSize(ABufferCount);
+{$ifdef dsdebug}
+  Writeln('Getting next buffers');
+{$endif}
   GetNextRecords;
 {$Ifdef dsDebug}
   WriteLn(
@@ -1723,7 +1726,10 @@ end;
 
 {
   $Log$
-  Revision 1.24  2004-09-26 16:55:24  michael
+  Revision 1.25  2004-10-10 14:25:21  michael
+  + Small fix for close so it does not check browsemode
+
+  Revision 1.24  2004/09/26 16:55:24  michael
   * big patch from Joost van der Sluis
    bufdataset.inc:
     fix getrecord (prior)

+ 6 - 3
fcl/db/db.pp

@@ -829,7 +829,7 @@ type
     FState : TDataSetState;
     Procedure DoInsertAppend(DoAppend : Boolean);
     Procedure DoInternalOpen;
-    Procedure DoInternalClose;
+    Procedure DoInternalClose(DoCheck : Boolean);
     Function  GetBuffer (Index : longint) : Pchar;
     Function  GetField (Index : Longint) : TField;
     Procedure RegisterDataSource(ADatasource : TDataSource);
@@ -1305,7 +1305,7 @@ type
     function GetBookmarkFlag(Buffer: PChar): TBookmarkFlag; override;
   {abstracts, must be overidden by descendents}
     function GetNextRecord(Buffer : pchar) : TGetResult; virtual; abstract;
-    function AllocRecord: PChar; virtual; abstract;
+    function AllocRecord(ExtraSize : integer): PChar; virtual; abstract;
     procedure FreeRecord(var Buffer: PChar); virtual; abstract;
   public
     constructor Create(AOwner: TComponent); override;
@@ -1572,7 +1572,10 @@ end.
 
 {
   $Log$
-  Revision 1.24  2004-09-26 16:55:24  michael
+  Revision 1.25  2004-10-10 14:25:21  michael
+  + Small fix for close so it does not check browsemode
+
+  Revision 1.24  2004/09/26 16:55:24  michael
   * big patch from Joost van der Sluis
    bufdataset.inc:
     fix getrecord (prior)