Lines 234-246
Link Here
|
234 |
indexOfCachedLastPage = (isLastPage ? intIndex : -1); |
234 |
indexOfCachedLastPage = (isLastPage ? intIndex : -1); |
235 |
} |
235 |
} |
236 |
if (replace) { |
236 |
if (replace) { |
237 |
disardCacheStartingWith(intIndex); |
237 |
discardCacheStartingWith(intIndex); |
238 |
page = cacheNextPage(index, isBlank, isLastPage); |
238 |
page = cacheNextPage(index, isBlank, isLastPage); |
239 |
} |
239 |
} |
240 |
return page; |
240 |
return page; |
241 |
} |
241 |
} |
242 |
|
242 |
|
243 |
private void disardCacheStartingWith(int index) { |
243 |
private void discardCacheStartingWith(int index) { |
244 |
while (index < cachedPages.size()) { |
244 |
while (index < cachedPages.size()) { |
245 |
this.cachedPages.remove(cachedPages.size() - 1); |
245 |
this.cachedPages.remove(cachedPages.size() - 1); |
246 |
if (!pageSeq.goToPreviousSimplePageMaster()) { |
246 |
if (!pageSeq.goToPreviousSimplePageMaster()) { |
Lines 251-258
Link Here
|
251 |
|
251 |
|
252 |
private Page cacheNextPage(int index, boolean isBlank, boolean isLastPage) { |
252 |
private Page cacheNextPage(int index, boolean isBlank, boolean isLastPage) { |
253 |
String pageNumberString = pageSeq.makeFormattedPageNumber(index); |
253 |
String pageNumberString = pageSeq.makeFormattedPageNumber(index); |
|
|
254 |
boolean isFirstPage = (startPageOfPageSequence == index); |
254 |
SimplePageMaster spm = pageSeq.getNextSimplePageMaster( |
255 |
SimplePageMaster spm = pageSeq.getNextSimplePageMaster( |
255 |
index, (startPageOfPageSequence == index), isLastPage, false, isBlank); |
256 |
index, isFirstPage, isLastPage, (isFirstPage && isLastPage), isBlank); |
256 |
|
257 |
|
257 |
Region body = spm.getRegion(FO_REGION_BODY); |
258 |
Region body = spm.getRegion(FO_REGION_BODY); |
258 |
if (!pageSeq.getMainFlow().getFlowName().equals(body.getRegionName())) { |
259 |
if (!pageSeq.getMainFlow().getFlowName().equals(body.getRegionName())) { |