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

On the Cocoa port, layouting a text containing the BOM result in an infinite loop

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.6.0, 4.7.1
    • 4.5.3
    • GUI: Text handling
    • None
    • 2f9c37c4b48c4b5005c89f1c5a5fa036e1e22811

    Description

      On the Cocoa port, layouting a text containing the BOM result in an infinite loop.

      Here is the test case:

      diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp
      index 5ccae94..8bdccd4 100644
      — a/tests/auto/qtextlayout/tst_qtextlayout.cpp
      +++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp
      @@ -118,7 +118,7 @@ private slots:
      void smallTextLengthWordWrap();
      void smallTextLengthWrapAtWordBoundaryOrAnywhere();
      void testLineBreakingAllSpaces();
      -
      + void lineWidthFromBOM();

      private:
      QFont testFont;
      @@ -1033,6 +1033,16 @@ void tst_QTextLayout::testLineBreakingAllSpaces()
      QCOMPARE(line2.naturalTextWidth(), 3. * TESTFONT_SIZE);
      }

      +void tst_QTextLayout::lineWidthFromBOM()
      +

      { + const QString string(QChar(65279)); // BYTE ORDER MARK + QTextLayout layout(string); + layout.beginLayout(); + QTextLine line = layout.createLine(); + line.setLineWidth(INT_MAX/256); + layout.endLayout(); +}

      +
      void tst_QTextLayout::tabsForRtl()
      {
      QString word(QChar(0x5e9)); // a hebrew character

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            poulain Benjamin Poulain (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