Tag: cws_dev300_rptchart02 User: oj Date: 2008-04-22 11:08:48+0000 Modified: dba/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java dba/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesDeclarationLayoutController.java
Log: #i87576# write date as formula File Changes: Directory: /dba/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ ============================================================================== File [changed]: FormatValueUtility.java Url: http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java?r1=1.3.4.3&r2=1.3.4.4 Delta lines: +7 -4 ------------------- --- FormatValueUtility.java 2008-04-16 07:01:26+0000 1.3.4.3 +++ FormatValueUtility.java 2008-04-22 11:08:46+0000 1.3.4.4 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: FormatValueUtility.java,v $ - * $Revision: 1.3.4.3 $ + * $Revision: 1.3.4.4 $ * * This file is part of OpenOffice.org. * @@ -62,12 +62,14 @@ { } - public static void applyValueForVariable(final Object value, final AttributeMap variableSection) + public static String applyValueForVariable(final Object value, final AttributeMap variableSection) { + String ret = null; if (value instanceof Date) { variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "date"); - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value)); + ret = formatDate((Date) value); + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", ret); } else if (value instanceof Number) { @@ -96,6 +98,7 @@ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "string"); variableSection.setAttribute(OfficeNamespaces.OFFICE_NS,STRING_VALUE, ""); } + return ret; } public static void applyValueForCell(final Object value, final AttributeMap variableSection) File [changed]: VariablesDeclarationLayoutController.java Url: http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesDeclarationLayoutController.java?r1=1.2.100.2&r2=1.2.100.3 Delta lines: +6 -4 ------------------- --- VariablesDeclarationLayoutController.java 2008-04-16 06:22:24+0000 1.2.100.2 +++ VariablesDeclarationLayoutController.java 2008-04-22 11:08:46+0000 1.2.100.3 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: VariablesDeclarationLayoutController.java,v $ - * $Revision: 1.2.100.2 $ + * $Revision: 1.2.100.3 $ * * This file is part of OpenOffice.org. * @@ -145,8 +145,10 @@ final FormulaExpression valueExpression = variable.getValueExpression(); final Object value = LayoutControllerUtil.evaluateExpression(getFlowController(), variable, valueExpression); - FormatValueUtility.applyValueForVariable(value, variableSection); - variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "formula", "ooow:" + value); + String formula = FormatValueUtility.applyValueForVariable(value, variableSection); + if ( formula == null ) + formula = "" + value; + variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "formula", "ooow:" + formula); return variableSection; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
