lyx  

Re: making sense of buffer/file structure

Lars Gullik Bjønnes
Tue, 6 Oct 1998 03:09:52 -0400

  >> Richard E Hawkins Esq writes:

  REHE> Is there somewhere where the file/buffer structure is actually
  REHE> explained?

  REHE> if so, i haven't found it. If I have this straight:

You have to decide if you are looking at 0.12 or 0.13, they are
beginning to be quite different.

  REHE> The top level is the buffer structure. This includes element
  REHE> text[] it also includes several LyxParagraph structures.

not true in 0.13, there it is BufferView that is the controlling
class. (actually this is true in 0.12 too)

  REHE> While structure.text is of type LyXText, the same charactares
  REHE> are available as *char in the LyxParagraphs, but these might
  REHE> not actually be characters, which can be checked by
  REHE> IsLetter(), IsInset(), and the like.

true, this is going to change.
To give characters special meenings is error prone.

  REHE> So if I change things in buffer.text, it will auutomatically
  REHE> be reflected in the paragraphs, unless I add new paragrph
  REHE> breaks, which I do have to deal with.

  REHE> So i can do my replacing by stepping through the buffer
  REHE> positions, and replacing text in the buffer. Or should I be
  REHE> stepping through paragraphs to do this, until i run out of
  REHE> paragraphs?

  REHE> Or am I as confused as i think i am?

Can you imgainge how confused we are :-)

look at the search & replace code that should give a few hints on how
to do this.

        Lgb