Why does the test look like this ?
157 @Override
158 public int getNumberOfPages() {
159 return 0;
160 }
-phil.
On 8/23/16, 5:05 AM, Prasanta Sadhukhan wrote:
Hi All,
Please review a fix whereby it is seen that Page Ranges fields in the
"cross-platform" dialog does not get populated based on what
pageable's getNumberOfPages() returns. "To" field is always 1.
However, for native dialog it shows the "To" field correctly based on
what getNumberOfPages() returns.
Bug: https://bugs.openjdk.java.net/browse/JDK-4885375
webrev: http://cr.openjdk.java.net/~psadhukhan/4885375/webrev.00/
This is because in cross platform ServiceDialog, for the ToPage to get
populated, PageRanges should be present in the attribute set. In this
case, there is no PageRanges so it defaults to "from 1 to 1" pages.
Proposed fix is to set a PageRange attribute to be from 1 to
getNumberOfPages.
The 2nd issue of disabling PageRange fields if getNumberOfPages()
returns 0 is not handled as there is no provision of passing
PageRanges 0 to ServiceDialog (it resuls in IAE).
Regards
Prasanta