diff options
Diffstat (limited to 'src/gui/dialogs/qprintdialog_mac.mm')
-rw-r--r-- | src/gui/dialogs/qprintdialog_mac.mm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/dialogs/qprintdialog_mac.mm b/src/gui/dialogs/qprintdialog_mac.mm index a7587b1..56a065a 100644 --- a/src/gui/dialogs/qprintdialog_mac.mm +++ b/src/gui/dialogs/qprintdialog_mac.mm @@ -122,6 +122,8 @@ QT_END_NAMESPACE QT_USE_NAMESPACE +#ifdef QT_MAC_USE_COCOA + @class QCocoaPrintPanelDelegate; @interface QCocoaPrintPanelDelegate : NSObject { @@ -166,6 +168,12 @@ QT_USE_NAMESPACE } // Keep us in sync with file output PMDestinationType dest; + + // If the user selected print to file, the session has been + // changed behind our back and our d->ep->session object is a + // dangling pointer. Update it based on the "current" session + d->ep->session = static_cast<PMPrintSession>([d->ep->printInfo PMPrintSession]); + PMSessionGetDestinationType(d->ep->session, d->ep->settings, &dest); if (dest == kPMDestinationFile) { QCFType<CFURLRef> file; @@ -191,6 +199,8 @@ QT_USE_NAMESPACE } @end +#endif + QT_BEGIN_NAMESPACE extern void macStartInterceptWindowTitle(QWidget *window); |