AngelicTech / thtmlviewer

Automatically exported from code.google.com/p/thtmlviewer
Other
1 stars 1 forks source link

THtmlViewer.Clear does not clear DocumentSource property #388

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which steps will reproduce the problem?
1. Load a HTML string
2. Call Clear
3. Check DocumentSource: it is still as it was before Clear

What is the expected output? What do you see instead?
I think that Clear should empty the string returned by DocumentSource

Which version of the product are you using? Which compiler version are you
using? On which operating system?

version 11.5 (Delphi 7)

Please attach test html files and screenshots, if appropriate.
Please provide any additional information:

In my own source code, in the Clear method. I added code to free and nil the 
FDocument object, and I added NIL checks for the FDocument wherever it is used 
(In a couple of places only). In this way, Clear also frees the FDocument 
object, which makes sense to me, and causes DocumentSource to return empty 
string after a Clear.

I would be happy to submit my source code for possible inclusion, but how do I 
do that? I'm rather new at this...

Thanks!

Original issue reported on code.google.com by manlio.m...@gmail.com on 5 Dec 2014 at 3:10

GoogleCodeExporter commented 9 years ago
Thanks for spotting this issue.

There should be no need for additional nil checks as the code already works 
with FDocument = nil before any document is loaded.

Original comment by OrphanCat on 30 Dec 2014 at 1:58

GoogleCodeExporter commented 9 years ago
r491 fixes this issue.

Original comment by OrphanCat on 30 Dec 2014 at 2:01