LazReport: Protecting dataset bookmarks on building report is now off by default (it should protect users from hitting sqldb bookmarks bugs see issue #26132 and issue #26146) could be enabled again with a report option.

git-svn-id: trunk@52241 -
This commit is contained in:
jesus 2016-04-24 01:16:55 +00:00
parent 05d443d108
commit 0e7a106ef0

View File

@ -90,7 +90,10 @@ type
TfrFrameBorders = set of TfrFrameBorder; TfrFrameBorders = set of TfrFrameBorder;
TfrFrameStyle = (frsSolid,frsDash, frsDot, frsDashDot, frsDashDotDot,frsDouble); TfrFrameStyle = (frsSolid,frsDash, frsDot, frsDashDot, frsDashDotDot,frsDouble);
TfrPageType = (ptReport, ptDialog); //todo: - remove this TfrPageType = (ptReport, ptDialog); //todo: - remove this
TfrReportOption = (roIgnoreFieldNotFound, roIgnoreSymbolNotFound, roHideDefaultFilter, roDontUpgradePreparedReport); TfrReportOption = (roIgnoreFieldNotFound, roIgnoreSymbolNotFound, roHideDefaultFilter,
roDontUpgradePreparedReport, // on saving an old prepared report don't update to current version
roSaveAndRestoreBookmarks // try to save and later restore dataset bookmarks on building report
);
TfrReportOptions = set of TfrReportOption; TfrReportOptions = set of TfrReportOption;
TfrObjectType = (otlReportView, otlUIControl); TfrObjectType = (otlReportView, otlUIControl);
@ -8548,10 +8551,13 @@ begin
inc(DetailCount); inc(DetailCount);
end; end;
if Assigned(MasterReport.OnFormPageBookmarks) then if roSaveAndRestoreBookmarks in MasterReport.Options theN
MasterReport.OnFormPageBookmarks(MasterReport, true) begin
else if Assigned(MasterReport.OnFormPageBookmarks) then
BackupBookmarks; MasterReport.OnFormPageBookmarks(MasterReport, true)
else
BackupBookmarks;
end;
HasGroups := Bands[btGroupHeader].Objects.Count > 0; HasGroups := Bands[btGroupHeader].Objects.Count > 0;
{$IFDEF DebugLR} {$IFDEF DebugLR}
@ -8560,10 +8566,14 @@ begin
{$ENDIF} {$ENDIF}
DisableControls; DisableControls;
DoLoop(1); DoLoop(1);
if Assigned(MasterReport.OnFormPageBookmarks) then
MasterReport.OnFormPageBookmarks(MasterReport, false) if roSaveAndRestoreBookmarks in MasterReport.Options then
else begin
RestoreBookmarks; // this also enablecontrols if Assigned(MasterReport.OnFormPageBookmarks) then
MasterReport.OnFormPageBookmarks(MasterReport, false)
else
RestoreBookmarks; // this also enablecontrols
end;
EnableControls; EnableControls;
if Mode = pmNormal then if Mode = pmNormal then