*/
public class AreaTreeModel {
private List<PageSequence> pageSequenceList = null;
- private int currentPageSequenceIndex = -1;
+ private int currentPageIndex = 0;
+
/** the current page sequence */
protected PageSequence currentPageSequence;
-// private List offDocumentItems = new java.util.ArrayList();
/** logger instance */
protected static final Log log = LogFactory.getLog(AreaTreeModel.class);
if (pageSequence == null) {
throw new NullPointerException("pageSequence must not be null");
}
+ if (currentPageSequence != null) {
+ currentPageIndex += currentPageSequence.getPageCount();
+ }
this.currentPageSequence = pageSequence;
pageSequenceList.add(currentPageSequence);
- currentPageSequenceIndex = pageSequenceList.size() - 1;
}
/**
*/
public void addPage(PageViewport page) {
currentPageSequence.addPage(page);
- int pageIndex = 0;
- for (int i = 0; i < currentPageSequenceIndex; i++) {
- pageIndex += pageSequenceList.get(i).getPageCount();
- }
- pageIndex += currentPageSequence.getPageCount() - 1;
- page.setPageIndex(pageIndex);
+ page.setPageIndex(currentPageIndex
+ + currentPageSequence.getPageCount() - 1);
page.setPageSequence(currentPageSequence);
}
documents. Example: the fix of marks layering will be such a case when it's done.
-->
<release version="FOP Trunk" date="TBD">
+ <action context="Code" dev="AD" type="fix" fixes-bug="50636">
+ Bugfix: fix performance issue when adding pages, if the total number of pages
+ is significantly large.
+ </action>
+ <action context="Code" dev="AD" type="fix" fixes-bug="50626">
+ Bugfix: fix performance issue when adding nodes, if the number of children
+ is significantly large.
+ </action>
<action context="Config" dev="SP" type="fix">
Bugfix: relative URIs in the configuration file (base, font-base, hyphenation-base) are evaluated relative to the base URI of the configuration file.
</action>