summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-01-10 18:27:48 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-01-10 18:27:49 +0100
commit7917dfbf1c54150d0ca3a79285767c22e6f9d770 (patch)
treea05973334097df480afe32d07db42f381b460e74 /src/gui
parentb9362903b339e57362a7a3296904504521d0e26f (diff)
parentb088e4827f427189334e8a1c5b4f2b8b0b713fc2 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qkeysequence.cpp3
-rw-r--r--src/gui/opengl/qtriangulator.cpp9
-rw-r--r--src/gui/painting/qpagedpaintdevice.cpp4
-rw-r--r--src/gui/painting/qpdf.cpp6
-rw-r--r--src/gui/painting/qpdf_p.h1
-rw-r--r--src/gui/painting/qpdfwriter.cpp2
6 files changed, 9 insertions, 16 deletions
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index ead248074e..5770b76f1f 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -1075,7 +1075,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
sl = accel;
}
}
-#else
+#endif
int i = 0;
int lastI = 0;
while ((i = sl.indexOf(QLatin1Char('+'), i + 1)) != -1) {
@@ -1110,7 +1110,6 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
}
lastI = i + 1;
}
-#endif
int p = accel.lastIndexOf(QLatin1Char('+'), str.length() - 2); // -2 so that Ctrl++ works
if(p > 0)
diff --git a/src/gui/opengl/qtriangulator.cpp b/src/gui/opengl/qtriangulator.cpp
index 77da009bf5..839ec9e96f 100644
--- a/src/gui/opengl/qtriangulator.cpp
+++ b/src/gui/opengl/qtriangulator.cpp
@@ -201,10 +201,12 @@ static inline qint64 qCross(const QPodPoint &u, const QPodPoint &v)
return qint64(u.x) * qint64(v.y) - qint64(u.y) * qint64(v.x);
}
+#ifdef Q_TRIANGULATOR_DEBUG
static inline qint64 qDot(const QPodPoint &u, const QPodPoint &v)
{
return qint64(u.x) * qint64(v.x) + qint64(u.y) * qint64(v.y);
}
+#endif
// Return positive value if 'p' is to the right of the line 'v1'->'v2', negative if left of the
// line and zero if exactly on the line.
@@ -249,13 +251,6 @@ static inline QIntersectionPoint qIntersectionPoint(const QPodPoint &point)
return p;
}
-static inline QIntersectionPoint qIntersectionPoint(int x, int y)
-{
- // upperLeft = (x, y), xOffset = 0/1, yOffset = 0/1.
- QIntersectionPoint p = {{x, y}, {0, 1}, {0, 1}};
- return p;
-}
-
static QIntersectionPoint qIntersectionPoint(const QPodPoint &u1, const QPodPoint &u2, const QPodPoint &v1, const QPodPoint &v2)
{
QIntersectionPoint result = {{0, 0}, {0, 0}, {0, 0}};
diff --git a/src/gui/painting/qpagedpaintdevice.cpp b/src/gui/painting/qpagedpaintdevice.cpp
index f41d1830fd..b95b3e3503 100644
--- a/src/gui/painting/qpagedpaintdevice.cpp
+++ b/src/gui/painting/qpagedpaintdevice.cpp
@@ -71,7 +71,7 @@ static const struct {
{125, 176}, // B6
{88, 125}, // B7
{62, 88}, // B8
- {33, 62}, // B9
+ {44, 62}, // B9
{163, 229}, // C5E
{105, 241}, // US Common
{110, 220}, // DLE
@@ -133,7 +133,7 @@ QPagedPaintDevice::~QPagedPaintDevice()
\value B6 125 x 176 mm
\value B7 88 x 125 mm
\value B8 62 x 88 mm
- \value B9 33 x 62 mm
+ \value B9 44 x 62 mm
\value B10 31 x 44 mm
\value C5E 163 x 229 mm
\value Comm10E 105 x 241 mm, U.S. Common 10 Envelope
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index c05f47c59d..147fa3f561 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -1486,7 +1486,6 @@ QPdfEnginePrivate::QPdfEnginePrivate()
leftMargin(10), topMargin(10), rightMargin(10), bottomMargin(10) // ~3.5 mm
{
resolution = 1200;
- postscript = false;
currentObject = 1;
currentPage = 0;
stroker.stream = 0;
@@ -1520,7 +1519,6 @@ bool QPdfEngine::begin(QPaintDevice *pdev)
d->ownsDevice = true;
}
- d->postscript = false;
d->currentObject = 1;
d->currentPage = new QPdfPage;
@@ -2506,8 +2504,8 @@ void QPdfEnginePrivate::drawTextItem(const QPointF &p, const QTextItemInt &ti)
QFontEngine::FaceId face_id = fe->faceId();
bool noEmbed = false;
if (face_id.filename.isEmpty()
- || (!postscript && ((fe->fsType & 0x200) /* bitmap embedding only */
- || (fe->fsType == 2) /* no embedding allowed */))) {
+ || fe->fsType & 0x200 /* bitmap embedding only */
+ || fe->fsType == 2 /* no embedding allowed */) {
*currentPage << "Q\n";
q->QPaintEngine::drawTextItem(p, ti);
*currentPage << "q\n";
diff --git a/src/gui/painting/qpdf_p.h b/src/gui/painting/qpdf_p.h
index 54530d0f78..ae2d4b00ac 100644
--- a/src/gui/painting/qpdf_p.h
+++ b/src/gui/painting/qpdf_p.h
@@ -250,7 +250,6 @@ public:
void newPage();
- bool postscript;
int currentObject;
QPdfPage* currentPage;
diff --git a/src/gui/painting/qpdfwriter.cpp b/src/gui/painting/qpdfwriter.cpp
index a783aad66a..27fb8b1646 100644
--- a/src/gui/painting/qpdfwriter.cpp
+++ b/src/gui/painting/qpdfwriter.cpp
@@ -209,6 +209,8 @@ void QPdfWriter::setMargins(const Margins &m)
{
Q_D(QPdfWriter);
+ QPagedPaintDevice::setMargins(m);
+
const qreal multiplier = 72./25.4;
d->engine->d_func()->leftMargin = m.left*multiplier;
d->engine->d_func()->rightMargin = m.right*multiplier;