Tag: cws_dev300_rptchart02 User: oj Date: 2008-04-04 13:06:04+0000 Modified: dba/reportdesign/java/com/sun/star/report/OfficeToken.java dba/reportdesign/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java dba/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java
Log: enable chart File Changes: Directory: /dba/reportdesign/java/com/sun/star/report/ ====================================================== File [changed]: OfficeToken.java Url: http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/OfficeToken.java?r1=1.1.2.2&r2=1.1.2.3 Delta lines: +3 -2 ------------------- --- OfficeToken.java 2008-04-03 11:59:19+0000 1.1.2.2 +++ OfficeToken.java 2008-04-04 13:06:01+0000 1.1.2.3 @@ -4,9 +4,9 @@ * * $RCSfile: OfficeToken.java,v $ * - * $Revision: 1.1.2.2 $ + * $Revision: 1.1.2.3 $ * - * last change: $Author: oj $ $Date: 2008/04/03 11:59:19 $ + * last change: $Author: oj $ $Date: 2008/04/04 13:06:01 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -64,4 +64,5 @@ public static final String IMAGE_DATA = "image-data"; public static final String PRESERVE_IRI = "preserve-IRI"; public static final String SCALE = "scale"; + public static final String NAME = "name"; } Directory: /dba/reportdesign/java/com/sun/star/report/pentaho/output/ ===================================================================== File [changed]: OfficeDocumentReportTarget.java Url: http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java?r1=1.5.4.2&r2=1.5.4.3 Delta lines: +12 -2 -------------------- --- OfficeDocumentReportTarget.java 2008-04-03 11:59:20+0000 1.5.4.2 +++ OfficeDocumentReportTarget.java 2008-04-04 13:06:01+0000 1.5.4.3 @@ -259,6 +259,7 @@ private OfficeStylesCollection contentStylesCollection; private final OutputRepository outputRepository; private final AttributeNameGenerator tableNameGenerator; + private final AttributeNameGenerator frameNameGenerator; private final AttributeNameGenerator autoStyleNameGenerator; private final String target; private static final int INITIAL_BUFFER_SIZE = 40960; @@ -294,6 +295,7 @@ this.target = target; this.tableNameGenerator = new AttributeNameGenerator(); + this.frameNameGenerator = new AttributeNameGenerator(); this.autoStyleNameGenerator = new AttributeNameGenerator(); this.outputRepository = outputRepository; this.states = new FastStack(); @@ -377,6 +379,7 @@ autoStyleNameGenerator.reset(); tableNameGenerator.reset(); + frameNameGenerator.reset(); final OfficeDocument reportDoc = (OfficeDocument) report; predefinedStylesCollection = reportDoc.getStylesCollection(); @@ -394,9 +397,9 @@ graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "wrap", "dynamic"); graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "number-wrapped-paragraphs", "no-limit"); graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "wrap-contour", OfficeToken.FALSE); - graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, VERTICAL_POS, "top"); + graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, VERTICAL_POS, "from-top"); // changed for chart graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "vertical-rel",OfficeToken.PARAGRAPH); - graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS,HORIZONTAL_POS, "center"); + graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS,HORIZONTAL_POS, "from-left"); // changed for chart graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "horizontal-rel",OfficeToken.PARAGRAPH); commonStyles.addStyle(graphicsDefaultStyle); } @@ -1172,6 +1175,13 @@ attrList.setAttribute(attrNamespace, key, tableNameGenerator.generateName(saneName)); } + else if (OfficeNamespaces.DRAWING_NS.equals(attrNamespace) && + "name".equals(key)) + { + final String objectName = String.valueOf(entry.getValue()); + attrList.setAttribute(attrNamespace, key, + frameNameGenerator.generateName(objectName)); + } else { attrList.setAttribute(attrNamespace, key, String.valueOf(entry.getValue())); Directory: /dba/reportdesign/java/com/sun/star/report/pentaho/output/text/ ========================================================================== File [changed]: TextRawReportTarget.java Url: http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java?r1=1.5.4.2&r2=1.5.4.3 Delta lines: +7 -2 ------------------- --- TextRawReportTarget.java 2008-04-03 11:59:20+0000 1.5.4.2 +++ TextRawReportTarget.java 2008-04-04 13:06:02+0000 1.5.4.3 @@ -58,6 +58,7 @@ import com.sun.star.report.pentaho.output.OfficeDocumentReportTarget; import com.sun.star.report.pentaho.output.StyleUtilities; import com.sun.star.report.pentaho.styles.LengthCalculator; +import java.util.HashSet; import org.jfree.layouting.input.style.values.CSSNumericValue; import org.jfree.layouting.util.AttributeMap; import org.jfree.report.DataSourceException; @@ -717,16 +718,20 @@ attrs.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, style.getStyleName()); } } +/* if ( ObjectUtilities.equal(OfficeNamespaces.DRAWING_NS, namespace) && ObjectUtilities.equal(OfficeToken.FRAME, elementType) ) { final String styleName = (String) attrs.getAttribute(OfficeNamespaces.DRAWING_NS, OfficeToken.STYLE_NAME); + final Object raw = StyleUtilities.queryStyle(getPredefinedStylesCollection(), OfficeToken.GRAPHIC, styleName, + OfficeToken.GRAPHIC_PROPERTIES, OfficeNamespaces.STYLE_NS, VERTICAL_POS); + final OfficeStyle style = deriveStyle(OfficeToken.GRAPHIC, styleName); Element graphicProperties = style.getGraphicProperties(); graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, VERTICAL_POS, "from-top"); - graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS,HORIZONTAL_POS, "from-left"); + graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, HORIZONTAL_POS, "from-left"); attrs.setAttribute(OfficeNamespaces.DRAWING_NS, OfficeToken.STYLE_NAME, style.getStyleName()); } - +*/ // process the styles as usual performStyleProcessing(attrs); final XmlWriter xmlWriter = getXmlWriter(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
