From c9ae652487514acd19f3631224ced7ac14f756c8 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Tue, 22 Jan 2013 17:41:46 +0400 Subject: QPdfEnginePrivate: Fix invalid format for rectangles on some locales This is done by using locale-independent QByteArray::setNum() instead of qvsnprintf() for printing doubles. Task-number: QTBUG-24949 Change-Id: I68cb192417d9a94f72e039c40f647b4a6826a3b7 Reviewed-by: John Layt --- src/gui/painting/qpdf.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index 07a3caa51b..eed64180e5 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -2461,15 +2461,19 @@ void QPdfEnginePrivate::drawTextItem(const QPointF &p, const QTextItemInt &ti) trans.map(ti.width.toReal()/size, (ti.ascent.toReal()-ti.descent.toReal())/size, &x2, &y2); uint annot = addXrefEntry(-1); + QByteArray x1s, y1s, x2s, y2s; + x1s.setNum(static_cast(x1), 'f'); + y1s.setNum(static_cast(y1), 'f'); + x2s.setNum(static_cast(x2), 'f'); + y2s.setNum(static_cast(y2), 'f'); + QByteArray rectData = x1s + ' ' + y1s + ' ' + x2s + ' ' + y2s; + xprintf("<<\n/Type /Annot\n/Subtype /Link\n/Rect ["); + xprintf(rectData.constData()); #ifdef Q_DEBUG_PDF_LINKS - xprintf("<<\n/Type /Annot\n/Subtype /Link\n/Rect [%f %f %f %f]\n/Border [16 16 1]\n/A <<\n", + xprintf("]\n/Border [16 16 1]\n/A <<\n"); #else - xprintf("<<\n/Type /Annot\n/Subtype /Link\n/Rect [%f %f %f %f]\n/Border [0 0 0]\n/A <<\n", + xprintf("]\n/Border [0 0 0]\n/A <<\n"); #endif - static_cast(x1), - static_cast(y1), - static_cast(x2), - static_cast(y2)); xprintf("/Type /Action\n/S /URI\n/URI (%s)\n", ti.charFormat.anchorHref().toLatin1().constData()); xprintf(">>\n>>\n"); -- cgit v1.2.3 From 63569a68d2fd5ca90c4660e632fba2f3f3b37d73 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sat, 29 Dec 2012 02:09:39 +0800 Subject: Doc: Fix module name format Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtCore -> Qt Core QtDBus -> Qt D-Bus QtDesigner -> Qt Designer QtGui -> Qt GUI QtImageFormats -> Qt Image Formats QtNetwork -> Qt Network QtPrintSupport -> Qt Print Support QtScript -> Qt Script QtSql -> Qt SQL QtSvg -> Qt SVG QtTest -> Qt Test QtWebKit -> Qt WebKit QtWidgets -> Qt Widgets QtXml -> Qt XML QtConcurrent -> Qt Concurrent (partial) QtQuick -> Qt Quick (partial) Also, distinguish between "module" and "library" Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd Reviewed-by: Jerome Pasion --- src/gui/painting/qpainter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 0ab2ab5589..0811b5282f 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1387,7 +1387,7 @@ void QPainterPrivate::updateState(QPainterState *newState) cases where expensive operations are ok to use, for instance when the result is cached in a QPixmap. - \sa QPaintDevice, QPaintEngine, {QtSvg Module}, {Basic Drawing Example}, + \sa QPaintDevice, QPaintEngine, {Qt SVG}, {Basic Drawing Example}, {Drawing Utility Functions} */ -- cgit v1.2.3