From 9511a7f674692d5e033c8b58150fed2cf0f79fd2 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Thu, 16 Jan 2020 13:32:26 +0100 Subject: [PATCH] Added character properties to numbering lists --- .../java/writer2latex/xhtml/ListStyleConverter.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/writer2latex/xhtml/ListStyleConverter.java b/src/main/java/writer2latex/xhtml/ListStyleConverter.java index f75c431..b20ebd2 100644 --- a/src/main/java/writer2latex/xhtml/ListStyleConverter.java +++ b/src/main/java/writer2latex/xhtml/ListStyleConverter.java @@ -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){