Use writing mode configuration

This commit is contained in:
Georgy Litvinov 2020-08-03 14:26:59 +02:00
parent 24d71be7cf
commit 79a3d05947
3 changed files with 21 additions and 2 deletions

View file

@ -213,6 +213,7 @@ public class XMLString {
public static final String STYLE_LANGUAGE_ASIAN = "style:language-asian";
public static final String STYLE_COUNTRY_ASIAN = "style:country-asian";
public static final String LOEXT_WRITING_MODE = "loext:writing-mode";
// table namespace - elements
public static final String TABLE_ = "table:";
public static final String TABLE_TABLE = "table:table";

View file

@ -79,6 +79,8 @@ public class CellStyleParser extends StyleWithPropertiesParser {
getFrameSP().cssBorder(style,props,bInherit);
getFrameSP().cssPadding(style,props,bInherit);
getFrameSP().cssBackground(style,props,bInherit);
getFrameSP().cssWritingMode(style,props,bInherit);
// only relevant for spreadsheets
getParSP().cssPar(style,props,bInherit);
getTextSP().cssTextCommon(style,props,bInherit);

View file

@ -139,8 +139,22 @@ public class FrameStyleParser extends StyleWithPropertiesParser {
cssBorder(style,props,bInherit);
cssPadding(style,props,bInherit);
cssBackground(style,props,bInherit);
cssWritingMode(style,props,bInherit);
}
public void cssWritingMode(StyleWithProperties style, Properties props, boolean bInherit) {
String s;
if (bInherit || style.hasProperty(XMLString.LOEXT_WRITING_MODE)) {
s = style.getAbsoluteProperty(XMLString.LOEXT_WRITING_MODE);
if (s != null) {
if (s.equals("bt-lr")) {
props.addProperty("writing-mode", "sideways-lr");
}
}
}
}
public void cssMargins(StyleWithProperties style, Properties props, boolean bInherit){
// *Absolute* values fit with css
String s;
@ -265,7 +279,9 @@ public class FrameStyleParser extends StyleWithPropertiesParser {
public void cssBackground(StyleWithProperties style, Properties props, boolean bInherit){
// Background color: Same as in css
String s = style.getProperty(XMLString.FO_BACKGROUND_COLOR,bInherit);
if (s!=null) { props.addProperty("background-color",s); }
if (s!=null) {
props.addProperty("background-color",s);
}
cssBackgroundCommon(style,props,bInherit);
}