}
public void setResults(FormattingResults formattingResults) throws Docx4JException {
List<PageSequenceResults> resultList = null;
PageSequenceResults pageSequenceResults = null;
if (formattingResults == null) {
throw new Docx4JException("Apache fop returned no FormattingResults (null)");
}
else {
resultList = formattingResults.getPageSequences();
if (resultList == null) {
throw new Docx4JException("Apache fop returned null pageSequences");
}
else if (resultList.size() != pageNumberInformation.size()) {
throw new Docx4JException("Apache fop returned different count of sections than expected, returned: " + resultList.size() + ", expected: " + pageNumberInformation.size());
}
}
putDocumentPageCount(formattingResults.getPageCount());
for (int i=0; i<formattingResults.getPageSequences().size(); i++) {
pageSequenceResults = resultList.get(i);
putSectionPageCount(i, pageSequenceResults.getPageCount());
}
}