Again a fix for the calulation of the number of pages of a MPA.

git-svn-id: https://svn.libreccm.org/ccm/trunk@3297 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2015-04-01 08:52:28 +00:00
parent 66fd2deda7
commit 0f0c33ca3c
1 changed files with 7 additions and 6 deletions

View File

@ -63,16 +63,17 @@ public class MultiPartArticleDataXMLGenerator implements ExtraXMLGenerator {
return "0"; return "0";
} }
long numberOfPages = 0; long numberOfPages = 1;
long index = 0; long index = 0;
long lastIndex = sections.size() - 1; final long lastIndex = sections.size() - 1;
while(sections.next()) { while(sections.next()) {
index++;
//The check for last index is necessary because we don't want to count a page break after if (sections.getArticleSection().isPageBreak()
//the last section && index < lastIndex) {
if (sections.getArticleSection().isPageBreak()) {
numberOfPages++; numberOfPages++;
} }
index++;
} }
// if (numberOfPages == 0) { // if (numberOfPages == 0) {