Fixed wrong paragraph styles priorities

This commit is contained in:
Georgy Litvinov 2021-03-24 10:51:37 +01:00
parent 0babf899ee
commit a4d510caa7
10 changed files with 16 additions and 16 deletions

View file

@ -572,8 +572,8 @@ public class TextParser extends Parser {
// Apply style
StyleInfo info = new StyleInfo();
info.sTagName = "h" + nLevel;
getHeadingSP().readParentStyle(nLevel, sStyleName, info);
getHeadingSP().applyStyle(nLevel, sStyleName, info);
getHeadingSP().readParentStyle(nLevel, sStyleName, info);
// add root element
Element heading = converter.createElement(info.sTagName);

View file

@ -73,8 +73,8 @@ public abstract class StyleWithPropertiesParser extends StyleParser {
applyDirection(style, info);
if (style.isAutomatic()) {
// Apply parent style + hard formatting
readStyle(style.getParentName(), info);
applyProperties(style, info.props, false);
readStyle(style.getParentName(), info);
} else {
String displayName = style.getDisplayName();

View file

@ -10,7 +10,7 @@ import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
public class Sections {
public class HeadingWithSections {
@Test
@DisplayName("Heading with sections")
void testExample() throws Exception{

View file

@ -10,9 +10,9 @@ import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
public class PageSectionStyles {
public class ImageAfterSection {
@Test
@DisplayName("Page styles and sections")
@DisplayName("image after section")
void testExample() throws Exception {
String testName = "image_after_section";
List<String> arguments = new ArrayList<String>();