diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/image/qimage.cpp | 4 | ||||
-rw-r--r-- | src/gui/text/qtextengine.cpp | 16 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 300e04b..5829fe8 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -6689,6 +6689,10 @@ bool QImageData::convertInPlace(QImage::Format newFormat, Qt::ImageConversionFla if (format == newFormat) return true; + // No in-place conversion if we have to detach + if (ref > 1) + return false; + const InPlace_Image_Converter *const converterPtr = &inplace_converter_map[format][newFormat]; InPlace_Image_Converter converter = *converterPtr; if (converter) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 34d9fa6..f4f2168 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1976,9 +1976,11 @@ void QTextEngine::justify(const QScriptLine &line) if (kashida_pos >= 0) { // qDebug("kashida position at %d in word", kashida_pos); set(&justificationPoints[nPoints], kashida_type, g.mid(kashida_pos), fontEngine(si)); - minKashida = qMin(minKashida, justificationPoints[nPoints].kashidaWidth); - maxJustify = qMax(maxJustify, justificationPoints[nPoints].type); - ++nPoints; + if (justificationPoints[nPoints].kashidaWidth > 0) { + minKashida = qMin(minKashida, justificationPoints[nPoints].kashidaWidth); + maxJustify = qMax(maxJustify, justificationPoints[nPoints].type); + ++nPoints; + } } kashida_pos = -1; kashida_type = HB_Arabic_Normal; @@ -2002,9 +2004,11 @@ void QTextEngine::justify(const QScriptLine &line) } if (kashida_pos >= 0) { set(&justificationPoints[nPoints], kashida_type, g.mid(kashida_pos), fontEngine(si)); - minKashida = qMin(minKashida, justificationPoints[nPoints].kashidaWidth); - maxJustify = qMax(maxJustify, justificationPoints[nPoints].type); - ++nPoints; + if (justificationPoints[nPoints].kashidaWidth > 0) { + minKashida = qMin(minKashida, justificationPoints[nPoints].kashidaWidth); + maxJustify = qMax(maxJustify, justificationPoints[nPoints].type); + ++nPoints; + } } } |