You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by En...@bg-sys.de on 2001/04/27 13:00:42 UTC

source code changes

Hi FOP-developer!

I have 2 source code changes for FOP release 0.18.1.

I am using this way of contributing because we have a very restrictive firewall and there is no way for using cvs.
So it would be gratefull if someone merges the code...

- The following line should be inserted in near line 174 in file org/apache/fop/fo/flow/TableCell.java

     areaContainer.setBackgroundColor(backgroundColor);

- There should be a handling for mid word breaks if the first word could not fit in the current line in org/apache/fop/layout/LineArea.java

The corresponding case in line 363
--
                    if ((finalWidth + spaceWidth + pendingWidth +
                              wordWidth) > this.getContentWidth()) {

                         // BREAK MID WORD
                         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.hyphProps.hyphenate == Hyphenate.TRUE) {
                              return this.doHyphenation(data,i,wordStart,this.getContentWidth() - (finalWidth + spaceWidth + pendingWidth));
                           } else {
                              return wordStart;
                           }
                         }
                    }
--
should be something like
--
                    if ((finalWidth + spaceWidth + pendingWidth +
                              wordWidth) > this.getContentWidth()) {

                         // BREAK MID WORD
                         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.hyphProps.hyphenate == Hyphenate.TRUE) {
                                         int ret = this.doHyphenation(data,i,wordStart,this.getContentWidth() -
                                              (finalWidth + spaceWidth + pendingWidth));
                                         if (ret != wordStart) {
                                              return ret;
                                         }
                                   }

                                   finalWidth += wordWidth - charWidth;
                                   wordLength--;

                                   WordArea ia = new WordArea(currentFontState, this.red,
                                                   this.green, this.blue, new
                                                   String(data, wordStart,
                                                      wordLength), wordWidth);

                                   addChild(ia);

                                   if (ls != null) {
                                         Rectangle lr =
                                              new Rectangle(finalWidth + spaceWidth + embeddedLinkStart,
                                                   spaceWidth,
                                                   ia.getContentWidth(),
                                                   fontState.getFontSize());
                                         ls.addRect(lr, this, ia);
                                   }

                                   pendingWidth = 0;

                                   wordWidth = 0;

                                   if (overrun) {
                                         MessageHandler.error(">");
                                   }

                                   return i;
                              }
                         } else if (this.wrapOption == WrapOption.WRAP) {
                              if (this.hyphProps.hyphenate == Hyphenate.TRUE) {
                                   return this.doHyphenation(data,i,wordStart,this.getContentWidth() -
                                   (finalWidth + spaceWidth + pendingWidth));
                              } else {
                                   return wordStart;
                              }
                         }
                    }
--

many regards

Enrico Schnepel
mailto:enrico.schnepel@bg-sys.de


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org