Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-14316

mx.core.UITextField.truncateToFit() contains dead code

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • Adobe Flex SDK Previous
    • Apache Flex 4.10.0
    • mx: Label
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      The truncateToFit() method contains a line of dead code. The results of originalText.slice() are not assigned anywhere.

      if (originalText != "" && textWidth + TEXT_WIDTH_PADDING > w + 0.00000000000001)
      {
      // This should get us into the ballpark.
      var s:String = super.text = originalText;
      originalText.slice(0,
      Math.floor((w / (textWidth + TEXT_WIDTH_PADDING)) * originalText.length));

      while (s.length > 1 && textWidth + TEXT_WIDTH_PADDING > w)

      { s = s.slice(0, -1); super.text = s + truncationIndicator; }

      return true;
      }

      So maybe the AS3 compiler is optimizing this out, but the code should be removed/commented out from the SDK.

      Attachments

        Activity

          People

            Unassigned Unassigned
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: