The answer to my 2nd question I was able to figure out.

Yes, pos() is relevant for InsetMath-derived objects too. See listing for
nextAtom below.... the listing for nextInset is provided just for context.

According to me pit() is not relevant for InsetMath-derived objects
=============
Inset <http://wiki.lyx.org/sourcedoc/svn/classlyx_1_1Inset.html> *
lyx::DocIterator::nextInset (  ) const
00107 {
00108         LASSERT(!empty(), return 0);
00109         if (pos() == lastpos())
00110                 return 0;
00111         if (pos() > lastpos()) {
00112                 LYXERR0("Should not happen, but it does: pos() = "
00113                         << pos() << ", lastpos() = " << lastpos());
00114                 return 0;
00115         }
00116         if (inMathed())
00117                 return *nextAtom()*.nucleus();
00118         return paragraph().getInset(pos());
==============
 MathAtom <http://wiki.lyx.org/sourcedoc/svn/classlyx_1_1MathAtom.html> &
lyx::DocIterator::nextAtom (  ) const
00161 {
00162         LASSERT(!empty(), );
00163         //lyxerr << "lastpos: " << lastpos() << " next atom:\n" <<
*this << endl;
00164         LASSERT(pos() < lastpos(), );
00165         *return cell()[pos()]*;>>>*This tells you the relevance of
pos() for an InsetMath*
00166 }
===============


On Fri, Jun 18, 2010 at 4:07 AM, Richard Heck <rgh...@comcast.net> wrote:

> On 06/17/2010 06:13 PM, Sidharth Kshatriya wrote:
>
>>
>> Q. What is the concept of a StableDocIterator and what is the use of
>> zeroing out all the inset_ pointers in each CursorSlice? How does a
>> stableDocIterator do its job in the UndoElement?
>>
>>  The inset_ pointers have to be zeroed out here, because the insets to
> which they point are about to be deleted. So the pointers would be invalid.
>
> Richard
>
>
>
>


-- 
Sidharth Kshatriya
www.sidk.info

Reply via email to