summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2012-06-29 09:07:34 +0300
committerQt by Nokia <qt-info@nokia.com>2012-07-03 14:39:02 +0200
commitee4f50b2e78e1d8b4200866fa88dbf7dc5cffe26 (patch)
tree6ae195bd1911a0e363317c7980f257268c3a5c5b /src/corelib/tools
parentf4c9797d5ba7dd64e98d3c6fa90c791e422932dd (diff)
Add QChar::SoftHyphen enum value
Just like for the QChar::ByteOrderMark, `ch == QChar::SoftHyphen` is much more readable than `ch == 0x00ad // (soft-hyphen)`, etc. Change-Id: I9c85f14cfd979037d35103c3259a435fd729b869 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qchar.h1
-rw-r--r--src/corelib/tools/qunicodetools.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h
index 97edf12cc9..760b7a5f0e 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/tools/qchar.h
@@ -72,6 +72,7 @@ public:
CarriageReturn = 0x000d,
Space = 0x0020,
Nbsp = 0x00a0,
+ SoftHyphen = 0x00ad,
ReplacementCharacter = 0xfffd,
ObjectReplacementCharacter = 0xfffc,
ByteOrderMark = 0xfeff,
diff --git a/src/corelib/tools/qunicodetools.cpp b/src/corelib/tools/qunicodetools.cpp
index 1fef6aefc4..f8db6cbac3 100644
--- a/src/corelib/tools/qunicodetools.cpp
+++ b/src/corelib/tools/qunicodetools.cpp
@@ -480,7 +480,7 @@ static void getLineBreaks(const ushort *string, quint32 len, HB_CharAttributes *
switch (LB::breakTable[cls][ncls < QUnicodeTables::LineBreak_SA ? ncls : QUnicodeTables::LineBreak_AL]) {
case LB::DirectBreak:
lineBreakType = HB_Break;
- if (lucs4 == 0x00ad) // soft hyphen
+ if (lucs4 == QChar::SoftHyphen)
lineBreakType = HB_SoftHyphen;
break;
case LB::IndirectBreak: