User: kz Date: 2008-03-05 17:37:39+0000 Modified: dba/reportdesign/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java
Log: INTEGRATION: CWS rptchart01_DEV300 (1.2.70); FILE MERGED 2008/02/21 09:57:25 oj 1.2.70.2: #i85225# fixes found with PMD 2008/02/20 10:52:56 oj 1.2.70.1: format changes File Changes: Directory: /dba/reportdesign/java/com/sun/star/report/pentaho/output/text/ ========================================================================== File [changed]: MasterPageFactory.java Url: http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java?r1=1.2&r2=1.3 Delta lines: +323 -335 ----------------------- --- MasterPageFactory.java 2007-07-09 11:56:08+0000 1.2 +++ MasterPageFactory.java 2008-03-05 17:37:37+0000 1.3 @@ -33,8 +33,6 @@ * MA 02111-1307 USA * ************************************************************************/ - - package com.sun.star.report.pentaho.output.text; import java.util.HashMap; @@ -50,7 +48,6 @@ import org.jfree.report.util.AttributeNameGenerator; import org.jfree.report.ReportProcessingException; import org.jfree.layouting.input.style.values.CSSNumericValue; -import org.jfree.util.Log; /** * Todo: Document me! @@ -60,8 +57,10 @@ */ public class MasterPageFactory { + private static class MasterPageFactoryKey { + private String template; private String pageHeader; private String pageFooter; @@ -75,7 +74,6 @@ this.pageFooter = pageFooter; } - public boolean equals(final Object o) { if (this == o) @@ -134,11 +132,11 @@ private static class PageLayoutKey { + private String templateName; private CSSNumericValue headerHeight; private CSSNumericValue footerHeight; - public PageLayoutKey(final String templateName, final CSSNumericValue headerHeight, final CSSNumericValue footerHeight) @@ -148,7 +146,6 @@ this.footerHeight = footerHeight; } - public String getTemplateName() { return templateName; @@ -208,7 +205,6 @@ // todo: Patch the page-layout ... private static final String DEFAULT_PAGE_NAME = "Default"; - private OfficeMasterStyles predefinedStyles; private AttributeNameGenerator masterPageNameGenerator; private HashMap masterPages; @@ -261,8 +257,7 @@ { // This is a 'magic' name .. // todo: It could be that this should be called 'Standard' instead - predef = predefinedStyles.getMasterPage - (MasterPageFactory.DEFAULT_PAGE_NAME); + predef = predefinedStyles.getMasterPage(MasterPageFactory.DEFAULT_PAGE_NAME); } if (predef != null) @@ -276,8 +271,7 @@ } catch (CloneNotSupportedException cne) { - throw new IllegalStateException - ("Implementation error: Unable to derive page"); + throw new IllegalStateException("Implementation error: Unable to derive page"); } } @@ -324,8 +318,7 @@ final PageLayoutKey key = new PageLayoutKey(null, headerHeight, footerHeight); final PageLayout derived = new PageLayout(); - final String name = pageLayoutNameGenerator.generateName - ("autogenerated"); + final String name = pageLayoutNameGenerator.generateName("autogenerated"); derived.setStyleName(name); commonStyles.addPageStyle(derived); @@ -374,8 +367,7 @@ final PageLayout original = predefined.getPageStyle(pageStyleTemplate); if (original == null) { - throw new ReportProcessingException - ("Invalid page-layout '" + pageStyleTemplate + "', will not continue."); + throw new ReportProcessingException("Invalid page-layout '" + pageStyleTemplate + "', will not continue."); } try @@ -424,8 +416,7 @@ private static void applyHeaderFooterHeight(final Section headerFooterStyle, final CSSNumericValue style) { - Element headerFooterProps = headerFooterStyle.findFirstChild - (OfficeNamespaces.STYLE_NS, "header-footer-properties"); + Element headerFooterProps = headerFooterStyle.findFirstChild(OfficeNamespaces.STYLE_NS, "header-footer-properties"); if (headerFooterProps == null) { headerFooterProps = new Section(); @@ -433,10 +424,7 @@ headerFooterProps.setType("header-footer-properties"); headerFooterStyle.addNode(headerFooterProps); } - headerFooterProps.setAttribute - (OfficeNamespaces.SVG_NS, "height", String.valueOf(style.getValue()) + + headerFooterProps.setAttribute(OfficeNamespaces.SVG_NS, "height", String.valueOf(style.getValue()) + style.getType().getType()); } - - } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
