Re: commit (head): cjk patch

From: Roland Kay <>
Date: Sat Mar 26 2005 - 16:54:04 CET

Hi Martin,

> On the Linux build with the current behaviour, I get lots of asserts

Sorry. I should have phrased my email more carefully. When I said "crash" I
meant so many asserts that sooner or later I had to answer "n" and let it
terminate. It looks like we're seeing the same behaviour.

> Of course AbiWord should never crash and we have to code to make sure it
> doesn't.

I think it's legitimate for abi to crash (or fatally assert) if I
apply a patch that does something stupid. I was just wondering if
returning "true" from canBreak for the last character in the document
was stupid.

> I will need to investigate the origin of these asserts. Clearly something
> bad has happened but we have to make sure the cure is not worse than the
> disease. fb_LineBreaker has had a lot of eyes on it over the years.
> I'll check out your patch next.

My patch is against my code not the fp_LineBreaker. The
canBreakBetween function that I introduced into XAP_EncodingManager
needs two characters to make a decision. Therefore, when
GR_Graphics::canBreak() is called for the last character in the
document it has to return some kind of default value. I didn't think
it mattered which, so originally I chose "true". However, later I
discovered that this was causing fp_LineBreaker to call split() to try
to split the last run of the document after the last character. This
causes split() to assert. The patch I just sent simply changes this
default return value to "false" which solves the problem. It doesn't
alter fp_LineBreaker() in any way.

I mentioned fp_LineBreaker in my email because I was wondering if my
mistake with the return value from GR_Graphics::canBreak() was showing
up a problem in fp_LineBreaker that was previously hidden. For
example, if the last character of a document is a space then presumably
the originally GR_Graphics::canBreak() function would return "true"
possibly leading to trouble.

Don't worry. I wasn't trying to mess up your code. :-)

Happy Easter for tomorrow,

Received on Sat Mar 26 16:54:27 2005

This archive was generated by hypermail 2.1.8 : Sat Mar 26 2005 - 16:54:30 CET