Re: PieceTables? Hmm...

Matt Kimball (robozapp@xmission.com)
Sun, 25 Apr 1999 13:42:09 -0600


--XsQoSWH+UP9D9v3l
Content-Type: text/plain; charset=us-ascii

On Sun, Apr 25, 1999 at 05:26:08AM -0500, Jeff Hostetler wrote:
> hello. don't i know you from a previous common employer ??

I don't think so. At least, your name isn't familiar. I've lived and
worked in Salt Lake City most of my life, and now in Palo Alto. Does
any of that match what you are remembering?

Maybe it is just someone that shares my name. I know there is at
least one other Matt Kimball with a 'net presence -- that is always a
bit creepy to me. :)

> > pointer updated when this happends, so we get a block with a stale
> > m_pSectionLayout pointer.
>
> yes that looks to be the problem. BTW there's a Test_Dump method that
> will (in 0.5.4 and earlier) dump the contents of the piece table to a
> file (dump.ptbl.%d). in the current CVS view and in the upcomming 0.5.5
> it will also dump the contents of the format/layout (dump.fmt.%d). these
> will either be in your current directory or in the exe directory. check
> src/wp/ap/xp/ap_LB_Default.cpp for the key/mouse binding in your view of
> the src. it's probably worth the effort to do a CVS update to get my
> latest enhancements to the debug info....

This is nice. Before I was saving and looking at the XML, which gave
me much of the information I needed.

In any case, with both of your messages and the web page doc you
pointed me to, it is much more clear. And with your analysis in the
other message, it was very straightforward to patch. It seems to work
now. Attached is a diff of the code I added against 0.5.4.

Oh, and is there any plan to use autoconf to build under *nix? I
really like to build in a different directory than the source is in so
when I send off patches, the source directories aren't cluttered with
irrelevant object files. I imagine that this will make it harder to
build under Win32 and MacOS though...

-- 
Matt Kimball
mkimball@xmission.com

--XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="abi-block-reparent.patch"

diff -ur ../abi-0.5.4/src/text/fmt/xp/fl_BlockLayout.cpp ./src/text/fmt/xp/fl_BlockLayout.cpp --- ../abi-0.5.4/src/text/fmt/xp/fl_BlockLayout.cpp Tue Mar 30 22:19:05 1999 +++ ./src/text/fmt/xp/fl_BlockLayout.cpp Sun Apr 25 14:11:51 1999 @@ -2876,6 +2876,23 @@ m_pPrev = pBL; } +void fl_BlockLayout::setSectionLayout(fl_SectionLayout* pSectionLayout) +{ + // If we are setting the new section layout, this block + // shouldn't already have a section. If we are clearing + // it, then it should already have a section. + if(pSectionLayout == NULL) + { + UT_ASSERT(m_pSectionLayout != NULL); + } + else + { + UT_ASSERT(m_pSectionLayout == NULL); + } + + m_pSectionLayout = pSectionLayout; +} + #ifndef NDEBUG void fl_BlockLayout::debug_dumpRunList(void) { diff -ur ../abi-0.5.4/src/text/fmt/xp/fl_BlockLayout.h ./src/text/fmt/xp/fl_BlockLayout.h --- ../abi-0.5.4/src/text/fmt/xp/fl_BlockLayout.h Thu Apr 1 15:57:00 1999 +++ ./src/text/fmt/xp/fl_BlockLayout.h Sun Apr 25 14:11:56 1999 @@ -117,6 +117,8 @@ inline FL_DocLayout* getDocLayout(void) const { return m_pLayout; } inline fl_SectionLayout* getSectionLayout(void) { return m_pSectionLayout; } + void setSectionLayout(fl_SectionLayout* pSectionLayout); + void getLineSpacing(double& dSpacing, UT_Bool& bExact) const; inline UT_uint32 getProp_Orphans(void) const { return m_iOrphansProperty; } diff -ur ../abi-0.5.4/src/text/fmt/xp/fl_SectionLayout.cpp ./src/text/fmt/xp/fl_SectionLayout.cpp --- ../abi-0.5.4/src/text/fmt/xp/fl_SectionLayout.cpp Wed Apr 7 17:37:53 1999 +++ ./src/text/fmt/xp/fl_SectionLayout.cpp Sun Apr 25 14:17:26 1999 @@ -158,6 +158,8 @@ m_pFirstBlock = pBL; m_pLastBlock = m_pFirstBlock; } + + pBL->setSectionLayout(this); } fl_BlockLayout * fl_SectionLayout::insertBlock(PL_StruxDocHandle sdh, fl_BlockLayout * pPrev, PT_AttrPropIndex indexAP) @@ -221,6 +223,7 @@ pBL->setNext(NULL); pBL->setPrev(NULL); + pBL->setSectionLayout(NULL); } fb_LineBreaker * fl_SectionLayout::_getLineBreaker(void)

--XsQoSWH+UP9D9v3l--



This archive was generated by hypermail 1.03b2.