Skip to content

Commit fe390b8

Browse files
committed
8373239: Test java/awt/print/PrinterJob/PageRanges.java fails with incorrect selection of printed pages
1 parent c000343 commit fe390b8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1733,6 +1733,9 @@ private void setRangeCopiesAttribute(int from, int to, boolean isRangeSet,
17331733
if (isRangeSet) {
17341734
attributes.add(new PageRanges(from, to));
17351735
setPageRange(from, to);
1736+
} else {
1737+
attributes.add(new PageRanges(1, 9999));
1738+
setPageRange(1, 9999);
17361739
}
17371740
defaultCopies = false;
17381741
attributes.add(new Copies(copies));

test/jdk/java/awt/print/PrinterJob/PageRanges.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/*
2525
* @test
26-
* @bug 6575331
26+
* @bug 6575331 8373239
2727
* @key printer
2828
* @summary The specified pages should be printed.
2929
* @library /java/awt/regtesthelpers

0 commit comments

Comments
 (0)