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

Bug 322215

Summary: PasteCommand problem with ExtendedItem container
Product: z_Archived Reporter: Vladimír Hájek <hajek>
Component: BIRTAssignee: Dazheng Gao <gump_gao>
Status: RESOLVED FIXED QA Contact: Xiaoying Gu <bluesoldier>
Severity: normal    
Priority: P3 CC: bluesoldier, zqian
Version: unspecified   
Target Milestone: 3.7.1   
Hardware: PC   
OS: Windows Vista   
Whiteboard: Obsolete
Attachments:
Description Flags
Suggested bug fix
none
Suggested patch. none

Description Vladimír Hájek CLA 2010-08-10 06:58:55 EDT
Build Identifier: 20100617-1415

I created ExtendedItem which serves as container. I can drag&drop report items inside this ExtendedItem. It works perfectly when I drag&drop report item to the end of container, but it fails when I drag&drop report item in front of some item already inserted in container. Problem is in PasteCommand method calculatePositionAndSlotId. Suggested bug fix is attached.

Reproducible: Always

Steps to Reproduce:
1. Insert ExtendedItem container and two other items into report.
2. Drag&drop the first item into container.
3. Drag&drop the second item into container in front of the first item.
4. Assert slotID >= 0 in DEUtil.findPos occurres.

Assert is caused by bug in PasteCommand.calculatePositionAndSlotId().
Comment 1 Vladimír Hájek CLA 2010-08-10 07:06:36 EDT
Created attachment 176221 [details]
Suggested bug fix
Comment 2 Zhiqiang Qian CLA 2010-08-10 22:17:29 EDT
Thanks for the finding. We'll merge the fix.
Comment 3 Dazheng Gao CLA 2010-08-11 22:23:43 EDT
Fixed.
Thanks a lot.
Comment 4 Xiaoying Gu CLA 2010-09-08 23:34:01 EDT
Verified in daily build 201009080603.
Comment 5 Vladimír Hájek CLA 2011-07-01 05:54:33 EDT
I can confirm that this particular bug is fixed in BIRT 3.7, but I am disappointed, because...

1. Insert ExtendedItem container and two other items into report.
2. Drag&drop Item1 into container.
3. Drag&drop Item2 into container in front of Item1.
4. OK. No assertion occures and Item2 is correctly placed in front of Item1.
-----
5. Drag&drop Item1 in front of Item2.
6. NullPointerException in DEUtil.findInsertPosition(DEUtil.java:676) occures.

It wasn't obviously tested at all.
Comment 6 Vladimír Hájek CLA 2011-07-01 07:51:03 EDT
1.-4. as above
-----
5. Drag&drop Item2 behind Item1.
6. ContentException: The report.Body[0] has no slot (id:-1)
Comment 7 Vladimír Hájek CLA 2011-07-01 09:51:43 EDT
Created attachment 198968 [details]
Suggested patch.
Comment 8 Dazheng Gao CLA 2011-07-05 01:54:19 EDT
Fixed.The user can create your FlowMoveChildCommand in the police.Thank for your path.Don't change the DedignElementhandle class,So please check the code of the FlowMoveChildCommand class.