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

Bug 311676

Summary: [Acceptance] Chart resize does not work correctly if input invalid value
Product: z_Archived Reporter: Xiaodan Wang <xwang>
Component: BIRTAssignee: Heng Li <liheeng>
Status: CLOSED FIXED QA Contact: Maggie Shen <lshen>
Severity: normal    
Priority: P3 CC: Lionel.wyl, xuelan.li
Version: 2.6.0   
Target Milestone: Future   
Hardware: PC   
OS: Windows XP   
Whiteboard: Non-Auto
Attachments:
Description Flags
screenshot
none
zero value none

Description Xiaodan Wang CLA 2010-05-05 05:12:52 EDT
Created attachment 167089 [details]
screenshot

Description:
Chart resize does not work correctly if input invalid value.

Build number:
2.6.0.v20100505-0630

Steps to reproduce:
1. New a chart, in Property Editor->General, input -10 for Width, and press enter, check the size of the chart.

Expected result:
Input invalid value, default will be used.

Actual result:
Input invalid value, 0 is used (see the screenshot).

Error log:
N/A
Comment 1 Heng Li CLA 2010-05-11 23:30:25 EDT
Fixed by setting default width/height if it was set to zero or negative values.
Comment 2 Maggie Shen CLA 2010-05-13 02:46:24 EDT
Reopen the bug as though size does not change, the value is changed to 0.
Comment 3 Maggie Shen CLA 2010-05-13 02:46:49 EDT
Created attachment 168328 [details]
zero value
Comment 4 Heng Li CLA 2010-05-14 01:04:49 EDT
fixed
Comment 5 Maggie Shen CLA 2010-05-17 02:01:14 EDT
There're still two problems:
1. The unit changes to 'inch'.
2. Exception is thrown out when change the height.
Comment 6 Heng Li CLA 2010-05-17 02:19:38 EDT
(In reply to comment #5)
> There're still two problems:
> 1. The unit changes to 'inch'.
> 2. Exception is thrown out when change the height.

It needs model team take a look to find out why the unit is changed to 'inch'. The cause of the 2th problem is caused by 1th, because the width/height is changed to inch, so the image size is greater than size of java heap, so it throws exception.

Steps to reproduce:
1. New a chart.
2. In property editor, input -100 as width of chart, then press enter to apply this change.
3. The unit of width in property editor is changed from pt to inch, the chart width is vary large.

Note: It seems if the initial unit of width/height is pt, this case will happen. If the initial unit is inch, it is ok.
Comment 7 Xuelan Li CLA 2010-05-17 02:32:22 EDT
If user passes a double as the value for height/weight, Model will add the default unit to the memory value, for all these two property values must be valid dimension value: measure+unit. Different dimension property defines different unit
in ROM.def. If user wants to specifies the unit rather than the default one, he/she must pass the right input value to Model APIs. Assign GUI to refactor codes.
Comment 8 Heng Li CLA 2010-05-17 02:43:06 EDT
Fixed by using correct API of report model.
Comment 9 Xiaodan Wang CLA 2010-05-18 01:40:40 EDT
Verified in build (2.6.0.v20100518-1142), closed.
Comment 10 Heng Li CLA 2010-05-24 04:26:29 EDT
Reopen this bug due to endless loop on 'undo' operation. previous fix is not good solution, it caused undo operation failure. Since the width/height properties in property editor are depending on designer UI, there is also a bug in designer UI about this bug. Chart will defer this bug until designer UI fix the related bug. Now chart will rollback code and keep the behavior like table.
Comment 11 Xiaodan Wang CLA 2010-09-14 23:24:04 EDT
This works correctly in build (2.6.1.v20100915-0630).

Set as Fixed.
Comment 12 Maggie Shen CLA 2010-09-15 02:06:54 EDT
close.verified on build 2.6.1 v20100915-0630.