In Delphi 13 the Uses Clause Manager raised an access violation instead of opening:
Access violation at address 64015EDB in module 'GExpertsRS130.dll' (offset 155EDB). Read of address 00000000.
[64015EDB]{GExpertsRS130.dll} GX_OtaUtils.Ota.GetCurrentEditBufferPos + $4B
[73A8161B]{vcl370.bpl } Vcl.Controls.TControl.ScaleValue (Line 9196, "Vcl.Controls.pas")
[6400E717]{GExpertsRS130.dll} GX_OtaUtils.Ota.GetTopMostEditView + $4F
[64015E56]{GExpertsRS130.dll} GX_OtaUtils.Ota.GetCurrentEditPos + $3A
[64015E7B]{GExpertsRS130.dll} GX_OtaUtils.Ota.GetCurrentEditPos + $5F
[641081B8]{GExpertsRS130.dll} GX_UsesExpert.TfmUsesManager.ReadUsesList + $208
Steps:
The expert was started through GxInspect. Whether its menu entry or shortcut can start it in this state has not been checked.
Cause: TfmUsesManager.ReadUsesList calls Ota.GetCurrentEditBufferPos. That takes Ota.GetTopMostEditView, which returns nil when the source editor has no edit view, and then calls EditView.ConvertPos without checking for nil. Ota.GetCurrentEditPos checks for nil, Ota.GetCurrentEditBufferPos does not.
After Project > View Source had put the .dpr into the editor, the Uses Clause Manager opened normally. In Delphi 2007 the .dpr was shown in the editor at once, so this state did not occur there. Other versions have not been tried.
Found while testing bug [#553].
Fixed in [r6038]. The Uses Clause Manager now brings the current file into the editor before it opens when the file or the IDE has no edit view, as after opening a project in Delphi 13 while the Welcome Page is shown. Starting it from the form designer was not affected: it refuses there because the current file is the .dfm.
Related
Commit: [r6038]
Last edit: Thomas Mueller 1 day ago