Small improvement

This commit is contained in:
M66B 2022-04-25 11:56:22 +02:00
parent c16d9c0c89
commit 081d0a2d90
1 changed files with 28 additions and 26 deletions

View File

@ -752,7 +752,8 @@ public class FragmentCompose extends FragmentBase {
added = null;
}
if (removed != null) {
if (removed != null)
try {
ParagraphStyle[] ps = text.getSpans(removed, removed + 1, ParagraphStyle.class);
if (ps != null)
for (ParagraphStyle p : ps) {
@ -763,11 +764,12 @@ public class FragmentCompose extends FragmentBase {
}
StyleHelper.renumber(text, true, etBody.getContext());
} finally {
removed = null;
}
if (translated != null) {
if (translated != null)
try {
StyleHelper.TranslatedSpan[] spans =
text.getSpans(translated, translated, StyleHelper.TranslatedSpan.class);
for (StyleHelper.TranslatedSpan span : spans) {
@ -778,7 +780,7 @@ public class FragmentCompose extends FragmentBase {
text.removeSpan(span);
}
}
} finally {
translated = null;
}