Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316176

Summary: String index out of range in legend truncation
Product: z_Archived Reporter: Steve Schafer <sschafer>
Component: BIRTAssignee: Birt-Chart-inbox <Birt-Chart-inbox>
Status: VERIFIED FIXED QA Contact: Xiaoying Gu <bluesoldier>
Severity: normal    
Priority: P3 CC: bluesoldier, xzhu
Version: unspecified   
Target Milestone: 3.7.0   
Hardware: PC   
OS: Windows 7   
Whiteboard: Obsolete
Attachments:
Description Flags
Simple report that illustrates the problem. none

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.