Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/dialogs/qprintdialog_win.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5353#include <private/qprinter_p.h>
    5454
    55 #if defined(Q_CC_MINGW) && !defined(PD_NOCURRENTPAGE)
     55#if !defined(PD_NOCURRENTPAGE)
    5656#define PD_NOCURRENTPAGE    0x00800000
    5757#define PD_RESULT_PRINT 1
     
    129129        pd->Flags |= PD_NOPAGENUMS;
    130130
    131     // we don't have a 'current page' notion in the QPrinter API yet.
    132     // Neither do we support more than one page range, so limit those
    133     // options
    134     pd->Flags |= PD_NOCURRENTPAGE;
     131    // Disable Current Page option if not required as default is Enabled
     132    if (!pdlg->isOptionEnabled(QPrintDialog::PrintCurrentPage))
     133        pd->Flags |= PD_NOCURRENTPAGE;
     134
     135    // Default to showing the General tab first
    135136    pd->nStartPage = START_PAGE_GENERAL;
     137
     138    // We don't support more than one page range in the QPrinter API yet.
    136139    pd->nPageRanges = 1;
    137140    pd->nMaxPageRanges = 1;
     
    139142    if (d->ep->printToFile)
    140143        pd->Flags |= PD_PRINTTOFILE;
    141     Q_ASSERT(parent != 0 && parent->testAttribute(Qt::WA_WState_Created));
     144    Q_ASSERT(parent);
    142145    pd->hwndOwner = parent->window()->winId();
    143146    pd->lpPageRanges[0].nFromPage = qMax(pdlg->fromPage(), pdlg->minPage());
     
    154157        pdlg->setPrintRange(QPrintDialog::PageRange);
    155158        pdlg->setFromTo(pd->lpPageRanges[0].nFromPage, pd->lpPageRanges[0].nToPage);
    156     } else {
     159    } else if (pd->Flags & PD_CURRENTPAGE) {
     160        pdlg->setPrintRange(QPrintDialog::CurrentPage);
     161        pdlg->setFromTo(0, 0);
     162    } else { // PD_ALLPAGES
    157163        pdlg->setPrintRange(QPrintDialog::AllPages);
    158164        pdlg->setFromTo(0, 0);
Note: See TracChangeset for help on using the changeset viewer.