Mercurial > 510Connectbot
comparison src/org/tn5250j/framework/tn5250/tnvt.java @ 348:29076621bab0
merge tn5250j r1227; fix spelling
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Fri, 01 Aug 2014 10:25:44 -0700 |
parents | 071eccdff8ea |
children | d26faad31533 |
comparison
equal
deleted
inserted
replaced
347:bb7d8a7babbe | 348:29076621bab0 |
---|---|
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 * | 22 * |
23 */ | 23 */ |
24 package org.tn5250j.framework.tn5250; | 24 package org.tn5250j.framework.tn5250; |
25 | 25 |
26 import static java.lang.Math.max; | |
27 import static java.lang.Math.min; | |
26 import static org.tn5250j.TN5250jConstants.AID_HELP; | 28 import static org.tn5250j.TN5250jConstants.AID_HELP; |
27 import static org.tn5250j.TN5250jConstants.AID_PRINT; | 29 import static org.tn5250j.TN5250jConstants.AID_PRINT; |
28 import static org.tn5250j.TN5250jConstants.CMD_CLEAR_FORMAT_TABLE; | 30 import static org.tn5250j.TN5250jConstants.CMD_CLEAR_FORMAT_TABLE; |
29 import static org.tn5250j.TN5250jConstants.CMD_CLEAR_UNIT; | 31 import static org.tn5250j.TN5250jConstants.CMD_CLEAR_UNIT; |
30 import static org.tn5250j.TN5250jConstants.CMD_CLEAR_UNIT_ALTERNATE; | 32 import static org.tn5250j.TN5250jConstants.CMD_CLEAR_UNIT_ALTERNATE; |
1143 sa[sac++] = (byte) la; | 1145 sa[sac++] = (byte) la; |
1144 } | 1146 } |
1145 else { | 1147 else { |
1146 if (planes.getCharAttr(y) != la) { | 1148 if (planes.getCharAttr(y) != la) { |
1147 la = planes.getCharAttr(y); | 1149 la = planes.getCharAttr(y); |
1148 sac--; | 1150 sac = max(sac--, 0); |
1149 sa[sac++] = (byte) la; | 1151 sa[sac++] = (byte) la; |
1150 } | 1152 } |
1151 | 1153 |
1152 //LDC: Check to see if it is an displayable character. If not, | 1154 //LDC: Check to see if it is an displayable character. If not, |
1153 // do not convert the character. | 1155 // do not convert the character. |
1158 byte byteCh = (byte) ch; | 1160 byte byteCh = (byte) ch; |
1159 | 1161 |
1160 if (isDataUnicode(ch)) | 1162 if (isDataUnicode(ch)) |
1161 byteCh = codePage.uni2ebcdic(ch); | 1163 byteCh = codePage.uni2ebcdic(ch); |
1162 | 1164 |
1163 sa[sac++] = byteCh; | 1165 sa[min(sac++, len - 1)] = byteCh; |
1164 } | 1166 } |
1165 } | 1167 } |
1166 } | 1168 } |
1167 | 1169 |
1168 private final void fillRegenerationBuffer(ByteArrayOutputStream sc, int rows, int cols) | 1170 private final void fillRegenerationBuffer(ByteArrayOutputStream sc, int rows, int cols) |
1201 sa[sac++] = (byte) la; | 1203 sa[sac++] = (byte) la; |
1202 } | 1204 } |
1203 else { | 1205 else { |
1204 if (planes.getCharAttr(y) != la) { | 1206 if (planes.getCharAttr(y) != la) { |
1205 la = planes.getCharAttr(y); | 1207 la = planes.getCharAttr(y); |
1206 sac--; | 1208 sac = max(sac--, 0); |
1207 sa[sac++] = (byte) la; | 1209 sa[sac++] = (byte) la; |
1208 } | 1210 } |
1209 | 1211 |
1210 //LDC: Check to see if it is an displayable character. If not, | 1212 //LDC: Check to see if it is an displayable character. If not, |
1211 // do not convert the character. | 1213 // do not convert the character. |
1216 byte byteCh = (byte) ch; | 1218 byte byteCh = (byte) ch; |
1217 | 1219 |
1218 if (isDataUnicode(ch)) | 1220 if (isDataUnicode(ch)) |
1219 byteCh = codePage.uni2ebcdic(ch); | 1221 byteCh = codePage.uni2ebcdic(ch); |
1220 | 1222 |
1221 sa[sac++] = byteCh; | 1223 sa[min(sac++, len - 1)] = byteCh; |
1222 } | 1224 } |
1223 } | 1225 } |
1224 } | 1226 } |
1225 catch (Exception exc) { | 1227 catch (Exception exc) { |
1226 Log.i(TAG, exc.getMessage()); | 1228 Log.i(TAG, exc.getMessage()); |