diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-01-29 18:05:37 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-01-30 19:06:32 +0900 |
| commit | b64537250370dd61e3d8ba037679bddbc0f79d61 (patch) | |
| tree | 9531e2d2fb79945ae821a2805079b93697e54734 /src/kernel/qtextengine.cpp | |
| parent | c919740e87c71232b3d2d1335efb2c4c293ff80c (diff) | |
| download | tqt-b6453725.tar.gz tqt-b6453725.zip | |
Add support for surrogate pairs to TQChar API.
This relates to issue #162.
The new code is partially taken from Qt4 but with some local rework.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit c5cda03125a6d34c179d968011083bceb87976bd)
Diffstat (limited to 'src/kernel/qtextengine.cpp')
| -rw-r--r-- | src/kernel/qtextengine.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/kernel/qtextengine.cpp b/src/kernel/qtextengine.cpp index f527cd86a..7ada261e9 100644 --- a/src/kernel/qtextengine.cpp +++ b/src/kernel/qtextengine.cpp @@ -819,8 +819,7 @@ static void calcLineBreaks(const TQString &str, TQCharAttributes *charAttributes if (category == TQChar::Other_Surrogate) { // char stop only on first pair - if (uc[i].unicode() >= 0xd800 && uc[i].unicode() < 0xdc00 && i < len-1 - && uc[i+1].unicode() >= 0xdc00 && uc[i+1].unicode() < 0xe000) + if (uc[i].isHighSurrogate() && i < (len - 1) && uc[i + 1].isLowSurrogate()) goto nsm; // ### correctly handle second surrogate } |
