Bug 38592 - FOP gets in a endless loop
Summary: FOP gets in a endless loop
Status: CLOSED WONTFIX
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: 0.20.5
Hardware: Other Windows XP
: P2 major
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-09 14:48 UTC by Flemming Harms
Modified: 2012-04-01 13:53 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Flemming Harms 2006-02-09 14:48:05 UTC
The problem is located in this block in LineArea.java. the doHyphenation will
return 0, and the if statement is entered because there was not enough room for
the hyphenated word, and addWord will return 0, because it’s the beginning of
the word and it will start all over.

A workaround is to prevent the column size can be smaller then the size of a
single character

if (this.wrapOption == WrapOption.WRAP) {

                        if (hyphProps.hyphenate == Hyphenate.TRUE) {
                            int ret = wordStart;
                            ret = this.doHyphenation(data, i, wordStart,
                                                     this.getContentWidth()
                                                     - (finalWidth
                                                        + spaceWidth
                                                        + pendingWidth),
                                                     finalWidth + spaceWidth
                                                     + embeddedLinkStart,
                                                     ls, textState);

                            // current word couldn't be hypenated
                            // couldn't fit first word
                            // I am at the beginning of my line
                            if ((ret == wordStart) &&
                                (wordStart == start) &&
                                (finalWidth == 0)) {

                                MessageHandler.log("area contents overflows"
                                                   + " area in line "
                                                   + getLineText());
                                addSpacedWord(new String(data, wordStart,
wordLength - 1),
                                              ls,
                                              embeddedLinkStart,
                                              spaceWidth, textState, false);

                                finalWidth += wordWidth;
                                wordWidth = 0;
                                ret = i;
                            }
                            return ret;
                        } else if (wordStart == start) {
                            // first word
                            overrun = true;
                            // if not at start of line, return word start
                            // to try again on a new line
                            if (finalWidth > 0) {
                                return wordStart;
                            }
                        } else {
                            return wordStart;
                        }

                    }
                }
Comment 1 Manuel Mall 2006-02-10 04:22:15 UTC
Thank you for your problem report and for documenting a workaround. 

Development including patches and bugfixes for 0.20.5 have been frozen.

Feel free to check if the problem exists in the current beta version of Fop 
(0.91) and re-open the issues in that case.
Comment 2 Glenn Adams 2012-04-01 13:53:02 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs