Re: new pd_Document.cpp patch

From: Jean Brefort <jean.brefort_at_normalesup.org>
Date: Sat Oct 30 2010 - 13:03:31 CEST

Le samedi 30 octobre 2010 à 12:16 +0200, J.M. Maurer a écrit :
> On Tue, 2010-10-26 at 13:16 +0200, Jean Brefort wrote:
> > Hi,
> >
> > I'm cleaning my tree which seems to contain a few patches. This is the
> > first one. I might have already proposed it, I don't really remember.
> > The points is that PD_Document::isEndFootnoteAtPos() and other such
> > methods always return false.
>
> Isn't that check basically already done?

You are right. My patch does not change anything useful. Dropping.

> /*bool bRes = */m_pPieceTable->getFragFromPosition(pos,&pf,&pOffset);
> while(pf && (pf->getLength() == 0))
> {
> pf = pf->getPrev();
> }
> if(!pf || pf->getPos() < pos)
> {
> return false;
> }
>
> If getFragFromPosition() fails, then pf unchanged, which makes it skip
> the while loop and return false in the statement below that. Your code
> would be slightly more save though: your code handles the case where pf
> would have been modified by getFragFromPosition() when it also returns
> false.
>
> Feel free to commit for that reason.
>
> Marc
>
>
Received on Sat Oct 30 13:01:34 2010

This archive was generated by hypermail 2.1.8 : Sat Oct 30 2010 - 13:01:34 CEST