True clear all formatting

This commit is contained in:
M66B 2020-11-17 20:24:45 +01:00
parent e68a03252c
commit 238a3f1841
1 changed files with 2 additions and 9 deletions

View File

@ -440,19 +440,12 @@ public class StyleHelper {
}
case R.id.menu_clear: {
boolean selected = (start != end);
if (start == end) {
start = 0;
end = etBody.length();
}
for (Object span : ss.getSpans(start, end, Object.class))
for (Object span : ss.getSpans(0, etBody.length(), Object.class))
if (!(span instanceof ImageSpan))
ss.removeSpan(span);
etBody.setText(ss);
if (selected)
etBody.setSelection(start, end);
etBody.setSelection(start, end);
return true;
}