Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322215 - PasteCommand problem with ExtendedItem container
Summary: PasteCommand problem with ExtendedItem container
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal with 1 vote (vote)
Target Milestone: 3.7.1   Edit
Assignee: Dazheng Gao CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard: Obsolete
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-10 06:58 EDT by Vladimír Hájek CLA
Modified: 2011-07-06 22:44 EDT (History)
2 users (show)

See Also:


Attachments
Suggested bug fix (1.65 KB, text/plain)
2010-08-10 07:06 EDT, Vladimír Hájek CLA
no flags Details
Suggested patch. (4.97 KB, patch)
2011-07-01 09:51 EDT, Vladimír Hájek CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.