Committed; I cannot recall if the orginal CJK patch was backported, but 
if it was this should be too.
Tomas
Roland Kay wrote:
> Here's a very small patch which fixes a bug in the previous CJK line
> breaking patch. This changes the behaviour from always returning true when
> asked about breaking after the last character in the document to always
> returning false instead.
> 
> Returning true led to the LineBreaker trying to split after the last
> character resulting in a fatal assert.
> 
> To see this start abiword set the font size to "72" (so you don't have to
> type too much) and type "Can I crash Abiword?". This should wrap onto the
> second line. Then delete characters one after another. When you get to the
> 'b', or there abouts, you should see the assert.
> 
> In general, is this behaviour on the part of the LineBreaker sensible?
> Should a line breaking algorithm that returns true for the last character
> in the document crash abi? Algorithms that only consider a single
> character may well do this, although fortunately it doesn't happen with
> standard English rules.
> 
> Best wishes,
> 
> R.
> 
> 
> ------------------------------------------------------------------------
> 
> --- gr_Graphics.cpp.orig	2005-03-25 11:29:02.000000000 +0000
> +++ gr_Graphics.cpp	2005-03-25 11:29:12.000000000 +0000
> @@ -1118,7 +1118,7 @@
>  		c[1] = ri.m_pText->getChar();
>  		// Check for end of document.
>  		if (c[1] == UT_IT_ERROR) 
> -			return true;
> +			return false;
>  
>  		return getApp()->getEncodingManager()->canBreakBetween(c);
>  	}
Received on Sat Apr  9 13:45:40 2005
This archive was generated by hypermail 2.1.8 : Sat Apr 09 2005 - 13:45:40 CEST