keiron 01/08/31 05:55:05
Modified: src/org/apache/fop/layout LineArea.java
Log:
this patch should fix a problem with hyphenating large words
Submitted by: Enrico Schnepel <[EMAIL PROTECTED]>
Revision Changes Path
1.50 +33 -18 xml-fop/src/org/apache/fop/layout/LineArea.java
Index: LineArea.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/LineArea.java,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- LineArea.java 2001/08/02 19:38:08 1.49
+++ LineArea.java 2001/08/31 12:55:05 1.50
@@ -1,5 +1,5 @@
/*
- * $Id: LineArea.java,v 1.49 2001/08/02 19:38:08 tore Exp $
+ * $Id: LineArea.java,v 1.50 2001/08/31 12:55:05 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -429,27 +429,42 @@
wordWidth = 0;
return i;
}
- if (wordStart == start) { // if couldn't even fit
- // 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 if (this.wrapOption == WrapOption.WRAP) {
+
+ if (this.wrapOption == WrapOption.WRAP) {
+
+ int ret=wordStart;
+
if (hyphProps.hyphenate == Hyphenate.TRUE) {
- return this.doHyphenation(dataCopy, i, wordStart,
- this.getContentWidth()
- - (finalWidth
- + spaceWidth
- + pendingWidth));
- } else {
- return wordStart;
+ ret = this.doHyphenation(dataCopy, i, wordStart,
+ this.getContentWidth()
+ - (finalWidth
+ + spaceWidth
+ + pendingWidth));
+
}
+
+
+ if ((ret == wordStart) && // current word couldn't be
hypenated
+ (wordStart == start) && // couldn't fit first word
+ (finalWidth == 0)) { // I am at the beginning of
my line
+
+ MessageHandler.error(">");
+
+ addSpacedWord(new String(data, wordStart, wordLength -
1),
+ ls,
+ finalWidth + spaceWidth
+ + embeddedLinkStart,
+ spaceWidth, textState, false);
+
+ finalWidth += wordWidth;
+ wordWidth = 0;
+
+ ret = i;
+ }
+
+ return ret;
}
}
-
}
} // end of iteration over text
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]