diff options
author | Michele Calgaro <[email protected]> | 2025-01-30 23:40:14 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2025-02-13 22:39:34 +0900 |
commit | 9c648bea9bfb1113c070a05b36f78ff006d0877a (patch) | |
tree | 8318170d8f1fddf60e39686f5e3b872a6a610472 /src/kernel/tqrichtext_p.cpp | |
parent | 98a90524a1d706f1143f39fd707b620be3184042 (diff) | |
download | tqt3-9c648bea9bfb1113c070a05b36f78ff006d0877a.tar.gz tqt3-9c648bea9bfb1113c070a05b36f78ff006d0877a.zip |
Fix editing of text containing surrogate characters.
This relates to issue #162.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'src/kernel/tqrichtext_p.cpp')
-rw-r--r-- | src/kernel/tqrichtext_p.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/kernel/tqrichtext_p.cpp b/src/kernel/tqrichtext_p.cpp index e9417d2a9..165d319db 100644 --- a/src/kernel/tqrichtext_p.cpp +++ b/src/kernel/tqrichtext_p.cpp @@ -114,15 +114,15 @@ int TQTextCursor::x() const return 0; TQTextStringChar *c = para->at( idx ); int curx = c->x; - if ( !c->rightToLeft && - c->c.isSpace() && - idx > 0 && - para->at( idx - 1 )->c != '\t' && - !c->lineStart && - ( para->alignment() & TQt::AlignJustify ) == TQt::AlignJustify ) + if ( !c->rightToLeft && c->c.isSpace() && idx > 0 && para->at( idx - 1 )->c != '\t' && + !c->lineStart && ( para->alignment() & TQt::AlignJustify ) == TQt::AlignJustify ) + { curx = para->at( idx - 1 )->x + para->string()->width( idx - 1 ); + } if ( c->rightToLeft ) + { curx += para->string()->width( idx ); + } return curx; } |