diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2012-05-29 05:38:28 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-30 01:54:45 +0200 |
commit | a9b30841b91736790600256b5db906cb2131ed63 (patch) | |
tree | 65fc6798b3355a3c3bd612bbad24b0446c2a3f36 /src | |
parent | 32c39330ef3b7a7adc00ab955549ab3a4742352c (diff) |
QTBF: fix the mandatory line breaks not being set in some cases
e.g. for the text "Aaa bbb ccc.\r\nDdd eee fff." the \r\n wasn't treated
as a hard line break or as a line break opportunity, ever.
Quite ancient bug...
Change-Id: I8d8497c55a3a4d51c27de99ccfe1e31f3bf4de77
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qunicodetools.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/tools/qunicodetools.cpp b/src/corelib/tools/qunicodetools.cpp index 0b784010a9..e503ecd65a 100644 --- a/src/corelib/tools/qunicodetools.cpp +++ b/src/corelib/tools/qunicodetools.cpp @@ -188,10 +188,11 @@ static void calcGraphemeAndLineBreaks(const ushort *string, quint32 len, HB_Char attributes[i].whiteSpace = true; HB_LineBreakType lineBreakType = HB_NoBreak; - if (cls >= QUnicodeTables::LineBreak_LF) { - lineBreakType = HB_ForcedBreak; - } else if (cls == QUnicodeTables::LineBreak_CR) { - lineBreakType = (ncls == QUnicodeTables::LineBreak_LF) ? HB_NoBreak : HB_ForcedBreak; + + if (cls >= QUnicodeTables::LineBreak_CR) { + if (cls > QUnicodeTables::LineBreak_CR || ncls != QUnicodeTables::LineBreak_LF) + lineBreakType = HB_ForcedBreak; + goto next; } if (ncls == QUnicodeTables::LineBreak_SP) |