Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316176 - String index out of range in legend truncation
Summary: String index out of range in legend truncation
Status: VERIFIED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7.0   Edit
Assignee: Birt-Chart-inbox@eclipse.org CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard: Obsolete
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-08 13:16 EDT by Steve Schafer CLA
Modified: 2011-05-26 13:32 EDT (History)
2 users (show)

See Also:


Attachments
Simple report that illustrates the problem. (40.10 KB, application/octet-stream)
2010-06-08 13:17 EDT, Steve Schafer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Schafer CLA 2010-06-08 13:16:12 EDT
Build Identifier: M20100211-1343

In org.eclipse.birt.chart.render.BaseRenderer at line 1274 there's this comment:

		// TODO: label text may be changed in script,
		// in such the ellipsis may need to be recalculated

This bit me when I tried to reduce the size of the legend label in beforeDrawLegendItem.  The BIRT code obtains the truncation index based on the legend label before the event and then attempts to do a substring after the event without checking the index.  I worked around the problem by appending spaces to the end of the string so it remained the same length, but it ought to be fixed.

Reproducible: Always

Steps to Reproduce:
Preview the attached report.
Comment 1 Steve Schafer CLA 2010-06-08 13:17:22 EDT
Created attachment 171430 [details]
Simple report that illustrates the problem.
Comment 2 Xingsheng Zhu CLA 2010-08-29 22:54:50 EDT
Fixed.
Comment 3 Xiaoying Gu CLA 2010-09-06 01:34:58 EDT
Verified in daily build 20100903-0630.