src/gui/painting/qpdf.cpp
branchGCC_SURGE
changeset 31 5daf16870df6
parent 30 5dc02b23752f
equal deleted inserted replaced
27:93b982ccede2 31:5daf16870df6
   969 void QPdfBaseEngine::drawPoints (const QPointF *points, int pointCount)
   969 void QPdfBaseEngine::drawPoints (const QPointF *points, int pointCount)
   970 {
   970 {
   971     if (!points)
   971     if (!points)
   972         return;
   972         return;
   973 
   973 
       
   974     Q_D(QPdfBaseEngine);
   974     QPainterPath p;
   975     QPainterPath p;
   975     for (int i=0; i!=pointCount;++i) {
   976     for (int i=0; i!=pointCount;++i) {
   976         p.moveTo(points[i]);
   977         p.moveTo(points[i]);
   977         p.lineTo(points[i] + QPointF(0, 0.001));
   978         p.lineTo(points[i] + QPointF(0, 0.001));
   978     }
   979     }
       
   980 
       
   981     bool hadBrush = d->hasBrush;
       
   982     d->hasBrush = false;
   979     drawPath(p);
   983     drawPath(p);
       
   984     d->hasBrush = hadBrush;
   980 }
   985 }
   981 
   986 
   982 void QPdfBaseEngine::drawLines (const QLineF *lines, int lineCount)
   987 void QPdfBaseEngine::drawLines (const QLineF *lines, int lineCount)
   983 {
   988 {
   984     if (!lines)
   989     if (!lines)
   985         return;
   990         return;
   986 
   991 
       
   992     Q_D(QPdfBaseEngine);
   987     QPainterPath p;
   993     QPainterPath p;
   988     for (int i=0; i!=lineCount;++i) {
   994     for (int i=0; i!=lineCount;++i) {
   989         p.moveTo(lines[i].p1());
   995         p.moveTo(lines[i].p1());
   990         p.lineTo(lines[i].p2());
   996         p.lineTo(lines[i].p2());
   991     }
   997     }
       
   998     bool hadBrush = d->hasBrush;
       
   999     d->hasBrush = false;
   992     drawPath(p);
  1000     drawPath(p);
       
  1001     d->hasBrush = hadBrush;
   993 }
  1002 }
   994 
  1003 
   995 void QPdfBaseEngine::drawRects (const QRectF *rects, int rectCount)
  1004 void QPdfBaseEngine::drawRects (const QRectF *rects, int rectCount)
   996 {
  1005 {
   997     if (!rects)
  1006     if (!rects)
  1413         d->title = value.toString();
  1422         d->title = value.toString();
  1414         break;
  1423         break;
  1415     case PPK_FullPage:
  1424     case PPK_FullPage:
  1416         d->fullPage = value.toBool();
  1425         d->fullPage = value.toBool();
  1417         break;
  1426         break;
       
  1427     case PPK_CopyCount: // fallthrough
  1418     case PPK_NumberOfCopies:
  1428     case PPK_NumberOfCopies:
  1419         d->copies = value.toInt();
  1429         d->copies = value.toInt();
  1420         break;
  1430         break;
  1421     case PPK_Orientation:
  1431     case PPK_Orientation:
  1422         d->orientation = QPrinter::Orientation(value.toInt());
  1432         d->orientation = QPrinter::Orientation(value.toInt());
  1501     case PPK_DocumentName:
  1511     case PPK_DocumentName:
  1502         ret = d->title;
  1512         ret = d->title;
  1503         break;
  1513         break;
  1504     case PPK_FullPage:
  1514     case PPK_FullPage:
  1505         ret = d->fullPage;
  1515         ret = d->fullPage;
       
  1516         break;
       
  1517     case PPK_CopyCount:
       
  1518         ret = d->copies;
       
  1519         break;
       
  1520     case PPK_SupportsMultipleCopies:
       
  1521 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
       
  1522         if (QCUPSSupport::isAvailable())
       
  1523             ret = true;
       
  1524         else
       
  1525 #endif
       
  1526             ret = false;
  1506         break;
  1527         break;
  1507     case PPK_NumberOfCopies:
  1528     case PPK_NumberOfCopies:
  1508 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
  1529 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
  1509         if (QCUPSSupport::isAvailable())
  1530         if (QCUPSSupport::isAvailable())
  1510             ret = 1;
  1531             ret = 1;