diff --git a/integrationtest/org/daisy/dotify/formatter/test/SequenceBreakTest.java b/integrationtest/org/daisy/dotify/formatter/test/SequenceBreakTest.java
index ccdee291..86882f94 100644
--- a/integrationtest/org/daisy/dotify/formatter/test/SequenceBreakTest.java
+++ b/integrationtest/org/daisy/dotify/formatter/test/SequenceBreakTest.java
@@ -16,7 +16,7 @@
public class SequenceBreakTest extends AbstractFormatterEngineTest {
@Test
- public void testParsing() throws
+ public void parsingTest() throws
LayoutEngineException,
IOException,
PagedMediaWriterConfigurationException {
@@ -27,4 +27,16 @@ public void testParsing() throws
);
}
+ @Test
+ public void breakBeforePage1Test() throws
+ LayoutEngineException,
+ IOException,
+ PagedMediaWriterConfigurationException {
+ testPEF(
+ "resource-files/sequence-break/break-before-page-1-input.obfl",
+ "resource-files/sequence-break/break-before-page-1-expected.pef",
+ true
+ );
+ }
+
}
diff --git a/integrationtest/org/daisy/dotify/formatter/test/resource-files/sequence-break/break-before-page-1-expected.pef b/integrationtest/org/daisy/dotify/formatter/test/resource-files/sequence-break/break-before-page-1-expected.pef
new file mode 100644
index 00000000..7812cdca
--- /dev/null
+++ b/integrationtest/org/daisy/dotify/formatter/test/resource-files/sequence-break/break-before-page-1-expected.pef
@@ -0,0 +1,24 @@
+
+
+
+
+ application/x-pef+xml
+ identifier?
+ 2020-08-10
+ break-before="page" (1)
+ Tests a scenario with two content sequences and the second one has break-before="page"
+
+
+
+
+
+
+
+
diff --git a/integrationtest/org/daisy/dotify/formatter/test/resource-files/sequence-break/break-before-page-1-input.obfl b/integrationtest/org/daisy/dotify/formatter/test/resource-files/sequence-break/break-before-page-1-input.obfl
new file mode 100644
index 00000000..4e0ab4df
--- /dev/null
+++ b/integrationtest/org/daisy/dotify/formatter/test/resource-files/sequence-break/break-before-page-1-input.obfl
@@ -0,0 +1,19 @@
+
+
+ break-before="page" (1)
+ Tests a scenario with two content sequences and the
+ second one has break-before="page"
+
+
+
+
+
+
+
+
+ ⠤⠤⠤
+
+
+ ⠤⠤⠤
+
+
diff --git a/integrationtest/org/daisy/dotify/formatter/test/resource-files/sequence-break/parsing-expected.pef b/integrationtest/org/daisy/dotify/formatter/test/resource-files/sequence-break/parsing-expected.pef
index d9b6bc74..e1058d2d 100644
--- a/integrationtest/org/daisy/dotify/formatter/test/resource-files/sequence-break/parsing-expected.pef
+++ b/integrationtest/org/daisy/dotify/formatter/test/resource-files/sequence-break/parsing-expected.pef
@@ -4,7 +4,7 @@
application/x-pef+xml
identifier?
- 2020-08-07
+ 2020-08-11
Parsing of sequence breaks test
Tests the parsing of sequence breaks
@@ -25,8 +25,6 @@
⠤⠤⠤
-
-
⠤⠤⠤
diff --git a/src/org/daisy/dotify/formatter/impl/sheet/SheetDataSource.java b/src/org/daisy/dotify/formatter/impl/sheet/SheetDataSource.java
index 2c2b07a0..25bf2031 100644
--- a/src/org/daisy/dotify/formatter/impl/sheet/SheetDataSource.java
+++ b/src/org/daisy/dotify/formatter/impl/sheet/SheetDataSource.java
@@ -26,6 +26,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Optional;
+import org.daisy.dotify.api.formatter.SequenceProperties.SequenceBreak;
/**
* Provides a data source for {@link Sheet}s. Given a list of {@link BlockSequence}s, sheets are
@@ -260,7 +261,11 @@ private boolean ensureBuffer(int index) {
seqId,
cbl
);
- sectionProperties = bs.getLayoutMaster().newSectionProperties();
+ // when new section properties are created, automatically a new
+ // section is started
+ if (sectionProperties == null || bs.getSequenceProperties().getBreakBeforeType() != SequenceBreak.PAGE) {
+ sectionProperties = bs.getLayoutMaster().newSectionProperties();
+ }
s = null;
si = null;
sheetIndex = 0;