Skip to content

Commit

Permalink
Updated review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
deepika-u committed Jul 9, 2024
1 parent 6736342 commit aae8e16
Showing 1 changed file with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2952,18 +2952,11 @@ StyleItem[] merge (long items, int itemCount) {
linkBefore = false;
}
char ch = segmentsText.charAt(start);
if(ch == '\r') {
if(ch == '\r' && (start+1 < end)) {
ch = segmentsText.charAt(start+1);
}
switch (ch) {
//case '\r':
case '\n':
item.lineBreak = true;
break;
case '\t':
item.tab = true;
break;
}
item.lineBreak = ch == '\n';
item.tab = ch == '\t';
if (itemLimit == -1) {
nextItemIndex = itemIndex + 1;
OS.MoveMemory(scriptItem, items + nextItemIndex * SCRIPT_ITEM.sizeof, SCRIPT_ITEM.sizeof);
Expand Down Expand Up @@ -3451,6 +3444,9 @@ public void setVerticalIndent (int verticalIndent) {
*/
public void setStyle (TextStyle style, int start, int end) {
checkLayout();
int length = text.length();
if (length == 0) return;
if (start > end) return;
int countNextLine = 0, noStyleCountNextLine = 0, loop = 0;
if (previousEnd < 0)
loop = previousEnd+1;
Expand All @@ -3473,9 +3469,6 @@ public void setStyle (TextStyle style, int start, int end) {
}
previousEnd = end;
end = end - previousCountNextLine;
int length = text.length();
if (length == 0) return;
if (start > end) return;
start = Math.min(Math.max(0, start), length - 1);
end = Math.min(Math.max(0, end), length - 1);
int low = -1;
Expand Down

0 comments on commit aae8e16

Please sign in to comment.