On Mon, 11 Nov 2002, Dr William Bland wrote:

> On Mon, Nov 11, 2002 at 08:31:19PM +1100, Martin Sevior wrote:
> > 
> > On Mon, 2002-11-11 at 20:33, Dr William Bland wrote:
> > > Hi all,
> > >   Ok, I've got the hang of stepping through a document, and now I've
> > > successfully made changes to its piecetable.  The missing link is
> > > re-displaying the document.
> > > 
> > > The following code works, but I can only see the changes if I save and
> > > re-load the document.  Otherwise the display doesn't get updated.
> > > Any hints gratefully received.
> > > 
> > > Best wishes,
> > >           Bill.
> > > 
> > > PS: Note that I added PT_BufIndex::changeBufIndex(), but it just does
> > > what you would expect.
> > > 
> > 
> > Please don't expect abiword to work like this. We go to great lengths
> > stop this sort of direct manipulations of the piecetable.
> > 
> > Use the accessor functions in Pd_Document.
> 
> Ok, I changed it to do everything using the Pd_Document functions and now
> it works fine.  I'm learning (slowly).
> 

Great! What you see on the screen is the fp* (Format Physical) classes 
interpretation of the fl_* (Format Layout) classes interpretations of the 
piecetable.

Manipulations of the piecetable through pd_Document methods get translated 
into action on these classes via the fl_DocListener class.

The manipulations on the piectable are also recorded into a Journal which 
gives the ability to unroll all the changes via undo/redo.

Cheers

Martin


Reply via email to