Re: A warning before a major change.


Subject: Re: A warning before a major change.
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Tue Feb 13 2001 - 23:35:22 CST


HI Dom,
        I know what the matter is. The easiest way to fix this is to apply
the patch I've got pending to exclude the header/footer sections for the
document size calculations.

Show I do this for now? The code appears very robust.

Regarding entering text into the hdrftr sections, the structure of abi is

                hdrftr
                   |

shadow shadow shadow shadow shadow

Where each shadow represents a section for a page. Now the hdrftr section
has no page associated with it so I have deliberately left the blocks in
it undformatted so that no lines are generated. Lines need a page to
attach to.

I've done a lot of work to get things this far but the code is fragile.

I can think of several appraoches.

1. format the hdrftr and see if we can find a way to map the lines and the
first shadow onto the first page.

2. Be clever and pass all editting info down to the shadows.

There may be others too.

Cheers

Martin

 On Wed, 14 Feb 2001, Dom Lachowicz wrote:

> Martin,
>
> I get a crash when I try to print these documents, but I can insert and edit
> text in the footers just fine, and save (& reload) these documents without
> problems. Screenshots and sample docs available upon request. I get an
> assert on loading:
>
> ( 0 > _findShadow(pPage) at fl_SectionLayout.cpp:1689 **** )
>
> When I segv, I get a fault right here:
>
> #4 0x82859aa in FV_View::getPoint (this=0x0) at fv_View.h:108
> #5 0x8111b06 in fl_ShadowListener::populateStrux (this=0x84dba78,
> sdh=0x85275c8, pcr=0x85210f8, psfh=0xbfffe984) at
> fl_SectionLayout.cpp:2389
>
> Maybe this will help? I can take a look at the code too, tomorrow.
>
> Dom
>
> >From: Martin Sevior <msevior@mccubbin.ph.unimelb.edu.au>
> >To: abiword-dev@abisource.com
> >Subject: A warning before a major change.
> >Date: Wed, 14 Feb 2001 16:12:46 +1100 (EST)
> >
> >HI everyone,
> > We have a problem with Abiword with page numbers. Right now
> >page numbers are contained in a section placed at the end of the document.
> >However the size of the document includes the page number sections. This
> >means that it is quite possible to to place the cursor at the end of the
> >text press "right arrow" and enter the page section. The cursor jumps into
> >the fister header/footer and then any text entered will crash Abiword.
> >
> >Now eventually this will be a cool feature (Entering text directly into
> >Abi headers/footers) but it will take some major reworking and in any case
> >you should not enter the header/footer sections unless you mean to.
> >
> >The best way to fix this is to have the code that calculates the size of
> >the document not include the the header/footer sections. I've made the
> >changes needed in fv_View to do this and have written a new method
> >in fv_View called
> >
> >// TODO find clever way to cache the size of the
> >// header/footer region so we can just subtract it off.
> >//
> >bool FV_View::getEditableBounds(bool isEnd, PT_DocPosition &posEOD)
> >
> >
> >Now this code gets called on every cursor motion in abi so it is important
> >to realize that this code should be fast. Right now it adds a bit of extra
> >overhead to abi but I think I can come up with code to speed this up via
> >caching. Anyway the full code is:
> >
> >
> >//
> >// This method keeps the insertion point out of the header/footer end of
> >// of the document.
> >// TODO find clever way to cache the size of the
> >// header/footer region so we can just subtract it off.
> >//
> >bool FV_View::getEditableBounds(bool isEnd, PT_DocPosition &posEOD)
> >{
> > bool res;
> > if(!isEnd)
> > {
> > res = m_pDoc->getBounds(isEnd,posEOD);
> > return res;
> > }
> > else
> > {
> > fl_DocSectionLayout * pSL = m_pLayout->getFirstSection();
> > UT_DEBUGMSG(("SEVIOR: Header = %x, Footer = %x
> >\n",pSL->getHeader(),pSL->getFooter()));
> > while(pSL != NULL && pSL->getHeader()== NULL &&
> >pSL->getFooter()== NULL )
> > {
> > UT_DEBUGMSG(("SEVIOR: Header = %x, Footer = %x
> >\n",pSL->getHeader(),pSL->getFooter()));
> >
> > pSL = pSL->getNextDocSection();
> > }
> > fl_BlockLayout * pBL;
> > if( pSL == NULL || ( pSL->getHeader()== NULL &&
> >pSL->getFooter()== NULL ))
> > {
> > UT_DEBUGMSG(("SEVIOR: NO Header/Footer in doc!
> >\n"));
> > res = m_pDoc->getBounds(isEnd,posEOD);
> > return res;
> > }
> > if(pSL->getHeader() != NULL)
> > {
> > pBL = pSL->getHeader()->getFirstBlock();
> > }
> > else
> > {
> > pBL = pSL->getFooter()->getFirstBlock();
> > }
> > UT_DEBUGMSG(("SEVIOR: Header/Footer Exists \n"));
> > UT_DEBUGMSG(("SEVIOR: Block Section Type
> >\n",pBL->getSectionLayout()->getType()));
> > posEOD = pBL->getPosition( true);
> > pBL = _findBlockAtPosition(posEOD);
> > while(pBL->getSectionLayout()->getType() == FL_SECTION_HDRFTR)
> > {
> > posEOD--;
> > pBL = _findBlockAtPosition(posEOD);
> > UT_DEBUGMSG(("SEVIOR: Block Section Type
> >\n",pBL->getSectionLayout()->getType()));
> > }
> > posEOD--;
> > return res;
> > }
> >}
> >
> >Cheers
> >
> >Martin
> >
> >
> >
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>



This archive was generated by hypermail 2b25 : Tue Feb 13 2001 - 23:35:28 CST