Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.4.3
-
None
-
ca5918c8b8e0d4388b574cb019e6b770e7342884
Description
Explicit bidirectional control characters: RLO, LRO, RLE, LRE, PDF (in place of hex codes)
Consider the following string: RLO This is just a test string PDF
QString str;
str.append(QChar(0x202e)); // RLO
str.append("This is just a test string");
str.append(QChar(0x202c)); // PDF
Possibly modify the attached test app to verify.
If you use QFontMetrics::elideText to elide from left, you get something like as follows:
...is just a test string PDF
So RLO is lost and that visual appearance is drastically different.
Even with elide from right, problems may happens - then result text string is as follows:
RLO This is just ...
RLO is not termined as it was in original string and visual appearance is incorrect if you
insert this result of elideText to another string.
Based on these examples, it should be clear that similar problems happen with all explicit
bidirectional control characters & left, right and middle elide modes.
Suggested solutions: preserve control characters unless both override/embedding and
corresponding pop are removed in truncation.
Attachments
For Gerrit Dashboard: QTBUG-3768 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
23828,1 | Retain bidirectional marks when eliding text | master | qt/qtbase | Status: MERGED | +2 | 0 |