On Wed, Sep 17, 2003 at 07:54:48PM +0200, Lars Gullik Bjønnes wrote: > Andre Poenitz <[EMAIL PROTECTED]> writes: > > | On Wed, Sep 17, 2003 at 07:38:14PM +0200, Andre' Poenitz wrote: > >> On Wed, Sep 17, 2003 at 07:32:52PM +0200, Lars Gullik Bjønnes wrote: > >> > Andre Poenitz <[EMAIL PROTECTED]> writes: > >> > > >> > | What's the prefered way to go from a ParagraphList & to "its" LyXText *? > >> > > >> > To have a the BufferView > >> > >> I have that. > > > | I.e. I need the 'inverse' of > > > | LyXText::ownerParagraphs(). > > > | I have a bv, and if really necessary a ParIterator pointing to a place > | in the ParagraphList. > > bv->buffer().paragraphs? > > Or I do not understand what you want. > > Ahh... no I understand... why do you need that? Should you ever need > it?
For the global cursor. I want a stack of nested LyXText * that describes the current cursor position. > Actually you can (could?) know it through the cursor. > > and you have to get it through the view somehow getteing it from > Paragraph or Buffer would be utterly wrong. As I said, I have a BufferView *, I just don't know how the 'somehow' should work. The only way I see so far is to duplicate all inset's 'getParagraphs' code like: ParagraphList * InsetTabular::getParagraphs(int i) const { return (i < tabular.getNumberOfCells()) ? tabular.getCellInset(i).getParagraphs(0) : 0; } [new additionally:] LyXText * InsetTabular::getText(int i) const { return (i < tabular.getNumberOfCells()) ? tabular.getCellInset(i).getText(0) : 0; } ets and keep track of these things in the ParIterator in parallel to the existing ParagraphList * stack. But that's definitely not nice and I thought someone with a better understanding might have a better idea. Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)