RFR: 8334509: Cancelling PageDialog does not return the same PageFormat object [v5]

Alexey Ivanov aivanov at openjdk.org
Fri Jun 21 18:14:17 UTC 2024


On Fri, 21 Jun 2024 15:51:29 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> On cancelling PageDialog, same PageFormat object should be returned which stopped working after [JDK-8307160](https://bugs.openjdk.org/browse/JDK-8307160).
>> Fix is made to reinstate "doIt" flag removed in JDK-8307160 so that correct value is returned from PageDialog.show action..
>> An automated printing testcase is created since the issue was caught by manual test and so having another manual test run the risk of not being executed during CI testing..
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   ALways return doIt

src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp line 581:

> 579:         if ((setup.hDevMode == NULL) && (setup.hDevNames == NULL)) {
> 580:             CLEANUP_SHOW;
> 581:             return doIt;

I'd rather keep `JNI_FALSE` here — it's more explicit and therefore *clearer*. You don't have to keep track of the value of `doIt` flag while reading the code.

In fact, I'd prefer no `doIt` flag at all… yet it makes handling the code below `if (ret)` slightly harder.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19786#discussion_r1649191308


More information about the client-libs-dev mailing list