提交 444e9717 编写于 作者: A alitvinov

8181192: [macos] javafx.print.PrinterJob.showPrintDialog() hangs on macOS

Reviewed-by: prr, serb
上级 2bd239c2
...@@ -365,7 +365,7 @@ static void javaPrinterJobToNSPrintInfo(JNIEnv* env, jobject srcPrinterJob, jobj ...@@ -365,7 +365,7 @@ static void javaPrinterJobToNSPrintInfo(JNIEnv* env, jobject srcPrinterJob, jobj
static JNF_MEMBER_CACHE(jm_getMaxPage, sjc_CPrinterJob, "getMaxPageAttrib", "()I"); static JNF_MEMBER_CACHE(jm_getMaxPage, sjc_CPrinterJob, "getMaxPageAttrib", "()I");
static JNF_MEMBER_CACHE(jm_getSelectAttrib, sjc_CPrinterJob, "getSelectAttrib", "()I"); static JNF_MEMBER_CACHE(jm_getSelectAttrib, sjc_CPrinterJob, "getSelectAttrib", "()I");
static JNF_MEMBER_CACHE(jm_getNumberOfPages, jc_Pageable, "getNumberOfPages", "()I"); static JNF_MEMBER_CACHE(jm_getNumberOfPages, jc_Pageable, "getNumberOfPages", "()I");
static JNF_MEMBER_CACHE(jm_getPageFormat, sjc_CPrinterJob, "getPageFormat", "(I)Ljava/awt/print/PageFormat;"); static JNF_MEMBER_CACHE(jm_getPageFormat, sjc_CPrinterJob, "getPageFormatFromAttributes", "()Ljava/awt/print/PageFormat;");
NSMutableDictionary* printingDictionary = [dst dictionary]; NSMutableDictionary* printingDictionary = [dst dictionary];
...@@ -401,7 +401,7 @@ static void javaPrinterJobToNSPrintInfo(JNIEnv* env, jobject srcPrinterJob, jobj ...@@ -401,7 +401,7 @@ static void javaPrinterJobToNSPrintInfo(JNIEnv* env, jobject srcPrinterJob, jobj
[printingDictionary setObject:[NSNumber numberWithInteger:fromPage] forKey:NSPrintFirstPage]; [printingDictionary setObject:[NSNumber numberWithInteger:fromPage] forKey:NSPrintFirstPage];
[printingDictionary setObject:[NSNumber numberWithInteger:toPage] forKey:NSPrintLastPage]; [printingDictionary setObject:[NSNumber numberWithInteger:toPage] forKey:NSPrintLastPage];
jobject page = JNFCallObjectMethod(env, srcPrinterJob, jm_getPageFormat, (jint)0); jobject page = JNFCallObjectMethod(env, srcPrinterJob, jm_getPageFormat);
if (page != NULL) { if (page != NULL) {
javaPageFormatToNSPrintInfo(env, NULL, page, dst); javaPageFormatToNSPrintInfo(env, NULL, page, dst);
} }
......
...@@ -818,6 +818,14 @@ public abstract class RasterPrinterJob extends PrinterJob { ...@@ -818,6 +818,14 @@ public abstract class RasterPrinterJob extends PrinterJob {
} }
} }
protected PageFormat getPageFormatFromAttributes() {
if (attributes == null || attributes.isEmpty()) {
return null;
}
return attributeToPageFormat(getPrintService(), this.attributes);
}
/** /**
* Presents the user a dialog for changing properties of the * Presents the user a dialog for changing properties of the
* print job interactively. * print job interactively.
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
/* @test /* @test
@bug 8167102 @bug 8167102
@summary PrintRequestAttributeSet breaks page size set using PageFormat @summary PrintRequestAttributeSet breaks page size set using PageFormat
@ignore Exclude the test until 8167102 is resolved by a new reassessed fix
@run main/manual WrongPaperPrintingTest @run main/manual WrongPaperPrintingTest
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册