diff options
author | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2010-07-08 15:27:58 +0200 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2010-07-08 15:27:58 +0200 |
commit | ead243b07ab8c73c0e34c7953a08b5059f584fa9 (patch) | |
tree | 89a93597d9b182b0c4e753300874761b4b039955 | |
parent | 2b20809c3e6c69e6e7c846fd346d3e54578fbe7b (diff) |
dba33g: #i108954# handle value for string and date like value-type is defined
2 files changed, 19 insertions, 3 deletions
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java index 5f24370..57e8585 100755 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java @@ -125,7 +125,12 @@ public class FormatValueUtility } else if (value instanceof java.sql.Date) { - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value)); + if ( "float".equals(valueType))//@see http://qa.openoffice.org/issues/show_bug.cgi?id=108954 + { + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, HSSFDateUtil.getExcelDate((Date) value, false, 2).toString()); + } + else + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value)); } else if (value instanceof Date) { diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java index 4a8954c..e5ebde9 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java @@ -136,9 +136,20 @@ public class FormattedTextLayoutController else { final DataFlags df = FormatValueUtility.computeDataFlag(element, getFlowController()); - if (df != null && df.getValue() instanceof String ) + if (df != null) { - target.processContent(df); + if (df.getValue() instanceof String) + { + target.processContent(df); + } + else //@see http://qa.openoffice.org/issues/show_bug.cgi?id=108954 + { + Element cell = getParentTableCell(); + if (cell != null && "string".equals(cell.getAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE))) + { + target.processContent(df); + } + } } } |