trichview.com

trichview.support




SaveHTMLToStreamEx problem


Return to index


Author

Message

Andrej Sandorf

Posted: 02/24/2005 17:52:46


Hello Sergey,


i'm using the SaveHTMLToStreamEx function with a document including several

formatted hyperlinks. Theres are cases, where Richview is opening

<span>-tag before a <a>-tag, but not closing them. I stepped through the

source and found this:


unit CRVData

[...]

function TCustomRVData.SaveHTMLToStreamEx

[...]

procedure SaveMiddle

[...]

if HintAttr<>'' then

   RVWrite(Stream,'</span>');

if ATag<>'' then

   RVWrite(Stream,'</a>')

else

   if (CurFont<>-1) and

      ((i=Items.Count-1) or (GetItemTextStyleNo(i+1)<>TextStyleNo) or

      (not GetItem(i+1).SameAsPrev)) then begin

         RVWrite(Stream, '</span>');

         CurFont := -1;

   end;


which shows, if ATag is not empty, no </span> is written for those

<span>-tags, which are open because of CurFont.

So perhaps the "else" is not right?


Changed code:


if HintAttr<>'' then

   RVWrite(Stream,'</span>');

if ATag<>'' then

   RVWrite(Stream,'</a>');

if (CurFont<>-1) and

   ((i=Items.Count-1) or (GetItemTextStyleNo(i+1)<>TextStyleNo) or

   (not GetItem(i+1).SameAsPrev)) then begin

      RVWrite(Stream, '</span>');

      CurFont := -1;

end;


i hope my description is not too weird. could you please look at it?

changes worked for me, but maybe i missing something..


i'm using RichView 1.9.6 and Delphi2005.


regards

Andrej Sandorf





Powered by ABC Amber Outlook Express Converter