TZAbstractDataset.InternalPost and BUG-FIX by bangfauzan
Moderators: gto, EgonHugeist
-
- Fresh Boarder
- Posts: 21
- Joined: 20.01.2010, 13:51
TZAbstractDataset.InternalPost and BUG-FIX by bangfauzan
The BUG-FIX by bangfauzan sets unused bookmarks.
This causes the events BeforeScroll and AfterScroll.
In fact the dataset is the same as before.
The events BeforeScroll and AfterScroll produce many problems in my application.
Is this BUG-FIX a bug?
Is this better?
Replace
- BookMark:=BM;
with
- If BookmarkValid(@BM) Then Begin
- InternalGotoBookmark(@BM);
- Resync([rmExact, rmCenter]);
- End;
This causes the events BeforeScroll and AfterScroll.
In fact the dataset is the same as before.
The events BeforeScroll and AfterScroll produce many problems in my application.
Is this BUG-FIX a bug?
Is this better?
Replace
- BookMark:=BM;
with
- If BookmarkValid(@BM) Then Begin
- InternalGotoBookmark(@BM);
- Resync([rmExact, rmCenter]);
- End;
-
- Fresh Boarder
- Posts: 21
- Joined: 20.01.2010, 13:51
I don't work with bookmarks. My changes avoid external events (OnBeforeScroll, OnAfterScroll), but the internal action is the same.
The bangfauzan bugfix is only meaningful if a valid bookmark exists.
My large application did not work with this bugfix.
With my changes up to now no errors occurred.
Greetings, Bernhard
The bangfauzan bugfix is only meaningful if a valid bookmark exists.
My large application did not work with this bugfix.
With my changes up to now no errors occurred.
Greetings, Bernhard
-
- Fresh Boarder
- Posts: 21
- Joined: 20.01.2010, 13:51
For checkin the complete code:
{BUG-FIX: bangfauzan addition}
if (SortedFields <> '') and not (doDontSortOnPost in Options) then
begin
FreeFieldBuffers;
SetState(dsBrowse);
Resync([]);
BM:=Bookmark;
DisableControls;
InternalSort;
//BookMark:=BM;
Try
If BookmarkValid(@BM) Then Begin
InternalGotoBookmark(@BM);
Resync([rmExact, rmCenter]);
End;
Finally
UpdateCursorPos;
EnableControls;
End;
end;
{end of bangfauzan addition}
Greetings, Bernhard
{BUG-FIX: bangfauzan addition}
if (SortedFields <> '') and not (doDontSortOnPost in Options) then
begin
FreeFieldBuffers;
SetState(dsBrowse);
Resync([]);
BM:=Bookmark;
DisableControls;
InternalSort;
//BookMark:=BM;
Try
If BookmarkValid(@BM) Then Begin
InternalGotoBookmark(@BM);
Resync([rmExact, rmCenter]);
End;
Finally
UpdateCursorPos;
EnableControls;
End;
end;
{end of bangfauzan addition}
Greetings, Bernhard
-
- Senior Boarder
- Posts: 50
- Joined: 31.08.2006, 10:41
- Contact:
-
- Fresh Boarder
- Posts: 21
- Joined: 20.01.2010, 13:51
I test the changes in Delphi 2010.
The first resync([]) sets the Bookmark to undefined values.
So I moved the check for a valid Bookmark to an earlier Position:
{ BUG-FIX: bangfauzan addition }
if (SortedFields <> '') and not(doDontSortOnPost in Options) then begin
If BookmarkValid(Bookmark) Then Begin
FreeFieldBuffers;
SetState(dsBrowse);
Resync([]);
BM := Bookmark;
DisableControls;
InternalSort;
// BookMark:=BM;
Try
InternalGotoBookmark(@BM);
Resync([rmExact, rmCenter]);
Finally
UpdateCursorPos;
EnableControls;
End;
End;
end;
{ end of bangfauzan addition }
The first resync([]) sets the Bookmark to undefined values.
So I moved the check for a valid Bookmark to an earlier Position:
{ BUG-FIX: bangfauzan addition }
if (SortedFields <> '') and not(doDontSortOnPost in Options) then begin
If BookmarkValid(Bookmark) Then Begin
FreeFieldBuffers;
SetState(dsBrowse);
Resync([]);
BM := Bookmark;
DisableControls;
InternalSort;
// BookMark:=BM;
Try
InternalGotoBookmark(@BM);
Resync([rmExact, rmCenter]);
Finally
UpdateCursorPos;
EnableControls;
End;
End;
end;
{ end of bangfauzan addition }
-
- Fresh Boarder
- Posts: 21
- Joined: 20.01.2010, 13:51
I test the changes in Delphi 2010.
The first resync([]) sets the Bookmark to undefined values.
So I moved the check for a valid Bookmark to an earlier Position:
{ BUG-FIX: bangfauzan addition }
if (SortedFields <> '') and not(doDontSortOnPost in Options) then begin
If BookmarkValid(Bookmark) Then Begin
FreeFieldBuffers;
SetState(dsBrowse);
Resync([]);
BM := Bookmark;
DisableControls;
InternalSort;
// BookMark:=BM;
Try
InternalGotoBookmark(@BM);
Resync([rmExact, rmCenter]);
Finally
UpdateCursorPos;
EnableControls;
End;
End;
end;
{ end of bangfauzan addition }
The first resync([]) sets the Bookmark to undefined values.
So I moved the check for a valid Bookmark to an earlier Position:
{ BUG-FIX: bangfauzan addition }
if (SortedFields <> '') and not(doDontSortOnPost in Options) then begin
If BookmarkValid(Bookmark) Then Begin
FreeFieldBuffers;
SetState(dsBrowse);
Resync([]);
BM := Bookmark;
DisableControls;
InternalSort;
// BookMark:=BM;
Try
InternalGotoBookmark(@BM);
Resync([rmExact, rmCenter]);
Finally
UpdateCursorPos;
EnableControls;
End;
End;
end;
{ end of bangfauzan addition }
-
- Fresh Boarder
- Posts: 21
- Joined: 20.01.2010, 13:51
In REV 800 BM is totally undefined
This code sniplet compiles on Delphi 7 and 2010:
{ BUG-FIX: bangfauzan addition }
if (SortedFields <> '') and not(doDontSortOnPost in Options) then begin
{$IFDEF DELPHI12_UP}
If BookmarkValid(Bookmark) Then
{$ELSE}
If BookmarkValid(PPointer(Bookmark)) Then
{$ENDIF}
Begin
FreeFieldBuffers;
SetState(dsBrowse);
Resync([]);
BM := Bookmark;
DisableControls;
InternalSort;
//BookMark := BM;
Try
InternalGotoBookmark(PPointer(BM));
Resync([rmExact, rmCenter]);
Finally
UpdateCursorPos;
EnableControls;
End;
End;
end;
{ end of bangfauzan addition }
Greetings, Bernhard
This code sniplet compiles on Delphi 7 and 2010:
{ BUG-FIX: bangfauzan addition }
if (SortedFields <> '') and not(doDontSortOnPost in Options) then begin
{$IFDEF DELPHI12_UP}
If BookmarkValid(Bookmark) Then
{$ELSE}
If BookmarkValid(PPointer(Bookmark)) Then
{$ENDIF}
Begin
FreeFieldBuffers;
SetState(dsBrowse);
Resync([]);
BM := Bookmark;
DisableControls;
InternalSort;
//BookMark := BM;
Try
InternalGotoBookmark(PPointer(BM));
Resync([rmExact, rmCenter]);
Finally
UpdateCursorPos;
EnableControls;
End;
End;
end;
{ end of bangfauzan addition }
Greetings, Bernhard