diff --git a/build.gradle b/build.gradle
index 659d1752..cdc559dd 100644
--- a/build.gradle
+++ b/build.gradle
@@ -40,7 +40,7 @@ repositories {
dependencies {
compileOnly 'org.osgi:org.osgi.service.component.annotations:1.3.0'
- compile "org.daisy.dotify:dotify.api:4.2.0"
+ compile "org.daisy.dotify:dotify.api:4.3.0"
compile "org.daisy.dotify:dotify.common:4.1.0"
compile 'org.daisy.streamline:streamline-api:1.2.0'
compile (group: 'org.daisy.libs', name: 'saxon-he', version: '9.5.1.5') {
diff --git a/gradle.properties b/gradle.properties
index 6edc95eb..abdca7f2 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -4,4 +4,4 @@ repositoryRevision=N/A
repositoryURL=https://github.com/brailleapps/dotify.formatter.impl
repositorySCM=scm:git:https://github.com/brailleapps/dotify.formatter.impl.git
moduleName=org.daisy.dotify.formatter
-version=4.3.1-SNAPSHOT
\ No newline at end of file
+version=4.4.0-SNAPSHOT
\ No newline at end of file
diff --git a/integrationtest/org/daisy/dotify/formatter/test/TakenFromDP2Test.java b/integrationtest/org/daisy/dotify/formatter/test/TakenFromDP2Test.java
index 09179da1..8d144da4 100644
--- a/integrationtest/org/daisy/dotify/formatter/test/TakenFromDP2Test.java
+++ b/integrationtest/org/daisy/dotify/formatter/test/TakenFromDP2Test.java
@@ -403,4 +403,9 @@ public void testVolumeBreakingBetweenWords() throws LayoutEngineException, IOExc
null
);
}
+ @Test
+ public void testBreakBeforeSheet() throws LayoutEngineException, IOException, PagedMediaWriterConfigurationException {
+ testPEF("resource-files/dp2/break-before-sheet-input.obfl",
+ "resource-files/dp2/break-before-sheet-expected.pef", false);
+ }
}
diff --git a/integrationtest/org/daisy/dotify/formatter/test/resource-files/dp2/break-before-sheet-expected.pef b/integrationtest/org/daisy/dotify/formatter/test/resource-files/dp2/break-before-sheet-expected.pef
new file mode 100644
index 00000000..1e3b82c5
--- /dev/null
+++ b/integrationtest/org/daisy/dotify/formatter/test/resource-files/dp2/break-before-sheet-expected.pef
@@ -0,0 +1,27 @@
+
+
+
+
+ break-before-sheet
+ Tests break-before="sheet".
+ application/x-pef+xml
+
+
+
+
+
+
+ ⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀
+ ⠛⠛⠛
+
+
+ ⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀
+
+
+ ⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀
+ ⠤⠤⠤
+
+
+
+
+
\ No newline at end of file
diff --git a/integrationtest/org/daisy/dotify/formatter/test/resource-files/dp2/break-before-sheet-input.obfl b/integrationtest/org/daisy/dotify/formatter/test/resource-files/dp2/break-before-sheet-input.obfl
new file mode 100644
index 00000000..ea5991ac
--- /dev/null
+++ b/integrationtest/org/daisy/dotify/formatter/test/resource-files/dp2/break-before-sheet-input.obfl
@@ -0,0 +1,24 @@
+
+
+
+ break-before-sheet
+ Tests break-before="sheet".
+
+
+
+
+
+
+
+
+ ⠛⠛⠛
+ ⠤⠤⠤
+
+
diff --git a/src/org/daisy/dotify/formatter/impl/page/PageSequenceBuilder2.java b/src/org/daisy/dotify/formatter/impl/page/PageSequenceBuilder2.java
index 658d17b6..2140ec85 100644
--- a/src/org/daisy/dotify/formatter/impl/page/PageSequenceBuilder2.java
+++ b/src/org/daisy/dotify/formatter/impl/page/PageSequenceBuilder2.java
@@ -62,6 +62,7 @@ public class PageSequenceBuilder2 {
private int keepNextSheets;
private int pageCount = 0;
private int dataGroupsIndex;
+ private boolean nextEmpty = false;
//From view, temporary
private final int fromIndex;
@@ -116,6 +117,7 @@ public PageSequenceBuilder2(PageSequenceBuilder2 template) {
this.data = RowGroupDataSource.copyUnlessNull(template.data);
this.keepNextSheets = template.keepNextSheets;
this.pageCount = template.pageCount;
+ this.nextEmpty = template.nextEmpty;
this.fromIndex = template.fromIndex;
this.toIndex = template.toIndex;
}
@@ -180,6 +182,10 @@ public PageImpl nextPage(int pageNumberOffset, boolean hyphenateLastLine, Option
private PageImpl nextPageInner(int pageNumberOffset, boolean hyphenateLastLine, Optional transitionContent) throws PaginatorException, RestartPaginationException // pagination must be restarted in PageStructBuilder.paginateInner
{
PageImpl current = newPage(pageNumberOffset);
+ if (nextEmpty) {
+ nextEmpty = false;
+ return current;
+ }
while (dataGroupsIndex master.getPageArea().getMaxHeight()) {
reassignCollection();
}
- if (!data.isEmpty() || (current!=null && dataGroupsIndex