* Improve HTML File detection

This commit is contained in:
Michaël Van Canneyt 2022-06-14 20:14:24 +02:00
parent 853114ab51
commit c06965e4aa

View File

@ -331,9 +331,14 @@ function TIDEHTMLTools.GetHTMLFileForComponent(aComponent: TComponent): String;
Var
aFile : TLazProjectFile;
begin
// See if a handler is registered for the component.
Result:=GetNameFromComponent(aComponent);
if Result='' then
// try a handler for the form on which the component is dropped
Result:=GetNameFromComponent(aComponent.Owner);
if Result='' then
begin
// Now try settings stored in project
aFile:=LazarusIDE.GetProjectFileWithRootComponent(aComponent.Owner);
if aFile=Nil then
aFile:=LazarusIDE.GetProjectFileWithRootComponent(aComponent);