Re: DO NOT REPLY [Bug 41631] - Percentages in proportional-column-width() not supported

2008-02-10 Thread Andreas Delmelle

On Feb 10, 2008, at 14:44, [EMAIL PROTECTED] wrote:



--- Additional Comments From [EMAIL PROTECTED]  2008-02-10  
05:44 ---


Fixed in FOP Trunk.

see: http://svn.apache.org/viewvc?rev=620283&view=rev


Oops, wrong revision number: should be "620285".




Re: DO NOT REPLY [Bug 43705] - use of rgb-icc inside of simple-page-master results in null pointer exeption

2008-02-10 Thread Andreas Delmelle

On Feb 4, 2008, at 22:15, Andreas Delmelle wrote:

Small *grin* update:

Looking into a fix now. The issue arises in  
ColorUtil.parseColorString(). After my changes, percentages get  
passed into fop-rgb-icc() as percentages instead of decimals, which  
leads to a rather peculiar error message:


[junit] SEVERE: Ignoring property: color="rgb-icc(100%,50%,0%,  
sRGB, 1, 0.5, 0)" (Arguments to rgb-icc() must be [0..255] or [0%.. 
100%]; property:'color')


Investigated further, and the problem was yet slightly different: one  
of my changes was the addition of getPercentBase() to the  
ICCColorFunction to make sure the RGBColorFunction correctly gets  
passed the percentage values of the first three arguments. A small  
correction, it seemed: the PropertyParser now, correctly, recognizes  
the percentage and parses it into a resolved NumberProperty.


Somehow, what bothered me about making that change was that I could  
only set the percent-base for all arguments at the same time. Maybe  
it does not matter so much here, but I could imagine that someone  
would want to interpret percentages using a different base for the  
latter three arguments (?)
Currently, it's all or nothing, but that seems to be only a minor  
issue. I've now at least separated it from the default  
RGBPercentBase, so we may revisit this later...


Now, while the message shows percentages, after the change the actual  
String value that get passed to ColorUtil contains resolved  
percentage values (between 0 and 255, as doubles...).


On the other hand, I still have some doubts on the color-parsing  
process if you look at it like this:
Somewhere in an XML stream, an attribute is encountered with the name  
'color' and the value 'rgb-icc(100%,50%,0%,ColorProfileX,1.0,0.5,1.0)'.
This attribute makes its way into  
PropertyList.convertAttributeToProperty(), which results in the  
PropertyParser neatly breaking the expression down into a function  
call and a set of arguments. The arguments are in their turn nicely  
resolved to a StringProperty or NumberProperty.
Then, the function call is resolved, which currently means: dump the  
properties/arguments back into a StringBuffer and parse that  
somewhere else.
There is the inherently dangerous assumption that toString() will  
always be implemented to provide 'parseable' values.


While tracing further, I stumbled upon the following dubious  
construction...


try {
  float f = Float.parseFloat(someString); //(*)

  if (f < 0.0 || f > 1.0) {
throw new PropertyException("Out of range!");
  }
  ...
  String s = anotherString;
  if (s == null || "".equals(s)) {
throw new PropertyException("Missing argument!"); //(*)
  }

} catch (Exception e) {
  throw new PropertyException("Out of range!");
}


If one of the lines marked with (*) causes an error, the real reason  
why the try-block fails will always remains a mystery to the regular  
user. I happened to notice such an exception in the debugger. Since  
it is converted into a log message higher up, a stack trace will  
never appear, and even if it would, I doubt this would clarify  
much... :-/


Making it

...
} catch (PropertyException pe) {
  //simply re-throw
  throw pe;
} catch (Exception e) {
  //wrap in a PropertyException
  throw new PropertyException(e);
}

helps a lot already.


On another note, I've converted ColorUtil to use String.split()  
instead of StringTokenizer. I picked up that Sun actually discourages  
the use of StringTokenizer, unless you really need its three-argument  
constructor with the boolean value to get the separators as well.  
Since in this context we don't and we're on 1.4, we might as well  
take advantage of this feature.


Hope this sits right with everyone.


Cheers

Andreas



DO NOT REPLY [Bug 41631] - Percentages in proportional-column-width() not supported

2008-02-10 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41631


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED




--- Additional Comments From [EMAIL PROTECTED]  2008-02-10 05:44 ---

Fixed in FOP Trunk.

see: http://svn.apache.org/viewvc?rev=620283&view=rev

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.


Bug report for Fop [2008/02/10]

2008-02-10 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=CriticalMAJ=Major |
| |   |   MIN=Minor   NOR=Normal  ENH=Enhancement   |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
| 1063|New|Nor|2001-03-21|fop does not handle large fo files|
| 3280|New|Nor|2001-08-27|PCL Renderer doesn't work |
| 3824|New|Blk|2001-09-25|MIF option with tables|
| 4030|New|Nor|2001-10-08|IOException creating Postscript with graphics on S|
| 4535|New|Maj|2001-10-31|PCL renderer 1.13 not rendering SVG   |
| 5010|New|Enh|2001-11-21|Better error reporting needed |
| 5124|New|Maj|2001-11-27|fo:block-container is not rendered properly using |
| 6305|New|Nor|2002-02-07|Using fo:table-and-caption results in empty output|
| 6427|New|Enh|2002-02-13|Adding additional Type 1 fonts problem|
| 6997|New|Nor|2002-03-09|[PATCH] Row-spanned row data breaks over a page wi|
| 7241|New|Nor|2002-03-19|keep-with-previous, keep-with-next only working on|
| 8003|Ass|Maj|2002-04-12|FopImageFactory never releases cached images  |
| 8463|New|Nor|2002-04-24|SVG clipping in external.fo example doc when rende|
| 8767|Ass|Min|2002-05-03|Image and solid colour background rectangle sizes |
| 9379|New|Nor|2002-05-24|MIF Renderer generates incorrect MIF code |
|10379|New|Enh|2002-07-01|Improvement to FOP Classloader|
|12494|New|Nor|2002-09-10|fop produces pdf file which Acrobat Reader refuses|
|12610|New|Enh|2002-09-13|[PATCH] onLoad Action for PDF documents or how to |
|13586|New|Blk|2002-10-13|fop will not work on linux alpha because jre is br|
|13734|New|Nor|2002-10-17|Hyphenation does not work correctly on long string|
|14248|New|Enh|2002-11-05|51-page FO example, could be added to the samples |
|14352|New|Enh|2002-11-07|It would be nice if FOP could be plugged into popu|
|14356|New|Nor|2002-11-07|*NOT* embedding TrueTypeFont in PDF causes Acrobat|
|14419|New|Enh|2002-11-10|Implement SourceResolver, Image Resolver  |
|14504|New|Cri|2002-11-13|Pagebreak in cell spanning multiple rows create fa|
|14529|New|Nor|2002-11-13|SVG url references do not work|
|14679|New|Enh|2002-11-19|Pluggable renderers   |
|14924|New|Nor|2002-11-28|Table disappears when it ends when the page ends  |
|15020|New|Enh|2002-12-03|Reuse of fo-tree  |
|16017|Opn|Nor|2003-01-13|Jpeg's and the PDF Serializer |
|16130|New|Nor|2003-01-15|PS-Renderer emits lots of redundant moveto's  |
|16156|New|Nor|2003-01-16|0.20.5rc SVG example does not work|
|16713|New|Nor|2003-02-03|Hyphenation error in tables   |
|17369|New|Nor|2003-02-25|Footnote duplication  |
|17380|New|Nor|2003-02-25|Batik Component will not recognize fe SVG elem|
|17921|New|Nor|2003-03-12|Kerning is broken for standard fonts  |
|18292|New|Nor|2003-03-24|24 bit PNG not displayed correctly|
|18801|New|Nor|2003-04-08|"visibility" property is not implemented  |
|19228|New|Blk|2003-04-22|[PATCH] Child LayoutContext is null in certain cir|
|19341|Ver|Nor|2003-04-26|leader doesn't work since 0.20.5.rc2  |
|19695|New|Enh|2003-05-06|[PATCH] Allow fox:destination as child of fox:outl|
|19717|New|Enh|2003-05-07|Lets add support for JimiClassesPro.zip to build.x|
|19769|Ass|Enh|2003-05-08|Indefinite page size is not implemented   |
|20280|Ass|Enh|2003-05-27|text-align and text-align-last only partially impl|
|20407|New|Enh|2003-06-02|[PATCH] Configure image caching using the configur|
|20827|New|Enh|2003-06-17|Derive other font styles and weights from normal T|
|21265|Opn|Nor|2003-07-02|referencing a custom font (TTF or Adobe Type 1) fo|
|21905|New|Nor|2003-07-26|large list-item-label bleeds into following block |
|21982|New|Maj|2003-07-30|NullPointer Exception in LazyFont with embedded fo|
|22450|New|Maj|2003-08-15|Unterminated iteration in JPEGReader class|
|22627|Opn|Nor|2003-08-21|Update mirror/download page HEADER & README (was [|
|24148|