HotURL contains Content-Type instead of URL
Original Reporter info from Mantis: Sei Lisa
-
Reporter name: Sei Lisa
Original Reporter info from Mantis: Sei Lisa
- Reporter name: Sei Lisa
Description:
In the OnHotClick event of a TIpHtmlPanel, the property HotURL should be set to the URL of the link clicked. However, it contains the Content-Type instead.
Steps to reproduce:
I've attached a test case, but here are the steps anyway:
- Create a new form.
- Drop a TIpHtmlPanel.
- Drop a TIpHtmlDataProvider.
- Set the DataProvider of the IpHtmlPanel to the IpHtmlDataProvider.
- In the form's OnCreate, add this code:
IpHtmlPanel1.SetHtmlFromStr('&LtPos;html>&LtPos;body>&LtPos;a href="X">X&LtPos;/a>&LtPos;/body>&LtPos;/html>');
- In the IpHtmlDataProvider's OnCheckURL, add this code:
Available := True;
ContentType := 'text/html';
- In the IpHtmlPanel's OnHotClick, add this code:
Application.MessageBox(PChar((Sender as TIpHtmlPanel).HotURL), 'HotURL');
- Run the application and click the 'X' link.
Actual result: "text/html" is shown.
Expected result: "X" should be shown.
Additional information:
Looks like someone reused a variable without noticing it was used later. I'll attach a patch. Compare that code to &LtPos;http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/turbopower_ipro/iphtml.pas?view=markup&root=lazarus&pathrev=53471#l14388 >, which is very similar and does the right thing.
Mantis conversion info:
- Mantis ID: 31030
- OS: Any
- OS Build: Any
- Build: 53471
- Platform: Any
- Version: 1.6.3 (SVN)
- Fixed in version: 1.6.4
- Fixed in revision: 53475 (#385348cd)
- Target version: 1.6.4