Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/painting/qprintengine_ps.cpp

    r651 r769  
    486486    QByteArray header;
    487487    QPdf::ByteStream s(&header);
    488     s << "%!PS-Adobe-1.0";
    489488
    490489    qreal scale = 72. / ((qreal) q->metric(QPaintDevice::PdmDpiY));
     
    498497    int height = pageRect.height();
    499498    if (finished && pageCount == 1 && copies == 1 &&
    500         ((fullPage && qt_gen_epsf) || (outputFileName.endsWith(QLatin1String(".eps"))))
    501        ) {
     499        ((fullPage && qt_gen_epsf) || (outputFileName.endsWith(QLatin1String(".eps")))))
     500    {
     501        // According to the EPSF 3.0 spec it is required that the PS
     502        // version is PS-Adobe-3.0
     503        s << "%!PS-Adobe-3.0";
    502504        if (!boundingBox.isValid())
    503505            boundingBox.setRect(0, 0, width, height);
     
    506508                boundingBox.translate(-mleft, -mtop);
    507509            s << " EPSF-3.0\n%%BoundingBox: "
    508               << (int)(printer->height() - boundingBox.bottom())*scale // llx
    509               << (int)(printer->width() - boundingBox.right())*scale - 1 // lly
    510               << (int)(printer->height() - boundingBox.top())*scale + 1 // urx
    511               << (int)(printer->width() - boundingBox.left())*scale; // ury
     510              << int((printer->height() - boundingBox.bottom())*scale) // llx
     511              << int((printer->width() - boundingBox.right())*scale - 1) // lly
     512              << int((printer->height() - boundingBox.top())*scale + 1) // urx
     513              << int((printer->width() - boundingBox.left())*scale); // ury
    512514        } else {
    513515            if (!fullPage)
    514516                boundingBox.translate(mleft, -mtop);
    515517            s << " EPSF-3.0\n%%BoundingBox: "
    516               << (int)(boundingBox.left())*scale
    517               << (int)(printer->height() - boundingBox.bottom())*scale - 1
    518               << (int)(boundingBox.right())*scale + 1
    519               << (int)(printer->height() - boundingBox.top())*scale;
     518              << int((boundingBox.left())*scale)
     519              << int((printer->height() - boundingBox.bottom())*scale - 1)
     520              << int((boundingBox.right())*scale + 1)
     521              << int((printer->height() - boundingBox.top())*scale);
    520522        }
    521523    } else {
     524        s << "%!PS-Adobe-1.0";
    522525        int w = width + (fullPage ? 0 : mleft + mright);
    523526        int h = height + (fullPage ? 0 : mtop + mbottom);
Note: See TracChangeset for help on using the changeset viewer.