- Timestamp:
- 2016-09-23T21:09:16+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
r10791 r11044 14 14 import java.awt.event.WindowAdapter; 15 15 import java.awt.event.WindowEvent; 16 import java.io.BufferedReader;17 16 import java.io.IOException; 18 import java.io.InputStreamReader;19 17 import java.io.StringReader; 20 18 import java.nio.charset.StandardCharsets; … … 50 48 import org.openstreetmap.josm.gui.widgets.JosmEditorPane; 51 49 import org.openstreetmap.josm.gui.widgets.JosmHTMLEditorKit; 50 import org.openstreetmap.josm.io.CachedFile; 52 51 import org.openstreetmap.josm.tools.ImageProvider; 53 52 import org.openstreetmap.josm.tools.InputMapUtils; … … 139 138 protected StyleSheet buildStyleSheet() { 140 139 StyleSheet ss = new StyleSheet(); 141 StringBuilder css = new StringBuilder(); 142 try (BufferedReader breader = new BufferedReader( 143 new InputStreamReader( 144 getClass().getResourceAsStream("/data/help-browser.css"), StandardCharsets.UTF_8 145 ) 146 )) { 147 String line; 148 while ((line = breader.readLine()) != null) { 149 css.append(line); 150 css.append('\n'); 151 } 140 final String css; 141 try (CachedFile cf = new CachedFile("resource://data/help-browser.css")) { 142 css = new String(cf.getByteContent(), StandardCharsets.ISO_8859_1); 152 143 } catch (IOException e) { 153 144 Main.error(tr("Failed to read CSS file ''help-browser.css''. Exception is: {0}", e.toString())); … … 155 146 return ss; 156 147 } 157 ss.addRule(css .toString());148 ss.addRule(css); 158 149 return ss; 159 150 }
Note:
See TracChangeset
for help on using the changeset viewer.