diff --git a/src/main/java/writer2latex/xhtml/FrameStyleConverter.java b/src/main/java/writer2latex/xhtml/FrameStyleConverter.java
index 86db334..3f182a0 100644
--- a/src/main/java/writer2latex/xhtml/FrameStyleConverter.java
+++ b/src/main/java/writer2latex/xhtml/FrameStyleConverter.java
@@ -59,36 +59,38 @@ public class FrameStyleConverter extends StyleWithPropertiesConverterHelper {
/** Convert style information for used styles
* @param sIndent a String of spaces to add before each line
*/
- public String getStyleDeclarations(String sIndent) {
- if (bConvertStyles) {
- StringBuilder buf = new StringBuilder();
- buf.append(super.getStyleDeclarations(sIndent));
- Enumeration names = styleNames.keys();
- while (names.hasMoreElements()) {
- String sDisplayName = names.nextElement();
- StyleWithProperties style = (StyleWithProperties)
- getStyles().getStyleByDisplayName(sDisplayName);
- if (!style.isAutomatic()) {
- // Apply style to paragraphs contained in this frame
- CSVList props = new CSVList(";");
- getFrameSc().cssMargins(style,props,true);
- getParSc().cssPar(style,props,true);
- getTextSc().cssTextCommon(style,props,true);
- if (!props.isEmpty()) {
- buf.append(sIndent)
- .append(getDefaultTagName(null))
- .append(".").append(getClassNamePrefix())
- .append(styleNames.addToExport(sDisplayName))
- .append(" p {").append(props.toString()).append("}").append(config.prettyPrint() ? "\n" : " ");
- }
- }
- }
- return buf.toString();
- }
- else {
- return "";
- }
- }
+ public String getStyleDeclarations(String sIndent) {
+ if (bConvertStyles) {
+ StringBuilder buf = new StringBuilder();
+ buf.append(super.getStyleDeclarations(sIndent));
+ Enumeration names = styleNames.keys();
+ while (names.hasMoreElements()) {
+ String sDisplayName = names.nextElement();
+ StyleWithProperties style = (StyleWithProperties) getStyles().getStyleByDisplayName(sDisplayName);
+ if (!style.isAutomatic()) {
+ // Apply style to paragraphs contained in this frame
+ CSVList props = new CSVList(";");
+ getFrameSc().cssMargins(style, props, true);
+ getParSc().cssPar(style, props, true);
+ getTextSc().cssTextCommon(style, props, true);
+ if (!props.isEmpty()) {
+ buf.append(sIndent);
+ buf.append(getDefaultTagName(null));
+ buf.append(".");
+ buf.append(getClassNamePrefix());
+ buf.append(styleNames.addToExport(sDisplayName));
+ buf.append(" p {");
+ buf.append(props.toString());
+ buf.append("}");
+ buf.append(config.prettyPrint() ? "\n" : " ");
+ }
+ }
+ }
+ return buf.toString();
+ } else {
+ return "";
+ }
+ }
/** Return a prefix to be used in generated css class names
* @return the prefix
diff --git a/src/main/java/writer2latex/xhtml/HeadingStyleConverter.java b/src/main/java/writer2latex/xhtml/HeadingStyleConverter.java
index b44de5b..a82e8f7 100644
--- a/src/main/java/writer2latex/xhtml/HeadingStyleConverter.java
+++ b/src/main/java/writer2latex/xhtml/HeadingStyleConverter.java
@@ -53,31 +53,42 @@ public class HeadingStyleConverter extends StyleConverterHelper {
@Override
public String getStyleDeclarations(String sIndent) {
- if (bConvertStyles) {
- StringBuilder buf = new StringBuilder();
- for (int i=1; i<=6; i++) {
- // Convert main style for this level
- if (ofr.getHeadingStyle(i)!=null) {
- CSVList props = new CSVList(";");
- getParSc().applyProperties(ofr.getHeadingStyle(i),props,true);
- props.addValue("clear","left");
- buf.append(sIndent).append("h").append(i)
- .append(" {").append(props.toString()).append("}").append(config.prettyPrint() ? "\n" : " ");
- }
- // Convert other styles for this level
- for (String sDisplayName : otherLevelStyles.get(i)) {
- StyleWithProperties style = (StyleWithProperties)
- getStyles().getStyleByDisplayName(sDisplayName);
- CSVList props = new CSVList(";");
- getParSc().applyProperties(style,props,true);
- props.addValue("clear","left");
- buf.append(sIndent).append("h").append(i).append(".").append(styleNames.addToExport(sDisplayName))
- .append(" {").append(props.toString()).append("}").append(config.prettyPrint() ? "\n" : " ");
- }
- }
- return buf.toString();
- }
- return "";
+ if (bConvertStyles) {
+ StringBuilder buf = new StringBuilder();
+ for (int i = 1; i <= 6; i++) {
+ // Convert main style for this level
+ if (ofr.getHeadingStyle(i) != null) {
+ CSVList props = new CSVList(";");
+ getParSc().applyProperties(ofr.getHeadingStyle(i), props, true);
+ props.addValue("clear", "left");
+ buf.append(sIndent);
+ buf.append("h");
+ buf.append(i);
+ buf.append(" {");
+ buf.append(props.toString());
+ buf.append("}");
+ buf.append(config.prettyPrint() ? "\n" : " ");
+ }
+ // Convert other styles for this level
+ for (String sDisplayName : otherLevelStyles.get(i)) {
+ StyleWithProperties style = (StyleWithProperties) getStyles().getStyleByDisplayName(sDisplayName);
+ CSVList props = new CSVList(";");
+ getParSc().applyProperties(style, props, true);
+ props.addValue("clear", "left");
+ buf.append(sIndent);
+ buf.append("h");
+ buf.append(i);
+ buf.append(".");
+ buf.append(styleNames.addToExport(sDisplayName));
+ buf.append(" {");
+ buf.append(props.toString());
+ buf.append("}");
+ buf.append(config.prettyPrint() ? "\n" : " ");
+ }
+ }
+ return buf.toString();
+ }
+ return "";
}
@Override
diff --git a/src/main/java/writer2latex/xhtml/ListStyleConverter.java b/src/main/java/writer2latex/xhtml/ListStyleConverter.java
index b20ebd2..03921cb 100644
--- a/src/main/java/writer2latex/xhtml/ListStyleConverter.java
+++ b/src/main/java/writer2latex/xhtml/ListStyleConverter.java
@@ -111,11 +111,14 @@ public class ListStyleConverter extends StyleConverterHelper {
CSVList parProps = new CSVList(";");
cssListParMargins(style,nLevel,parProps);
if (!parProps.isEmpty()) {
- buf.append(sIndent)
- .append(".listlevel")
- .append(nLevel)
- .append(styleNames.addToExport(sDisplayName))
- .append(" p {").append(parProps.toString()).append("}").append(config.prettyPrint() ? "\n" : " ");
+ buf.append(sIndent);
+ buf.append(".listlevel");
+ buf.append(nLevel);
+ buf.append(styleNames.addToExport(sDisplayName));
+ buf.append(" p {");
+ buf.append(parProps.toString());
+ buf.append("}");
+ buf.append(config.prettyPrint() ? "\n" : " ");
}
}
}