mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-01 17:26:12 +00:00
Optimization
This commit is contained in:
parent
fa2044668c
commit
3f5a7a72d3
1 changed files with 11 additions and 4 deletions
|
@ -3876,17 +3876,24 @@ public class HtmlHelper {
|
|||
int s = start.get(spans[i]);
|
||||
int e = end.get(spans[i]);
|
||||
int f = flags.get(spans[i]);
|
||||
boolean changed = false;
|
||||
if (spans[i] instanceof AlignmentSpan ||
|
||||
spans[i] instanceof BulletSpan ||
|
||||
spans[i] instanceof NumberSpan) {
|
||||
if (spans[i] instanceof AlignmentSpan &&
|
||||
!(e > 0 && ssb.charAt(e - 1) == '\n') &&
|
||||
e < ssb.length() && ssb.charAt(e) == '\n')
|
||||
e < ssb.length() && ssb.charAt(e) == '\n') {
|
||||
e++;
|
||||
if (s > 0 && ssb.charAt(s - 1) == '\n' &&
|
||||
e > 0 && ssb.charAt(e - 1) == '\n')
|
||||
f |= Spanned.SPAN_PARAGRAPH;
|
||||
changed = true;
|
||||
}
|
||||
if ((f & Spanned.SPAN_PARAGRAPH) == 0 &&
|
||||
s > 0 && ssb.charAt(s - 1) == '\n' &&
|
||||
e > 0 && ssb.charAt(e - 1) == '\n') {
|
||||
f |= Spanned.SPAN_PARAGRAPH;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (changed)
|
||||
ssb.setSpan(spans[i], s, e, f);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue