Access Violation in LR_Class procedure RestoreBookmarks (inside TfrPage.FormPage)
Original Reporter info from Mantis: eara
-
Reporter name: Stratis Aravias
Original Reporter info from Mantis: eara
- Reporter name: Stratis Aravias
Description:
As mentioned in
http://forum.lazarus.freepascal.org/index.php/topic,24471.msg147571/topicseen.html
and also in
http://forum.lazarus.freepascal.org/index.php/topic,24471.0.html
which resumes to
"
The boom is initiated when the .FormPage method tries to restore a detail dataset in the a previous aquired bookmark which may seem normal, but ...
now this bookmark is no longer valid since the detail dataset (in a master detail relationship) is changed due to scrolling of master dataset (the scrolls and other hocus pocus, are from preparing of the report).
So restoring to the stored bookmark position is not longer possible, since this bookmark is no longer valid.
"
procedure RestoreBookmarks;
var
n: Integer;
begin
for n:=0 to Length(BooksBkUp)-1 do
with BooksBkUp[n] do begin
Dataset.GotoBookMark(Bookmark); // <<< IS THIS BOOKMARKD VALID FOR A DETAIL DATASET ????
Dataset.FreeBookMark(Bookmark);
if DetailCount=0 then
Dataset.EnableControls;
end;
SetLength(BooksBkUp, 0);
end;
also
"
Anyway, if i simple comment this line , then i avoid the access violation, but! what side effects this will have? I don't know!
"
Steps to reproduce:
run my sample application under 1.2.2 RELEASE version, and try
1st. To print a single record (no problem)
2nd. To print all records (boom)
Mantis conversion info:
- Mantis ID: 26132
- OS: windows 7
- OS Build: 32bits
- Build: SVN Revision 44758
- Platform: 1.2.2 RELEASE WIN7 32 BITS
- Version: 1.2.2
- Fixed in version: 1.3 (SVN)
- Fixed in revision: 45037 (#5829cc4e)
- Target version: 1.4