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 | 50fbc78991abce50a5dfa3e933f0adb6e0a75fc5 (patch) | |
tree | 72dad690213000f7aa29c52d4facf4ef940b50c7 /reportbuilder/java | |
parent | ec88ba28a7fe69927c23700261ff064b79df8654 (diff) |
dba33g: #i108954# handle value for string and date like value-type is defined
Diffstat (limited to 'reportbuilder/java')
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 c8c98692a7a0..fc1baaa8c9a3 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 7a0a496ffb26..5a6b8f948372 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); + } + } } } |