Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-3768

When eliding text that has RtoL text in it then the ellipsis is drawn in the wrong place

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.0.0
    • 4.4.3
    • GUI: Text handling
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            anshaw Andy Shaw (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes