Project: Birt
Bug 114882 Exception is thrown when set invalid font size in Source
Reported: 2005-11-03 03:09:10 | Status: closed fixed

Description: Exception is thrown when set invalid font size in Source Steps to reproduce: 1. Insert a report item. 2. Select it and set font size to -1pt in Property Editor, press enter. 3. Transfer to Source, set font size to -1pt and save the report. Expected result: Error dialog about the invalid size value shows up. Actual result: In step 2, we got a birt exception: A Birt exception occurred. Plug-in Provider:Eclipse.org Plug-in Name:BIRT Model Plug-in ID:org.eclipse.birt.report.model Version:1.0.1 Error Code:Error.PropertyValueException.NON_POSITIVE_VALUE Error Message:Value "-1pt" for property "fontSize" is invalid, the value should be positive. It's expected behavior. But in step 3, we got org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalArgumentException: Argument not valid) 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.dialogs.EventLoopProgressMonitor.runEventLoop (EventLoopProgressMonitor.java:123) at org.eclipse.ui.internal.dialogs.EventLoopProgressMonitor.isCanceled (EventLoopProgressMonitor.java:97) at org.eclipse.ui.texteditor.AbstractDocumentProvider$1 $SaveOperation.execute(AbstractDocumentProvider.java:610) at org.eclipse.ui.texteditor.AbstractDocumentProvider$DocumentProviderOperation.run (AbstractDocumentProvider.java:74) at org.eclipse.ui.texteditor.AbstractDocumentProvider.executeOperation (AbstractDocumentProvider.java:551) at org.eclipse.ui.texteditor.AbstractDocumentProvider.saveDocument (AbstractDocumentProvider.java:627) at org.eclipse.birt.report.designer.internal.ui.editor.context.DesignFileInputConte xt.doSave(DesignFileInputContext.java:126) at org.eclipse.birt.report.designer.internal.ui.editors.parts.AbstractMultiPageLayo utEditor.doSave(AbstractMultiPageLayoutEditor.java:469) at org.eclipse.ui.internal.SaveableHelper$1.run(SaveableHelper.java:95) at org.eclipse.ui.internal.SaveableHelper$2.run(SaveableHelper.java:116) at org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java:346) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:291) at org.eclipse.jface.window.ApplicationWindow$1.run (ApplicationWindow.java:624) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.jface.window.ApplicationWindow.run (ApplicationWindow.java:621) at org.eclipse.ui.internal.WorkbenchWindow.run (WorkbenchWindow.java:2134) at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation (SaveableHelper.java:122) at org.eclipse.ui.internal.SaveableHelper.savePart (SaveableHelper.java:100) at org.eclipse.ui.internal.EditorManager.savePart (EditorManager.java:1149) at org.eclipse.ui.internal.WorkbenchPage.savePart (WorkbenchPage.java:2673) at org.eclipse.ui.internal.WorkbenchPage.saveEditor (WorkbenchPage.java:2686) at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:69) at org.eclipse.jface.action.Action.runWithEvent(Action.java:996) at org.eclipse.jface.commands.ActionHandler.execute (ActionHandler.java:117) at org.eclipse.core.commands.Command.execute(Command.java:311) at org.eclipse.core.commands.ParameterizedCommand.execute (ParameterizedCommand.java:396) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand (WorkbenchKeyboard.java:459) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press (WorkbenchKeyboard.java:781) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent (WorkbenchKeyboard.java:828) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings (WorkbenchKeyboard.java:550) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3 (WorkbenchKeyboard.java:493) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent (WorkbenchKeyboard.java:117) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:917) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:867) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:852) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:880) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:876) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1190) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3135) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3038) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3706) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1656) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2711) 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 (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) 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.IllegalArgumentException: Argument not valid at org.eclipse.swt.SWT.error(SWT.java:2926) at org.eclipse.swt.SWT.error(SWT.java:2865) at org.eclipse.swt.SWT.error(SWT.java:2836) at org.eclipse.swt.graphics.FontData.setHeight(FontData.java:464) at org.eclipse.swt.graphics.FontData.<init>(FontData.java:261) at org.eclipse.birt.report.designer.util.FontManager.getFont (FontManager.java:42) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.ReportE lementEditPart.getFont(ReportElementEditPart.java:493) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.LabelEd itPart.refreshFigure(LabelEditPart.java:145) at org.eclipse.birt.report.designer.internal.ui.editors.notification.DeferredRefres hManager.markEditPartForRefreshVisuals(DeferredRefreshManager.java:107) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.ReportE lementEditPart.refreshVisuals(ReportElementEditPart.java:510) at org.eclipse.gef.editparts.AbstractEditPart.refresh (AbstractEditPart.java:683) at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh (AbstractGraphicalEditPart.java:554) at org.eclipse.gef.editparts.AbstractEditPart.addNotify (AbstractEditPart.java:232) at org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotify (AbstractGraphicalEditPart.java:212) at org.eclipse.gef.editparts.AbstractEditPart.addChild (AbstractEditPart.java:195) at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren (AbstractEditPart.java:734) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.ReportE lementEditPart.refreshChildrenFigures(ReportElementEditPart.java:520) at org.eclipse.birt.report.designer.internal.ui.editors.notification.DeferredRefres hManager.refreshChildrenEditParts(DeferredRefreshManager.java:70) at org.eclipse.birt.report.designer.internal.ui.editors.notification.DeferredRefres hManager.refreshEditParts(DeferredRefreshManager.java:41) at org.eclipse.birt.report.designer.internal.ui.editors.notification.ReportDeferred UpdateManager.performUpdate(ReportDeferredUpdateManager.java:32) 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) ... 64 more

Files changed in fix:
UI/org.eclipse.birt.report.designer.core/src/org/eclipse/birt/report/designer/util/FontManager.java