>
> I wonder why we need so many change records during a file load/import
> operation.
>
> Does AbiWord need to identify changes in the document during such an
> operation?
>
> Isn't it an atomic operation? So only one change record needs to be
> retrieved/assigned for the entire load file. Please enlighten me if I'm
> wrong or missed some/several cases.
>
Hi Johnny,
AbiWord re-uses the same code for many different operations.
Our PieceTable is our model, the change records are used to construct
views of the model.
What happens is that after loading the document, the fl_DocLayout class
initiates the process of walking through the piecetable. It does this by
creating an fl_DocListener class. This fl_DocListener class is attached to
the piecetable (the model). AbiWord then itterates through piecetable.
Each fragment (pf_Frag) of the piecetable broadcasts a representation of
itself by emiting an appropriate changeRecord and calling a method on the
fl_DocListener class. The Listener class uses information in the
changeRecord and the method in fl_DocListener class to construct the
logical view.
So we use the changeRecords to construct the view. They are normally a
very inexpensive means of achieve this and are deleted after use in this
case.
We also use the same mechanism to export the piecetable to different file
formats. (Instead of contructing a view the changerecord info is
translated into the appropriate file-format.)
I hope all this helps. Have a look at
text/ptbl/xp/pd_Document.cpp::tellAndMaybeAddListner(...)
Cheers
Martin
> Thx,
> J
>
>>From: Tomas Frydrych <tomasfrydrych@yahoo.co.uk>
>>To: abidevlist <abiword-dev@abisource.com>
>>Subject: Re: load time regression: Re: commit: Change Record UUID's
>>Date: Mon, 24 Oct 2005 18:14:51 +0100
>>
>>
>>
>>As for the change record ids, I simply used the existing uuid class for
>>this because it was convenient and because we needed it without messing
>> too
>>much with the code; the offending code should definitely be #if 0 from
>> the
>>2.4.1 branch.
>>
>>Tomas
>>
>>
>
>
>
Received on Sat Oct 29 01:24:29 2005
This archive was generated by hypermail 2.1.8 : Sat Oct 29 2005 - 01:24:29 CEST