[Bug 2243] - extra space at the beginning of next line after line feed

2001-07-24 Thread bugzilla

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2243

*** shadow/2243 Thu Jul 19 18:13:24 2001
--- shadow/2243.tmp.24349   Tue Jul 24 15:08:14 2001
***
*** 2,9 
  | extra space at the beginning of next line after line feed  |
  ++
  |Bug #: 2243Product: Fop |
! |   Status: NEW Version: all |
! |   Resolution:Platform: PC  |
  | Severity: MajorOS/Version: Windows NT/2K   |
  | Priority: Other Component: general |
  ++
--- 2,9 
  | extra space at the beginning of next line after line feed  |
  ++
  |Bug #: 2243Product: Fop |
! |   Status: RESOLVEDVersion: all |
! |   Resolution: FIXED  Platform: PC  |
  | Severity: MajorOS/Version: Windows NT/2K   |
  | Priority: Other Component: general |
  ++

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




[Patch] bug 2243 - extra space at the beginning of next line after line feed

2001-07-23 Thread Rainer Garus

Is it possible to insert and commit the patch sended on 2001-06-28 to CVS?

Rainer Garus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




[Bug 2243] - extra space at the beginning of next line after line feed

2001-07-19 Thread bugzilla

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2243

*** shadow/2243 Tue Jun 26 18:17:32 2001
--- shadow/2243.tmp.16451   Thu Jul 19 18:13:24 2001
***
*** 4,10 
  |Bug #: 2243Product: Fop |
  |   Status: NEW Version: all |
  |   Resolution:Platform: PC  |
! | Severity: Normal   OS/Version: Windows NT/2K   |
  | Priority: Other Component: general |
  ++
  |  Assigned To: [EMAIL PROTECTED]   |
--- 4,10 
  |Bug #: 2243Product: Fop |
  |   Status: NEW Version: all |
  |   Resolution:Platform: PC  |
! | Severity: MajorOS/Version: Windows NT/2K   |
  | Priority: Other Component: general |
  ++
  |  Assigned To: [EMAIL PROTECTED]   |

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Patch for bug 2243 - extra space at the beginning of next line after line feed

2001-06-28 Thread Rainer Garus

In the case of white-space-collapse=false in LineArea.AddText the position of
the line feed character is returned. So the next line starts at the position of
the line feed character (bug 1). All white space characters at the begin of a
line are handled as spaces (bug 2). Another bug is that lines with only white
space characters are suppressed. This is a problem in source code listings.

In the fo-file Test 1 - Test 4 and Test 9 are ok, but textdecoration
does not work as expected.



--- Fop-0.19.0-CVS/src/org/apache/fop/layout/LineArea.java  Fri Jun 15 23:25:49 
2001
+++ LineArea.java   Thu Jun 28 21:42:01 2001
@@ -202,7 +202,16 @@
 spaceWidth += whitespaceWidth;
 } else if (c == '\n') {
 // force line break
-return i;
+if (spaceWidth  0) {
+  InlineSpace is = new InlineSpace(spaceWidth);
+  is.setUnderlined(textState.getUnderlined());
+  is.setOverlined(textState.getOverlined());
+  is.setLineThrough(textState.getLineThrough());
+  addChild(is);
+  finalWidth += spaceWidth;
+  spaceWidth = 0;
+}
+return i+1;
 } else if (c == '\t') {
 spaceWidth += 8 * whitespaceWidth;
 }
@@ -308,7 +317,7 @@
 WhiteSpaceCollapse.FALSE) {
 if (c == '\n') {
 // force a line break
-return i;
+return i+1;
 } else if (c == '\t') {
 spaceWidth = whitespaceWidth;
 }
@@ -320,8 +329,19 @@
 
 if (this.whiteSpaceCollapse ==
 WhiteSpaceCollapse.FALSE) {
-prev = WHITESPACE;
-spaceWidth = whitespaceWidth;
+if (c == ' ') {
+prev = WHITESPACE;
+spaceWidth = whitespaceWidth;
+} else if (c == '\n') {
+// force line break
+// textdecoration not used because spaceWidth is 0
+InlineSpace is = new InlineSpace(spaceWidth);
+addChild(is);
+return i+1;
+} else if (c == '\t') {
+ prev = WHITESPACE;
+ spaceWidth = 8 * whitespaceWidth;
+}
 } else {
 // skip over it
 wordStart++;



fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
 xmlns:svg=http://www.w3.org/2000/svg;
 font-family=Courier
 font-size=10pt
  fo:layout-master-set
fo:simple-page-master master-name=one
   page-height=297mm
   page-width=210mm
  fo:region-body/
/fo:simple-page-master
  /fo:layout-master-set
  fo:page-sequence master-name=one
fo:flow flow-name=xsl-region-body



!-- Test 1 --
fo:block1234567890123456789012345678901234567890 Test 1 text-align=start/fo:block
fo:block white-space-collapse=false text-align=start background-color=yellow
Start in column 1, one empty line before this line. Line ends with 3 spaces.   


Start in column 9 (one tab), two empty lines before this line.
Start in column 17 (two tab), no empty line before this line.

   
  Start in column 3, one empty line and one with three spaces before this line.
Start in column 1, no empty line after this line.
/fo:block
fo:block1234567890123456789012345678901234567890 Test 1/fo:block




!-- Test 2 --
fo:block1234567890123456789012345678901234567890 Test 2 text-align=end/fo:block
fo:block white-space-collapse=false text-align=end background-color=yellow
Start in column 1, one empty line before this line. Line ends with 3 spaces.   


Start in column 9 (one tab), two empty lines before this line.
Start in column 17 (two tab), no empty line before this line.

  
  Start in column 3, one empty line and one with three spaces before this line.
Start in column 1, no empty line after this line.
/fo:block
fo:block1234567890123456789012345678901234567890 Test 2/fo:block




!-- Test 3 --
fo:block1234567890123456789012345678901234567890 Test 3 text-align=start/fo:block
fo:block white-space-collapse=false text-align=start