File tree Expand file tree Collapse file tree 1 file changed +6
-18
lines changed
src/java.desktop/share/classes/javax/swing/text/html Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -3088,27 +3088,15 @@ else if (value.equals("smaller")) {
30883088 }
30893089
30903090 float getValue (boolean w3cLengthUnits ) {
3091- Hashtable <String , Float > mapping = (w3cLengthUnits ) ? w3cLengthMapping : lengthMapping ;
3092- float scale = 1 ;
3093- if (units != null ) {
3094- Float scaleFloat = mapping .get (units );
3095- if (scaleFloat != null ) {
3096- scale = scaleFloat .floatValue ();
3097- }
3098- }
3099- return this .value * scale ;
3100-
3091+ return getValue (value , units , w3cLengthUnits );
31013092 }
31023093
3103- static float getValue (float value , String units , Boolean w3cLengthUnits ) {
3104- Hashtable <String , Float > mapping = (w3cLengthUnits ) ? w3cLengthMapping : lengthMapping ;
3105- float scale = 1 ;
3106- if (units != null ) {
3107- Float scaleFloat = mapping .get (units );
3108- if (scaleFloat != null ) {
3109- scale = scaleFloat .floatValue ();
3110- }
3094+ static float getValue (float value , String units , boolean w3cLengthUnits ) {
3095+ if (units == null ) {
3096+ return value ;
31113097 }
3098+ Hashtable <String , Float > mapping = (w3cLengthUnits ) ? w3cLengthMapping : lengthMapping ;
3099+ float scale = mapping .getOrDefault (units , 1f );
31123100 return value * scale ;
31133101 }
31143102
You can’t perform that action at this time.
0 commit comments