Bug 121077 - Exceptions when enter negative number in Font Height Value in Property View. Diagram corrupted when Closed and reopened
Summary: Exceptions when enter negative number in Font Height Value in Property View. ...
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 major
Target Milestone: ---   Edit
Assignee: Tom Macdougall CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2005-12-15 11:41 EST by Steven R. Shaw CLA
Modified: 2006-09-11 00:07 EDT (History)
0 users

See Also:


Attachments
patch for font height validation (5.04 KB, patch)
2006-01-10 10:00 EST, Tom Macdougall CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steven R. Shaw CLA 2005-12-15 11:41:09 EST
Problem: Exceptions when enter negative number in Font Height  Value in Property View. Diagram corrupted when Closed and reopened
Expected: should not be allowed to enter negative numbers in Font Property Value (in Toolbar the Font can be selected from a list box so you are not able to enter negative numbers

Supporting:
Tested with  Capspian I5 build Xtools_esdk_700-20051014_0200 from:
 \\kan-bld-repos\pxdebld\builds\7.0.0\GA\Iteration5\Xtools_esdk\Xtools_esdk_700-20051014_0200\I5_FVT_Verify\Almost-RSA-2005Oct14.zip
based on Eclipse SDK/Version: 3.1.1/Build id: M20050914-1235

Steps: 
1. Just create a Logic diagram.
2. Create a Note
3. Select the note and open Property View.
4. Select Advanced Tab  n Property View and expand View->Styles node 
5. Add any negative number in Font Height  property Value (e.g. -100 ) and press Enter.
Actual: Teh value is accepted and shows as the negative numbetr (-100) and  you get exceptions in log (see below the error log):
Expected: negative number should not get accepted (should be the same as when you try to enter alphabetic characters)
Now if you try to close the diagram and reopen it, yopu get a biunch of other errors and Diagram is corrupted - cannot open it anymore

Errol log when enter negative number in Font Height 
!ENTRY org.eclipse.gmf.runtime.emf.core 4 1 2005-11-04 11:16:57.640
!MESSAGE Event handler failed.
!STACK 0
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.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.refreshFont(GraphicalEditPart.java:649)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart.handleNotificationEvent(ShapeEditPart.java:109)
Comment 1 Tom Macdougall CLA 2006-01-10 10:00:58 EST
Created attachment 32761 [details]
patch for font height validation

This patch has not been committed and may be followed up with another patch if the affected files change.
Comment 2 Tom Macdougall CLA 2006-01-17 11:05:58 EST
Committed the code.
Comment 3 Eclipse Webmaster CLA 2010-07-19 12:30:27 EDT
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug