summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qtextengine.cpp')
-rw-r--r--src/gui/text/qtextengine.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 34d9fa6b9a..06eed557cb 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -612,7 +612,7 @@ static bool bidiItemize(QTextEngine *engine, QScriptAnalysis *analysis, QBidiCon
} else {
eor = current;
}
- dir = QChar::DirON; status.eor = QChar::DirAN;
+ dir = QChar::DirAN; status.eor = QChar::DirAN;
break;
case QChar::DirCS:
if(status.eor == QChar::DirAN) {
@@ -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;
+ }
}
}