trichview.com

trichview.support




Re: LoadRVFFromStream bug?


Return to index


Author

Message

John Ayres

Posted: 06/05/2003 23:33:27


<continued from previous post, not sure why it keeps cutting off>

{------------------------------------------------------------------------------}

function TCustomRVData.InsertRVFFromStream_(Stream: TStream;

                             var Index: Integer;

                             AParaNo: Integer;

                             AllowReplaceStyles, AppendMode, EditFlag: Boolean;

                             var Color: TColor;

                             Background: TRVBackground;

                             Layout: TRVLayoutInfo;

                             var NonFirstItemsAdded: Integer;

                             var Protect, FullReformat: Boolean):Boolean;

..

{this is line 3463 in CRVData.pas}

  InitStyleMappings(PTextStylesMapping, PParaStylesMapping, PListStylesMapping);

..

{------------------------------------------------------------------------------}

procedure TCustomRVData.InitStyleMappings(var PTextStylesMapping,

  PParaStylesMapping, PListStylesMapping: PRVIntegerList);

begin

  GetRootData.InitStyleMappings(PTextStylesMapping, PParaStylesMapping, PListStylesMapping);

end;

{------------------------------------------------------------------------------}

function TCustomRVData.GetRootData: TCustomRVData;

begin

  Result := Self;

end;


*********


As you can see, calling LoadRVFFromStream eventually leads to a call to InitStyleMappings,

which calls GetRootData.InitStyleMappings, causing it to return itself, which

callas InitStyleMappings, etc., etc., in a loop over and over until a stack

overflow error occurs.  Thus, there is no possible way that a TRichView component

can be loaded from a stream of any sort.  A fix for this would be most appreciated.





Powered by ABC Amber Outlook Express Converter