List index out of bounds when right-clicking empty part of report page designer
With FastReport VCL version 6.1.16, in the designer, when I right-click an empty part of a report page (or a dialog page, or the Data tab), when no other objects are selected, I get a "List index out of bounds (0)" error. I can see the error is occurring on this line in TfrxDesignerForm.PagePopupPopup, because FSelectedObjects has no items in it:
AddChildMI.Visible := (TObject(FSelectedObjects[0]) is TfrxBand) and
not (TObject(FSelectedObjects[0]) is TfrxColumnFooter) and
not (TObject(FSelectedObjects[0]) is TfrxOverlay);
In the previous version we were using, 5.4.1, right-clicking an empty part of a report page in the designer would open the menu with just the "Edit" option available, which opened the Page Options form.
The error doesn't occur if I right-click within the left or top margin of the report page in the designer. We can see when we left-click an empty part of the report designer, that the font toolbar clears/disables and the drop-down list of report components clears, as if FastReport thinks nothing is selected, but when we left-click within the left or top margin, it "selects" the TfrxReportPage. In 5.4.1, left-clicking on any empty part of the report page designer would "select" the TfrxReportPage, and you could even double-click to open the Page Options form.
So we can work-around the problem by right-clicking the left or top margin to get to the page's Edit option to open the Page Options form, but this is a bug that should be fixed.
AddChildMI.Visible := (TObject(FSelectedObjects[0]) is TfrxBand) and
not (TObject(FSelectedObjects[0]) is TfrxColumnFooter) and
not (TObject(FSelectedObjects[0]) is TfrxOverlay);
In the previous version we were using, 5.4.1, right-clicking an empty part of a report page in the designer would open the menu with just the "Edit" option available, which opened the Page Options form.
The error doesn't occur if I right-click within the left or top margin of the report page in the designer. We can see when we left-click an empty part of the report designer, that the font toolbar clears/disables and the drop-down list of report components clears, as if FastReport thinks nothing is selected, but when we left-click within the left or top margin, it "selects" the TfrxReportPage. In 5.4.1, left-clicking on any empty part of the report page designer would "select" the TfrxReportPage, and you could even double-click to open the Page Options form.
So we can work-around the problem by right-clicking the left or top margin to get to the page's Edit option to open the Page Options form, but this is a bug that should be fixed.
Comments