Bug 182659 NPE throws out when drag one dimension under another dimension in the cube[1101]
Description: NPE throws out when drag one dimension under another dimension in the cube[1101] Build number: 2.2.0.v20070417-0630 Steps to reproduce: 1, New a cube with three dimensions 2, Drag the first dimension under the second dimension in the cube Expected result: No exceptions occurs Actual result: NPE occurs Error log: Error Tue Apr 17 09:13:38 GMT+08:00 2007 Unhandled event loop exception java.lang.NullPointerException at org.eclipse.birt.report.designer.util.DNDUtil.calculateNextPosition(DNDUtil.java:848) at org.eclipse.birt.report.designer.internal.ui.views.outline.dnd.DesignerDropListener.getPosition(DesignerDropListener.java:321) at org.eclipse.birt.report.designer.internal.ui.views.outline.dnd.DesignerDropListener.moveData(DesignerDropListener.java:165) at org.eclipse.birt.report.designer.internal.ui.dnd.DesignElementDropAdapter.performDrop(DesignElementDropAdapter.java:104) at org.eclipse.birt.report.designer.internal.ui.views.outline.dnd.DesignerDropListener.performDrop(DesignerDropListener.java:156) at org.eclipse.jface.viewers.ViewerDropAdapter.drop(ViewerDropAdapter.java:233) at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:90) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:706) at org.eclipse.swt.dnd.DropTarget.Drop(DropTarget.java:413) at org.eclipse.swt.dnd.DropTarget$3.method6(DropTarget.java:237) at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117) at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method) at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:322) at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:281) at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java:165) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3673) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3284) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2337) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2301) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2176) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:463) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:458) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:101) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:146) ...
UI/org.eclipse.birt.report.designer.core/src/org/eclipse/birt/report/designer/util/DNDUtil.java
{
			SlotHandle slot = (SlotHandle) selection;
			DesignElementHandle handle = slot.getElementHandle( );
			return slot.getContents( ).size( ) > 0
					&& ( handle instanceof ListHandle || handle instanceof ListGroupHandle );
		}
		if ( selection instanceof ColumnHandle
				&& ( (ColumnHandle) selection ).getRoot( ) != null )
		{
			int columnNumber = HandleAdapterFactory.getInstance( )
					.getColumnHandleAdapter( selection )
					.getColumnNumber( );
			Object parent = ( (ColumnHandle) selection ).getContainer( );
			if ( parent instanceof TableHandle )
			{
				return ( (TableHandle) parent ).canCopyColumn( columnNumber );
			}
			else if ( parent instanceof GridHandle )
			{
				return ( (GridHandle) parent ).canCopyColumn( columnNumber );
			}
		}
		return selection instanceof ReportItemHandle
				|| selection instanceof DataSetHandle
				|| selection instanceof DataSourceHandle
				|| selection instanceof ScalarParameterHandle
				|| selection instanceof ParameterGroupHandle
				
				|| selection instanceof GroupHandle
				|| selection instanceof StyleHandle