(String tokenSource, CharacterDisplay display, ExportHandler eh)
| 34 | } |
| 35 | |
| 36 | @Override |
| 37 | public String getToken(String tokenSource, CharacterDisplay display, ExportHandler eh) |
| 38 | { |
| 39 | String oString = tokenSource; |
| 40 | String sourceText = tokenSource.substring(10); |
| 41 | |
| 42 | int infoType = -1; |
| 43 | |
| 44 | if (sourceText.startsWith("NAME")) |
| 45 | { |
| 46 | infoType = PaperInfo.NAME; |
| 47 | } |
| 48 | else if (sourceText.startsWith("HEIGHT")) |
| 49 | { |
| 50 | infoType = PaperInfo.HEIGHT; |
| 51 | } |
| 52 | else if (sourceText.startsWith("WIDTH")) |
| 53 | { |
| 54 | infoType = PaperInfo.WIDTH; |
| 55 | } |
| 56 | else if (sourceText.startsWith("MARGIN")) |
| 57 | { |
| 58 | sourceText = sourceText.substring(6); |
| 59 | |
| 60 | if (sourceText.startsWith("TOP")) |
| 61 | { |
| 62 | infoType = PaperInfo.TOPMARGIN; |
| 63 | } |
| 64 | else if (sourceText.startsWith("BOTTOM")) |
| 65 | { |
| 66 | infoType = PaperInfo.BOTTOMMARGIN; |
| 67 | } |
| 68 | else if (sourceText.startsWith("LEFT")) |
| 69 | { |
| 70 | infoType = PaperInfo.LEFTMARGIN; |
| 71 | } |
| 72 | else if (sourceText.startsWith("RIGHT")) |
| 73 | { |
| 74 | infoType = PaperInfo.RIGHTMARGIN; |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | if (infoType >= 0) |
| 79 | { |
| 80 | int offs = sourceText.indexOf('='); |
| 81 | String info = Globals.getPaperInfo(infoType); |
| 82 | |
| 83 | if (info == null) |
| 84 | { |
| 85 | if (offs >= 0) |
| 86 | { |
| 87 | oString = sourceText.substring(offs + 1); |
| 88 | } |
| 89 | } |
| 90 | else |
| 91 | { |
| 92 | oString = info; |
| 93 | } |
nothing calls this directly
no test coverage detected