Return-Path: X-Original-To: apmail-flex-issues-archive@minotaur.apache.org Delivered-To: apmail-flex-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC0B518802 for ; Sun, 13 Dec 2015 12:46:46 +0000 (UTC) Received: (qmail 27637 invoked by uid 500); 13 Dec 2015 12:46:46 -0000 Delivered-To: apmail-flex-issues-archive@flex.apache.org Received: (qmail 27606 invoked by uid 500); 13 Dec 2015 12:46:46 -0000 Mailing-List: contact issues-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list issues@flex.apache.org Received: (qmail 27597 invoked by uid 99); 13 Dec 2015 12:46:46 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Dec 2015 12:46:46 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 9A2E22C1F6B for ; Sun, 13 Dec 2015 12:46:46 +0000 (UTC) Date: Sun, 13 Dec 2015 12:46:46 +0000 (UTC) From: "Harbs (JIRA)" To: issues@flex.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLEX-34988) Number of characters with images is wrong MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLEX-34988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15054940#comment-15054940 ] Harbs commented on FLEX-34988: ------------------------------ Here's the reason for the discrepancy: ParagraphElement.getText() has an optimization where it gets the TextBlock.content.rawText if the TextBlock has been created. A TextBlock is only created if the text has been composed. The rawText includes a unicode point for the inline graphic. (I think the unicode point is \uFDEF.) If the TextBlock does not exist, it recursively calls getText() for all the sub-elements. InlineGraphicElement does not define a getText() method, and the getText defaults to the method in FlowElement which returns an empty string. I'm not really sure what the "correct" behavior is for getText() on InlineGraphicElements... I guess we can add getText() to InlineGraphicElement which returns \uFDEF to be consistent with rawText in FTE. I'm not sure what else to do. > Number of characters with images is wrong > ----------------------------------------- > > Key: FLEX-34988 > URL: https://issues.apache.org/jira/browse/FLEX-34988 > Project: Apache Flex > Issue Type: Bug > Components: TLF > Affects Versions: Apache Flex 4.14.0 > Reporter: goratz > Attachments: Image.png, TLF_Bench_Images.as, TLF_Bench_Images.fla > > > Hi, I have a problem when I insert images in the text. When I get the text of the TLF the number of characters is wrong. It only counts the images that are displayed. > I build a test code to see the problem. > ----------------------------------------------------------------------------------------------- > I added 3 images, but getText() function only returns the last one. > NOTE_1: If you uncomment [oController.verticalScrollPosition = 0;] line after adding the 3rd image, it returns the first two images. > So, it seems getText() function only returns the images that have appeared on screen. > NOTE_2: On the other hand, as you can see in the example, the [textLength] attribute returns one more character than [getText().length]. -- This message was sent by Atlassian JIRA (v6.3.4#6332)