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

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 4.4.3
    • Fix Version/s: 5.0.0
    • Component/s: GUI: Text handling
    • Labels:
      None
    • Commits:
      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

          Activity

            People

            Assignee:
            esabraha Eskil Abrahamsen Blomfeldt
            Reporter:
            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