mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-23 00:06:27 +00:00
Fixed table alignment
This commit is contained in:
parent
2a9eb01da7
commit
a773f28950
1 changed files with 15 additions and 28 deletions
|
@ -2140,36 +2140,23 @@ public class HtmlHelper {
|
||||||
setSpan(ssb, new StrikethroughSpan(), start, ssb.length());
|
setSpan(ssb, new StrikethroughSpan(), start, ssb.length());
|
||||||
break;
|
break;
|
||||||
case "text-align":
|
case "text-align":
|
||||||
boolean table = false;
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/text-align
|
||||||
Element e = element;
|
Layout.Alignment alignment = null;
|
||||||
while (e != null) {
|
switch (value) {
|
||||||
if ("table".equals(e.tagName()) ||
|
case "left":
|
||||||
"true".equals(e.attr("x-table"))) {
|
case "start":
|
||||||
table = true;
|
alignment = (ltr ? Layout.Alignment.ALIGN_NORMAL : Layout.Alignment.ALIGN_OPPOSITE);
|
||||||
|
break;
|
||||||
|
case "center":
|
||||||
|
alignment = Layout.Alignment.ALIGN_CENTER;
|
||||||
|
break;
|
||||||
|
case "right":
|
||||||
|
case "end":
|
||||||
|
alignment = (ltr ? Layout.Alignment.ALIGN_OPPOSITE : Layout.Alignment.ALIGN_NORMAL);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
e = e.parent();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!table) {
|
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/CSS/text-align
|
|
||||||
Layout.Alignment alignment = null;
|
|
||||||
switch (value) {
|
|
||||||
case "left":
|
|
||||||
case "start":
|
|
||||||
alignment = (ltr ? Layout.Alignment.ALIGN_NORMAL : Layout.Alignment.ALIGN_OPPOSITE);
|
|
||||||
break;
|
|
||||||
case "center":
|
|
||||||
alignment = Layout.Alignment.ALIGN_CENTER;
|
|
||||||
break;
|
|
||||||
case "right":
|
|
||||||
case "end":
|
|
||||||
alignment = (ltr ? Layout.Alignment.ALIGN_OPPOSITE : Layout.Alignment.ALIGN_NORMAL);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (alignment != null)
|
|
||||||
setSpan(ssb, new AlignmentSpan.Standard(alignment), start, ssb.length());
|
|
||||||
}
|
}
|
||||||
|
if (alignment != null)
|
||||||
|
setSpan(ssb, new AlignmentSpan.Standard(alignment), start, ssb.length());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue