Project: Birt
Bug 117679 Exception is thrown out when deleting a table inside which there is a template item.
Reported: 2005-11-23 04:20:49 | Status: closed fixed

Description: Exception is thrown out when deleting a table inside which there is a template item. Steps to reproduce: 1. Add a table which is binded to a data set in a template file. 2. Transfer a label in a table cell to a template item. 3. Delete this table by pressing "delete" key. 4. Exception is thrown out. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException) at org.eclipse.swt.SWT.error(SWT.java:2942) at org.eclipse.swt.SWT.error(SWT.java:2865) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3057) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2716) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948) Caused by: java.lang.NullPointerException at org.eclipse.draw2d.FigureUtilities.setFont(FigureUtilities.java:369) at org.eclipse.draw2d.FigureUtilities.getFontMetrics(FigureUtilities.java:58) at org.eclipse.draw2d.text.TextFlow.getAscent(TextFlow.java:179) at org.eclipse.draw2d.text.TextFragmentBox.getOuterAscent(TextFragmentBox.java:78) at org.eclipse.draw2d.text.LineBox.add(LineBox.java:43) at org.eclipse.draw2d.text.LineRoot.add(LineRoot.java:48) at org.eclipse.draw2d.text.FlowContainerLayout.addToCurrentLine(FlowContainerLayout.java:46) at org.eclipse.draw2d.text.FlowUtilities.wrapFragmentInContext(FlowUtilities.java:182) at org.eclipse.draw2d.text.ParagraphTextLayout.layout(ParagraphTextLayout.java:181) at org.eclipse.draw2d.text.FlowFigureLayout.layout(FlowFigureLayout.java:101) at org.eclipse.draw2d.Figure.layout(Figure.java:1033) at org.eclipse.draw2d.Figure.validate(Figure.java:1736) at org.eclipse.draw2d.text.FlowContainerLayout.layoutChildren(FlowContainerLayout.java:112) at org.eclipse.draw2d.text.FlowContainerLayout.layout(FlowContainerLayout.java:98) at org.eclipse.draw2d.text.FlowFigureLayout.layout(FlowFigureLayout.java:101) at org.eclipse.draw2d.Figure.layout(Figure.java:1033) at org.eclipse.draw2d.Figure.validate(Figure.java:1736) at org.eclipse.draw2d.text.BlockFlow.validate(BlockFlow.java:300) at org.eclipse.draw2d.text.FlowPage.validate(FlowPage.java:132) at org.eclipse.draw2d.text.FlowPage.getPreferredSize(FlowPage.java:78) at org.eclipse.draw2d.StackLayout.calculatePreferredSize(StackLayout.java:71) at org.eclipse.draw2d.AbstractLayout.getPreferredSize(AbstractLayout.java:93) at org.eclipse.draw2d.AbstractHintLayout.getPreferredSize(AbstractHintLayout.java:85) at org.eclipse.draw2d.Figure.getPreferredSize(Figure.java:737) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.figures.LabelFigure.getPreferredSize(LabelFigure.java:126) at org.eclipse.birt.report.designer.internal.ui.layout.ReportFlowLayout.getChildSize(ReportFlowLayout.java:540) at org.eclipse.birt.report.designer.internal.ui.layout.ReportFlowLayout.layout(ReportFlowLayout.java:243) at org.eclipse.draw2d.Figure.layout(Figure.java:1033) at org.eclipse.draw2d.Figure.validate(Figure.java:1736) at org.eclipse.draw2d.Figure.validate(Figure.java:1738) at org.eclipse.draw2d.Figure.validate(Figure.java:1738) at org.eclipse.draw2d.FreeformLayeredPane.validate(FreeformLayeredPane.java:122) at org.eclipse.draw2d.Figure.validate(Figure.java:1738) at org.eclipse.draw2d.FreeformLayeredPane.validate(FreeformLayeredPane.java:122) at org.eclipse.draw2d.Figure.validate(Figure.java:1738) at org.eclipse.draw2d.Viewport.validate(Viewport.java:363) at org.eclipse.draw2d.DeferredUpdateManager.validateFigures(DeferredUpdateManager.java:271) at org.eclipse.draw2d.DeferredUpdateManager.performUpdate(DeferredUpdateManager.java:143) at org.eclipse.birt.report.designer.internal.ui.editors.notification.ReportDeferredUpdateManager.performUpdate(ReportDeferredUpdateManager.java:33) at org.eclipse.draw2d.DeferredUpdateManager$UpdateRequest.run(DeferredUpdateManager.java:40) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123) ... 18 more

Files changed in fix:
UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/editors/schematic/editparts/PlaceHolderEditPart.java UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/editors/schematic/editparts/ReportElementEditPart.java