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 bu...@apache.org on 2008/03/17 15:52:19 UTC
DO NOT REPLY [Bug 44619] New: Generic validation for positive
integers
https://issues.apache.org/bugzilla/show_bug.cgi?id=44619
Summary: Generic validation for positive integers
Product: Fop
Version: 1.0dev
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: fo tree
AssignedTo: fop-dev@xmlgraphics.apache.org
ReportedBy: jeremias@apache.org
Many properties like column-count and number-columns-repeated are defined as
positive integers and: "If a non-positive or non-integer value is provided, the
value will be rounded to the nearest integer value greater than or equal to 1."
It would be good to have a possibility to declare that in FOPropertyMapping
instead of having to write validation code for each such property. ATM,
floating point values are often not rounded and not normalized following the
above rule.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 44619] Generic validation for positive integers
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44619
Glenn Adams <gl...@skynav.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED
--- Comment #4 from Glenn Adams <gl...@skynav.com> 2012-04-01 07:00:18 UTC ---
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 44619] Generic validation for positive integers
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44619
Simon Pepping <sp...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #3 from Simon Pepping <sp...@apache.org> 2008-04-18 12:07:18 PST ---
Fixed in revision 649657, by creating NumberProperty.PositiveIntegerMaker,
which implements convertProperty. Note that it is not a good idea to
reimplement make. Rather on reimplements convertProperty, which is called by
make.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 44619] Generic validation for positive integers
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44619
--- Comment #2 from Simon Pepping <sp...@apache.org> 2008-04-08 06:47:20 PST ---
Created an attachment (id=21794)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=21794)
A patch for the problem
This patch does as suggested: It introduces a
NumberProperty.PositiveIntegerMaker, which inherits from NumberProperty.Maker.
Its make method checks whether a numeric value can be extracted, and if so,
rounds it to an integer, and replaces values <= 0 with 1. I made this the maker
of number-columns-repeated, and made ColumnNumberPropertyMaker inherit from it.
It should become the maker of more properties, to be done later.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 44619] Generic validation for positive integers
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44619
--- Comment #1 from Andreas L. Delmelle <ad...@apache.org> 2008-03-23 02:13:29 PST ---
(In reply to comment #0)
> Many properties like column-count and number-columns-repeated are defined as
> positive integers and: "If a non-positive or non-integer value is provided, the
> value will be rounded to the nearest integer value greater than or equal to 1."
>
> It would be good to have a possibility to declare that in FOPropertyMapping
> instead of having to write validation code for each such property. ATM,
> floating point values are often not rounded and not normalized following the
> above rule.
FWIW: I've been thinking about this too at some point.
My proposal would lie in the creation of a PropertyMaker subtype:
PositiveIntegerMaker (?)
The related properties can then be tied to this Maker in FOPropertyMapping.
The make(PropertyList, String, FObj) implementation, which parses the specified
attribute value, can be made to force this rounding (see also
TableFObj.ColumnNumberPropertyMaker for a prototype).
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.