• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonwindowsphpgamebathyscapheguic翻訳omegattwitterframeworkbtronvb.net計画中(planning stage)testdomarduinodirectxpreviewerゲームエンジン

packages/apps/AndroidTerm


Commit MetaInfo

Revision0ebc55b1d64d501fd959a402e191413f5023d5aa (tree)
Zeit2012-03-26 10:21:27
AutorSteven Luo <steven+android@stev...>
CommiterJack Palevich

Log Message

Move some getChar() logic from UnicodeTranscript into FullUnicodeLine

Signed-off-by: Jack Palevich <jackpal@google.com>

Ändern Zusammenfassung

Diff

--- a/src/jackpal/androidterm/util/UnicodeTranscript.java
+++ b/src/jackpal/androidterm/util/UnicodeTranscript.java
@@ -691,19 +691,7 @@ public class UnicodeTranscript {
691691 }
692692
693693 FullUnicodeLine line = (FullUnicodeLine) mLines[row];
694- char[] rawLine = line.getLine();
695- int pos = line.findStartOfColumn(column);
696- int length;
697- if (column + 1 < mColumns) {
698- length = line.findStartOfColumn(column + 1) - pos;
699- } else {
700- length = line.getSpaceUsed() - pos;
701- }
702- if (charIndex >= length) {
703- throw new IllegalArgumentException();
704- }
705- out[offset] = rawLine[pos + charIndex];
706- return (charIndex + 1 < length);
694+ return line.getChar(column, charIndex, out, offset);
707695 }
708696
709697 public int getForeColor(int row, int column) {
@@ -898,6 +886,21 @@ class FullUnicodeLine {
898886 }
899887 }
900888
889+ public boolean getChar(int column, int charIndex, char[] out, int offset) {
890+ int pos = findStartOfColumn(column);
891+ int length;
892+ if (column + 1 < mColumns) {
893+ length = findStartOfColumn(column + 1) - pos;
894+ } else {
895+ length = getSpaceUsed() - pos;
896+ }
897+ if (charIndex >= length) {
898+ throw new IllegalArgumentException();
899+ }
900+ out[offset] = mText[pos + charIndex];
901+ return (charIndex + 1 < length);
902+ }
903+
901904 public void setChar(int column, int codePoint) {
902905 int columns = mColumns;
903906 if (column < 0 || column >= columns) {