litesoft
Diff Revisions
947
vs
948
for /trunk/GWT_Sandbox/FormEngine/src/com/temp/client/foundation/support/useragent/nonpublic/UserAgentIE.java
|
@@ -1,7 +1,6 @@ |
1 |
1 |
|
package com.temp.client.foundation.support.useragent.nonpublic; |
2 |
2 |
|
|
3 |
|
- |
import com.temp.client.foundation.support.useragent.BrowserFamily; |
4 |
|
- |
import com.temp.client.foundation.support.useragent.UserAgent; |
|
3 |
+ |
import com.temp.client.foundation.support.useragent.*; |
5 |
4 |
|
|
6 |
5 |
|
/** |
7 |
6 |
|
* Represents IE - supporting code the UserAgent |
|
@@ -12,7 +11,7 @@ |
12 |
11 |
|
private boolean mLegacyIE; |
13 |
12 |
|
|
14 |
13 |
|
public UserAgentIE() { |
15 |
|
- |
super(BrowserFamily.IE, ""); |
|
14 |
+ |
super( BrowserFamily.IE, "" ); |
16 |
15 |
|
int zVersion = determineSpecificVersion(); |
17 |
16 |
|
mLegacyIE = (zVersion < 9); |
18 |
17 |
|
mSpecific = IE_PREFIX + zVersion; |
|
@@ -27,12 +26,13 @@ |
27 |
26 |
|
// 01234567890 |
28 |
27 |
|
private static int determineSpecificVersion() { |
29 |
28 |
|
String zUserAgent = getBrowserUserAgent(); |
30 |
|
- |
int atStart = zUserAgent.indexOf("; MSIE ") + 7; |
31 |
|
- |
int atEnd = zUserAgent.indexOf(".0;", atStart); |
32 |
|
- |
if ((atStart > 6) && (atEnd != -1) && (atEnd <= (atStart + 2))) { // Note: this will only work up to version 99! |
|
29 |
+ |
int atStart = zUserAgent.indexOf( "; MSIE " ) + 7; |
|
30 |
+ |
int atEnd = zUserAgent.indexOf( ".0;", atStart ); |
|
31 |
+ |
if ( (atStart > 6) && (atEnd != -1) && (atEnd <= (atStart + 2)) ) { // Note: this will only work up to version 99! |
33 |
32 |
|
try { |
34 |
|
- |
return Integer.parseInt(zUserAgent.substring(atStart, atEnd)); |
35 |
|
- |
} catch (NumberFormatException e) { |
|
33 |
+ |
return Integer.parseInt( zUserAgent.substring( atStart, atEnd ) ); |
|
34 |
+ |
} |
|
35 |
+ |
catch ( NumberFormatException e ) { |
36 |
36 |
|
// Really? Then Assume the default |
37 |
37 |
|
} |
38 |
38 |
|
} |