762 pd.Flags = PD_ENABLEPRINTHOOK | PD_RETURNDC | PD_USEDEVMODECOPIESANDCOLLATE;
763 pd.lpfnPrintHook = (LPPRINTHOOKPROC)PrintDlgHook;
764
765 pd.nFromPage = (WORD)env->CallIntMethod(printCtrl,
766 AwtPrintControl::getFromPageID);
767 pd.nToPage = (WORD)env->CallIntMethod(printCtrl,
768 AwtPrintControl::getToPageID);
769 pd.nMinPage = (WORD)env->CallIntMethod(printCtrl,
770 AwtPrintControl::getMinPageID);
771 jint maxPage = env->CallIntMethod(printCtrl,
772 AwtPrintControl::getMaxPageID);
773 pd.nMaxPage = (maxPage <= (jint)((WORD)-1)) ? (WORD)maxPage : (WORD)-1;
774 // In the event that the application displays the dialog before
775 // installing a Printable, but sets a page range, then max page will be 1
776 // since the default state of a PrinterJob is an empty "Book" Pageable.
777 // Windows pops up an error dialog in such a case which isn't very
778 // forthcoming about the exact problem.
779 // So if we detect this fix up such a problem here.
780 if (pd.nMinPage > pd.nFromPage) pd.nMinPage = pd.nFromPage;
781 if (pd.nMaxPage < pd.nToPage) pd.nMaxPage = pd.nToPage;
782 if (pd.nFromPage > pd.nMinPage || pd.nToPage < pd.nMaxPage) {
783 pd.Flags |= PD_PAGENUMS;
784 }
785
786 if (env->CallBooleanMethod(printCtrl,
787 AwtPrintControl::getDestID)) {
788 pd.Flags |= PD_PRINTTOFILE;
789 }
790
791 jint selectType = env->CallIntMethod(printCtrl,
792 AwtPrintControl::getSelectID);
793
794 // selectType identifies whether No selection (2D) or
795 // SunPageSelection (AWT)
796 if (selectType != 0) {
797 pd.Flags |= selectType;
798 }
799
800 if (!env->CallBooleanMethod(printCtrl,
801 AwtPrintControl::getPrintToFileEnabledID)) {
802 pd.Flags |= PD_DISABLEPRINTTOFILE;
|
762 pd.Flags = PD_ENABLEPRINTHOOK | PD_RETURNDC | PD_USEDEVMODECOPIESANDCOLLATE;
763 pd.lpfnPrintHook = (LPPRINTHOOKPROC)PrintDlgHook;
764
765 pd.nFromPage = (WORD)env->CallIntMethod(printCtrl,
766 AwtPrintControl::getFromPageID);
767 pd.nToPage = (WORD)env->CallIntMethod(printCtrl,
768 AwtPrintControl::getToPageID);
769 pd.nMinPage = (WORD)env->CallIntMethod(printCtrl,
770 AwtPrintControl::getMinPageID);
771 jint maxPage = env->CallIntMethod(printCtrl,
772 AwtPrintControl::getMaxPageID);
773 pd.nMaxPage = (maxPage <= (jint)((WORD)-1)) ? (WORD)maxPage : (WORD)-1;
774 // In the event that the application displays the dialog before
775 // installing a Printable, but sets a page range, then max page will be 1
776 // since the default state of a PrinterJob is an empty "Book" Pageable.
777 // Windows pops up an error dialog in such a case which isn't very
778 // forthcoming about the exact problem.
779 // So if we detect this fix up such a problem here.
780 if (pd.nMinPage > pd.nFromPage) pd.nMinPage = pd.nFromPage;
781 if (pd.nMaxPage < pd.nToPage) pd.nMaxPage = pd.nToPage;
782 if (pd.nToPage > pd.nFromPage && (pd.nFromPage > pd.nMinPage || pd.nToPage < pd.nMaxPage)) {
783 pd.Flags |= PD_PAGENUMS;
784 }
785
786 if (env->CallBooleanMethod(printCtrl,
787 AwtPrintControl::getDestID)) {
788 pd.Flags |= PD_PRINTTOFILE;
789 }
790
791 jint selectType = env->CallIntMethod(printCtrl,
792 AwtPrintControl::getSelectID);
793
794 // selectType identifies whether No selection (2D) or
795 // SunPageSelection (AWT)
796 if (selectType != 0) {
797 pd.Flags |= selectType;
798 }
799
800 if (!env->CallBooleanMethod(printCtrl,
801 AwtPrintControl::getPrintToFileEnabledID)) {
802 pd.Flags |= PD_DISABLEPRINTTOFILE;
|