import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
import org.apache.fop.area.AreaTreeHandler;
import org.apache.fop.area.PageViewport;
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.pagination.PageSequence;
+import org.apache.fop.fo.pagination.Region;
+import org.apache.fop.fo.pagination.RegionBody;
import org.apache.fop.fo.pagination.SimplePageMaster;
/**
log.debug("blank condition doesn't match. Replacing PageViewport.");
replace = true;
}
+ if (page.getPageViewport().getCurrentSpan().getColumnCount() == 1
+ && !this.spanAllForCurrentElementList) {
+ RegionBody rb = (RegionBody)page.getSimplePageMaster().getRegion(Region.FO_REGION_BODY);
+ int colCount = rb.getColumnCount();
+ if (colCount > 1) {
+ log.debug("Span doesn't match. Replacing PageViewport.");
+ replace = true;
+ }
+ }
if ((isLastPage && indexOfCachedLastPage != intIndex)
|| (!isLastPage && indexOfCachedLastPage >= 0)) {
log.debug("last page condition doesn't match. Replacing PageViewport.");
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to You under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+-->\r
+<!-- $Id: region-body_column-count_span_4.xml 993357 2010-09-07 13:45:39Z jeremias $ -->\r
+<testcase>\r
+ <info>\r
+ <p>\r
+ This test checks multi-column documents. Check that spanned section that overflow\r
+ the current page, don't span to the next page.\r
+ </p>\r
+ </info>\r
+ <fo>\r
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">\r
+ <fo:layout-master-set>\r
+ <fo:simple-page-master master-name="odd" page-height="200mm" page-width="150mm">\r
+ <fo:region-body column-count="2"/>\r
+ </fo:simple-page-master>\r
+ </fo:layout-master-set>\r
+ <fo:page-sequence master-reference="odd">\r
+ <fo:flow flow-name="xsl-region-body">\r
+ <fo:block-container id="overflow-block-ct" keep-together.within-page="always"\r
+ height="200.1mm" span="all">\r
+ <fo:block id="overflow-block">overflow-block</fo:block>\r
+ </fo:block-container>\r
+ <fo:block id="col1">col1</fo:block>\r
+ <fo:block id="col2" break-before="column">col2</fo:block>\r
+ </fo:flow>\r
+ </fo:page-sequence>\r
+ </fo:root>\r
+ </fo>\r
+ <checks>\r
+ <eval expected="2" xpath="count(//pageViewport)"/>\r
+ </checks>\r
+</testcase>\r