Changeset 561 for trunk/src/gui/painting/qpdf.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/painting/qpdf.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 49 49 #include <qnumeric.h> 50 50 51 #ifdef Q_OS_UNIX 52 #include "private/qcore_unix_p.h" // overrides QT_OPEN 53 #endif 54 51 55 QT_BEGIN_NAMESPACE 52 56 … … 75 79 qreal frac = val - (qreal)ival; 76 80 77 int ifrac = (int)(frac * 1000000 );78 if (ifrac == 1000000 ) {81 int ifrac = (int)(frac * 1000000000); 82 if (ifrac == 1000000000) { 79 83 ++ival; 80 84 ifrac = 0; … … 87 91 ival /= 10; 88 92 } 89 int fact = 100000 ;93 int fact = 100000000; 90 94 if (i == 0) { 91 95 *(buf++) = '0'; … … 142 146 handleDirty(false) 143 147 { 144 dev->open(QIODevice::ReadWrite );148 dev->open(QIODevice::ReadWrite | QIODevice::Append); 145 149 } 146 150 … … 310 314 Qt::FillRule fillRule = path.fillRule(); 311 315 312 const char *op = 0;316 const char *op = ""; 313 317 switch (flags) { 314 318 case ClipPath: … … 347 351 QByteArray result; 348 352 ByteStream s(&result); 349 s << "[";353 s << '['; 350 354 351 355 QVector<qreal> dasharray = pen.dashPattern(); … … 358 362 s << dw; 359 363 } 360 s << "]";364 s << ']'; 361 365 //qDebug() << "dasharray: pen has" << dasharray; 362 366 //qDebug() << " => " << result; … … 916 920 { 917 921 QByteArray s = string; 918 s.replace( " ", "");919 s.replace( "(", "");920 s.replace( ")", "");921 s.replace( "<", "");922 s.replace( ">", "");923 s.replace( "[", "");924 s.replace( "]", "");925 s.replace( "{", "");926 s.replace( "}", "");927 s.replace( "/", "");928 s.replace( "%", "");922 s.replace(' ', ""); 923 s.replace('(', ""); 924 s.replace(')', ""); 925 s.replace('<', ""); 926 s.replace('>', ""); 927 s.replace('[', ""); 928 s.replace(']', ""); 929 s.replace('{', ""); 930 s.replace('}', ""); 931 s.replace('/', ""); 932 s.replace('%', ""); 929 933 return s; 930 934 } … … 965 969 void QPdfBaseEngine::drawPoints (const QPointF *points, int pointCount) 966 970 { 967 Q_D(QPdfBaseEngine); 968 if (!points || !d->hasPen) 971 if (!points) 969 972 return; 970 973 … … 996 999 997 1000 Q_D(QPdfBaseEngine); 1001 if (d->useAlphaEngine) { 1002 QAlphaPaintEngine::drawRects(rects, rectCount); 1003 if (!continueCall()) 1004 return; 1005 } 1006 998 1007 if (d->clipEnabled && d->allClipped) 999 1008 return; … … 1463 1472 QList<QVariant> margins(value.toList()); 1464 1473 Q_ASSERT(margins.size() == 4); 1465 d->leftMargin = margins.at(0).to Double();1466 d->topMargin = margins.at(1).to Double();1467 d->rightMargin = margins.at(2).to Double();1468 d->bottomMargin = margins.at(3).to Double();1474 d->leftMargin = margins.at(0).toReal(); 1475 d->topMargin = margins.at(1).toReal(); 1476 d->rightMargin = margins.at(2).toReal(); 1477 d->bottomMargin = margins.at(3).toReal(); 1469 1478 d->hasCustomPageMargins = true; 1470 1479 break; … … 1568 1577 << d->rightMargin << d->bottomMargin; 1569 1578 } else { 1570 const intdefaultMargin = 10; // ~3.5 mm1579 const qreal defaultMargin = 10; // ~3.5 mm 1571 1580 margins << defaultMargin << defaultMargin 1572 1581 << defaultMargin << defaultMargin; … … 1648 1657 // leave stdin/out/err untouched 1649 1658 while(--i > 2) 1650 ::close(i);1659 QT_CLOSE(i); 1651 1660 } 1652 1661 #endif … … 1682 1691 pr = printerName; 1683 1692 int fds[2]; 1684 if ( pipe(fds) != 0) {1693 if (qt_safe_pipe(fds) != 0) { 1685 1694 qWarning("QPdfPrinter: Could not open pipe to print"); 1686 1695 return false; … … 1701 1710 (void)execl("/bin/true", "true", (char *)0); 1702 1711 (void)execl("/usr/bin/true", "true", (char *)0); 1703 :: exit(0);1712 ::_exit(0); 1704 1713 } 1705 dup2(fds[0], 0);1714 qt_safe_dup2(fds[0], 0, 0); 1706 1715 1707 1716 closeAllOpenFds(); … … 1765 1774 (void)execv("/usr/bin/lp", lpargs); 1766 1775 (void)execv("/usr/bin/lpr", lprargs); 1776 1777 delete []lpargs; 1778 delete []lprargs; 1767 1779 } 1768 1780 // if we couldn't exec anything, close the fd, … … 1770 1782 // child of the GUI process) has exited. then 1771 1783 // exit. 1772 ::close(0);1784 QT_CLOSE(0); 1773 1785 (void)::sleep(1); 1774 :: exit(0);1786 ::_exit(0); 1775 1787 } 1776 1788 // parent process 1777 ::close(fds[0]);1789 QT_CLOSE(fds[0]); 1778 1790 fd = fds[1]; 1779 (void) ::waitpid(pid, 0, 0);1791 (void)qt_safe_waitpid(pid, 0, 0); 1780 1792 1781 1793 if (fd < 0) … … 1924 1936 if (ti.fontEngine->type() == QFontEngine::Win) { 1925 1937 QFontEngineWin *fe = static_cast<QFontEngineWin *>(ti.fontEngine); 1926 size = fe->tm. w.tmHeight;1938 size = fe->tm.tmHeight; 1927 1939 } 1928 1940 #endif … … 1930 1942 QVarLengthArray<glyph_t> glyphs; 1931 1943 QVarLengthArray<QFixedPoint> positions; 1932 QTransform m; 1933 m.translate(p.x(), p.y()); 1944 QTransform m = QTransform::fromTranslate(p.x(), p.y()); 1934 1945 ti.fontEngine->getGlyphPositions(ti.glyphs, m, ti.flags, 1935 1946 glyphs, positions);
Note:
See TracChangeset
for help on using the changeset viewer.