User: hr Date: 2007-08-03 09:50:06+0000 Modified: dba/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupSectionLayoutController.java
Log: INTEGRATION: CWS rpt23fix02 (1.2.4); FILE MERGED 2007/07/25 15:05:45 tmorgner 1.2.4.1: Issue number: 78128 This commit fixes the messed up repeating-header system. The whole thing has been redesigned to create a clean state-flow that can be debugged and traced without any weird mind-bending activities. The report-targets now have a new state (IN_GROUP_INSTANCE) to keep track of the group's processing and to separate repeating headers and footers from ordinary headers and footers. This patch also enforces a clean state-flow in the OfficeReportOutputTarget and explicitly checks for all allowed band-types and throws exceptions on every illegal state. File Changes: Directory: /dba/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ ============================================================================== File [changed]: OfficeGroupSectionLayoutController.java Url: http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupSectionLayoutController.java?r1=1.2&r2=1.3 Delta lines: +35 -5 -------------------- --- OfficeGroupSectionLayoutController.java 2007-07-09 11:56:05+0000 1.2 +++ OfficeGroupSectionLayoutController.java 2007-08-03 09:50:03+0000 1.3 @@ -39,12 +39,16 @@ import org.jfree.report.flow.layoutprocessor.SectionLayoutController; import org.jfree.report.flow.layoutprocessor.LayoutController; +import org.jfree.report.flow.layoutprocessor.ElementLayoutController; import org.jfree.report.flow.FlowController; import org.jfree.report.flow.ReportTarget; import org.jfree.report.structure.Element; import org.jfree.report.DataSourceException; +import org.jfree.report.ReportProcessingException; +import org.jfree.report.ReportDataFactoryException; import org.jfree.layouting.util.AttributeMap; import com.sun.star.report.pentaho.OfficeNamespaces; +import com.sun.star.report.pentaho.model.OfficeGroupSection; /** * This layoutcontroller simply checks, whether the parent layout controller @@ -63,6 +67,31 @@ { } + protected LayoutController startElement(final ReportTarget target) + throws DataSourceException, ReportProcessingException, ReportDataFactoryException + { + final OfficeGroupSection section = (OfficeGroupSection) getElement(); + if (section.isRepeatSection() == false) + { + return super.startElement(target); + } + + final LayoutController controller = getParent(); + if (controller instanceof OfficeGroupLayoutController == false) + { + return super.startElement(target); + } + final OfficeGroupLayoutController oglc = (OfficeGroupLayoutController) controller; + if (oglc.isNormalFlowProcessing() == false) + { + return super.startElement(target); + } + + // Skip the processing if the section is a repeating header or footer and we are processing the normal flow .. + final ElementLayoutController clone = (ElementLayoutController) this.clone(); + clone.setProcessingState(ElementLayoutController.FINISHED); + return clone; + } protected AttributeMap computeAttributes(final FlowController fc, final Element element, @@ -75,8 +104,7 @@ { return attrs; } - final OfficeGroupLayoutController oglc = - (OfficeGroupLayoutController) controller; + final OfficeGroupLayoutController oglc = (OfficeGroupLayoutController) controller; if (oglc.isNormalFlowProcessing()) { return attrs; @@ -85,4 +113,6 @@ attrs.setAttribute(OfficeNamespaces.INTERNAL_NS, "repeated-section", "true"); return attrs; } + + } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
