Added character properties to numbering lists

This commit is contained in:
Georgy Litvinov 2020-01-16 13:32:26 +01:00
parent 06e9835f2a
commit 9511a7f674

View file

@ -30,7 +30,9 @@ import java.util.Enumeration;
import writer2latex.office.ListStyle;
import writer2latex.office.OfficeReader;
import writer2latex.office.OfficeStyle;
import writer2latex.office.OfficeStyleFamily;
import writer2latex.office.StyleWithProperties;
import writer2latex.office.XMLString;
import writer2latex.util.CSVList;
@ -132,7 +134,7 @@ public class ListStyleConverter extends StyleConverterHelper {
public OfficeStyleFamily getStyles() {
return ofr.getListStyles();
}
private void cssList(ListStyle style, int nLevel, CSVList props){
// translates "list" style properties for a particular level
// Mozilla does not seem to support the "marker" mechanism of CSS2
@ -150,6 +152,8 @@ public class ListStyleConverter extends StyleConverterHelper {
else if ("I".equals(sNumFormat)) { props.addValue("list-style-type","upper-roman"); }
else if ("a".equals(sNumFormat)) { props.addValue("list-style-type","lower-alpha"); }
else if ("A".equals(sNumFormat)) { props.addValue("list-style-type","upper-alpha"); }
}
else if (XMLString.TEXT_LIST_LEVEL_STYLE_BULLET.equals(sLevelType)) {
// Bullet. We can only choose from disc, bullet and square
@ -186,6 +190,11 @@ public class ListStyleConverter extends StyleConverterHelper {
// We don't want floats to pass a list to the left (Mozilla and IE both
//handles this terribly!)
props.addValue("clear:left");
String textStyleName = style.getLevelProperty(nLevel, XMLString.TEXT_STYLE_NAME);
if (textStyleName != null) {
StyleWithProperties charStyle = (StyleWithProperties) ofr.getTextStyles().getStyle(textStyleName);
getTextSc().cssText(charStyle, props, true);
}
}
private void cssListParMargins(ListStyle style, int nLevel, CSVList props){