Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 150055

Summary: GVT: Zoom input field not I18N compliant (decimal separator)
Product: [Tools] GEF Reporter: Michael Hanner <mhanner>
Component: GEF-Legacy GEF (MVC)Assignee: Anthony Hunter <ahunter.eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.4.1 (Ganymede SR1)   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Michael Hanner CLA 2006-07-07 18:02:39 EDT
STEPS: 
	1. On an ENU system change the locale to German (Regional Options)	4. Create a diagram
	5. Change the Zoom % to e.g. 95.5
	6. Zoom adjusts to 96% (expected behavior)
	7. Now change the zoom to 95,5  but use a comma as the separator
                   (European format)
	
Result:	Nothing

Expected: The format in the zoom input field to adjust according to the set locale
Comment 1 Tom Macdougall CLA 2006-07-21 09:40:51 EDT
The problem appears to be with the GEF ZoomManager that uses Double.parseDouble
and should probably use NumberFormat to parse the original string:

From ZoomManager:

//Trim off the '%'
if (zoomString.charAt(zoomString.length() - 1) == '%')
	zoomString = zoomString.substring(0, zoomString.length() - 1);
  -->   double newZoom = Double.parseDouble(zoomString) / 100;
        setZoom(newZoom / multiplier);
Comment 2 Anthony Hunter CLA 2008-07-16 14:30:49 EDT
double newZoom = Double.parseDouble(zoomString) / 100;

changed to

double newZoom = NumberFormat.getInstance().parse(zoomString).doubleValue() /100;

Tested with German on Windows XP to verify.