From: Paul Rohr (paul@abisource.com)
Date: Thu May 30 2002 - 11:42:58 EDT
[ If you already know about advanced Bonsai tools like cvsblame, then skip 
  this message. ] 
Ever found yourself reading a section of code and scratching your head about 
it?  Yesterday, Pat did. 
At 01:58 AM 5/30/02 -0400, Patrick Lam wrote:
>I found this mysteriously commented code in fl_SectionLayout:
>
>@@ -1579,11 +1605,11 @@
> 	m_pLayout->removeSection(this);
> 	pPrevSL->format();
> 
>-//	FV_View* pView = m_pLayout->getView();
>-//      if (pView)
>-//  	{
>-//  		pView->_setPoint(pcrx->getPosition());
>-//  	}
>+	FV_View* pView = m_pLayout->getView();
>+	if (pView)
>+  	{
>+  		pView->_setPoint(pcrx->getPosition());
>+  	}
>
>The key to fixing this bug was enabling this code; anyone have any
>idea why it was commented?
Elsewhere on this thread, Sam answered this specific question, but I wanted 
to make sure that in the future everyone knows how to answer it for 
themselves.  
Pat's change was to version 1.146 of that file.  So, take a look at the 
previous version of that file (1.145) as follows:
http://www.abisource.com/bonsai/cvsblame.cgi?file=abi/src/text/fmt/xp/fl_Sec
tionLayout.cpp&rev=1.145&root=/cvsroot
Scrolling down to that section of the code, you'll find that those lines 
were last changed in the following two revisions of the code:
  1.80   msevior              Feb 12 2001
         More fixes for headers/footers. Also improve Insertion Point
         Locking code.  Old way was stupid.
  1.78   msevior              Feb 12 2001
         Improvements to changing page sizes with page Numbers. Doing
         this with multiple pages still causes segfaults :-(
If you want to go back further, look at version 1.77 as follows:
http://www.abisource.com/bonsai/cvsblame.cgi?file=abi/src/text/fmt/xp/fl_Sec
tionLayout.cpp&rev=1.77&root=/cvsroot
There you'll discover that the relevant code was originally added in the 
following grand mal commit:
    1.32   eric                 Feb 22 1999
         Here's another checkin:
         1. Reworked all the code which positions lines within columns.
         Added
         the notion of a ColumnBreaker, with an algorithm which is nearly
         identical to our LineBreaker. The result is that the overall
         layout algorithm is now much more linear and clean. I did not get
         the performance boost I expect to get from this on import of large
         plain text files. That looks like a separate problem. In fact, I
         have probably hurt the performance of the app on large documents
         of any kind, but I'm confident that I can get that performance
         back with some adjustments to the code. For now, the code is much
         cleaner than it was.
         2. Due to change item #1 above, the widow-orphan code was
         completely rewritten. Watch out.
         3. Added support for another paragraph property, "keep-together",
         which basically says that a parargraph may not break across a
         column.
         4. Added another paragraph property, "keep-with-next", which means
         that the ColumnBreaker should not put a column break between that
         block and the next one. I have not yet implemented this feature
         in the ColumnBreaker.
         5. Added support for forced column breaks.
         6. Added special-case code for blocks which end on a forced
         break. This fixes bug 192.
         7. Changed data strux for sectionLayouts. They're now kept on a
         doubly-linked list just like BlockLayouts are.
         8. I *tried* adding code to coalesce runs on the fly. This ended up
         being rather problematic, so I #if0'd the code, which I'll revisit
         laer.
         9. Removed the concept of an ImageFactory. The job of creating a
         GR_Image is now in the GR_Graphics class. With the previous
         design, we had no way of creating a PostScript image.
         10. Added concept of a display size to the GR_Image class. This
         required touching a bunch of Windows code, which I have not yet
         even checked to see if it will compile.
         11. Added code to stretchBlit images under GDK. Borrowed the
         code from imlib.
         12. Started working on insert/delete of section breaks. Not working
         yet.
         13. inlined several methods in fp_Column
         14. Modified the fp_Run API to account for the fact that some kinds
         of runs cannot contain the insertion point.
         15. Added some XML comments to the top of ABW files.
         16. Added an exporter for HTML. It doesn't do anything with
         images yet, but it handles the basic char and paragraph formatting
         stuff.
         17. Deleted some unused properties from pp_Property.cpp
         18. Fixed the line leading in PostScript code (bug 233)
         19. Fixed a few compiler warnings.
  
Finally, if you want to see *all* changes to the relevant function since 
Eric originally added it, you'll need to extract the two versions of the 
function and diff them manually.  In this case, the file has evolved so much 
that cvsdiff just plain chokes on it:
http://www.abisource.com/bonsai/cvsview2.cgi?command=DIFF&subdir=abi%2Fsrc%2
Ftext%2Ffmt%2Fxp&file=fl_SectionLayout.cpp&rev1=1.32&rev2=1.145&whitespace_m
ode=show&diff_mode=context
Voila!  All kinds of lovely information for you code genealogists.  (And if 
that's not enough, you know which developers to ask.)
Paul
motto -- Bonsai and CVS are *wonderful* tools
This archive was generated by hypermail 2.1.4 : Thu May 30 2002 - 11:46:38 EDT