User: hr Date: 2007-08-03 09:50:22+0000 Modified: dba/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroup.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/model/ ==================================================================== File [changed]: OfficeGroup.java Url: http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroup.java?r1=1.2&r2=1.3 Delta lines: +32 -5 -------------------- --- OfficeGroup.java 2007-07-09 11:56:06+0000 1.2 +++ OfficeGroup.java 2007-08-03 09:50:20+0000 1.3 @@ -37,8 +37,9 @@ package com.sun.star.report.pentaho.model; -import org.jfree.report.structure.Group; import com.sun.star.report.pentaho.OfficeNamespaces; +import org.jfree.report.structure.Section; +import org.jfree.report.structure.Element; /** * An office group is a virtual section that contains the group header, footer @@ -47,7 +48,7 @@ * @author Thomas Morgner * @since 02.03.2007 */ -public class OfficeGroup extends Group +public class OfficeGroup extends Section { public OfficeGroup() { @@ -64,4 +65,30 @@ return "true".equals (getAttribute(OfficeNamespaces.OOREPORT_NS, "reset-page-number")); } + + public OfficeGroupSection getHeader() + { + final OfficeGroupInstanceSection instanceSection = + (OfficeGroupInstanceSection) findFirstChild(OfficeNamespaces.INTERNAL_NS, "group-instance"); + if (instanceSection == null) + { + return null; + } + return (OfficeGroupSection) instanceSection.findFirstChild + (OfficeNamespaces.OOREPORT_NS, "group-header"); + + } + + public OfficeGroupSection getFooter() + { + final OfficeGroupInstanceSection instanceSection = + (OfficeGroupInstanceSection) findFirstChild(OfficeNamespaces.INTERNAL_NS, "group-instance"); + if (instanceSection == null) + { + return null; + } + return (OfficeGroupSection) instanceSection.findFirstChild + (OfficeNamespaces.OOREPORT_NS, "group-footer"); + + } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
