Open GoogleCodeExporter opened 9 years ago
Complemented by a description of the problem. The error is not the only reason.
The error occurs:
function THtmlViewer.FullDisplaySize(FormatWidth: Integer): TSize;
var
Curs: Integer;
CopyList: ThtDocument;
begin
Result.cx := 0; {error return}
Result.cy := 0;
if FormatWidth > 0 then
begin
CopyList := ThtDocument.CreateCopy(FSectionList);
try
Curs := 0;
Result.cy := CopyList.DoLogic(PaintPanel.Canvas, 0, FormatWidth, 300, 0, Result.cx, Curs);
finally
CopyList.Free; <====
end;
end;
end;
If you comment out this line the error occurs:
destructor ThtDocument.Destroy;
begin
inherited Destroy; // Yunqa.de: Destroy calls Clear, so do this first. <====
IDNameList.Free;
htmlFormList.Free;
MapList.Free;
AGifList.Free;
Timer.Free;
FormControlList.Free;
MissingImages.Free;
LinkList.Free;
PanelList.Free;
Styles.Free;
DrawList.Free;
PositionList.Free;
TabOrderList.Free;
if not IsCopy then
InlineList.Free;
FPropStack.Free;
end;
Probably error can occur anywhere where there is a release after the creation
of:
ThtDocument.CreateCopy(------);
But even if you comment out the line causing the error, the function creates a
metafile MakeMetaFile with errors and distortions of the structure.
I beg to fix the problem, it is critical. :)
Original comment by SchwarzK...@yandex.ru
on 21 Jan 2015 at 9:16
Attachments:
I do not know for what purpose respected author introduced the function:
procedure Add(var Section: TSection; TagIndex: Integer); overload;
But if you revert to the old version of the function:
procedure Add (Item: TSectionBase; TagIndex: Integer);
r499 from all works fine and without errors. Although the new function
logically identical.
The author will offer its own version fixes bugs, but now you can enjoy it. :)
Original comment by SchwarzK...@yandex.ru
on 29 Jan 2015 at 8:14
Good Day! When you fixed this bug? Thanks!
unit HTMLSubs;
type
THtmlNode = class(TIDObject)
private
+ FIsCopy: Boolean;
constructor THtmlNode.Create(Parent: TCellBasic; Attributes: TAttributeList; Properties: TProperties; const ID: ThtString);
...
inherited Create(ID);
+ FIsCopy := false;
constructor THtmlNode.CreateCopy(Parent: TCellBasic; Source: THtmlNode);
begin
inherited Create( Source.HtmlId );
+ FIsCopy := true;
destructor THtmlNode.Destroy;
begin
+ if not FIsCopy then
FAttributes.Free;
Original issue reported on code.google.com by
bruno.pe...@gmail.com
on 16 Jan 2015 at 3:03Attachments: