summaryrefslogtreecommitdiff
path: root/reportbuilder
diff options
context:
space:
mode:
Diffstat (limited to 'reportbuilder')
-rw-r--r--reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
index f5f65db53d52..4c1b8ddcd160 100644
--- a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
+++ b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
@@ -126,9 +126,10 @@ public class FormatValueUtility
}
else if (value instanceof java.sql.Date)
{
- if ("float".equals(valueType))//@see http://qa.openoffice.org/issues/show_bug.cgi?id=108954
+ if ("float".equals(valueType) || valueType == null)
{
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, HSSFDateUtil.getExcelDate((Date) value, false, 2).toString());
+ // This is to work around fdo#63478
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, HSSFDateUtil.getExcelDate((Date) value, false, 0).toString());
}
else
{
@@ -137,8 +138,12 @@ public class FormatValueUtility
}
else if (value instanceof Date)
{
+ // This is what we *should* do, but see fdo#63478
+ // variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "date");
+ // variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value));
+ // so we do that instead to work around:
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "float");
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, HSSFDateUtil.getExcelDate((Date) value, false, 2).toString());
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, HSSFDateUtil.getExcelDate((Date) value, false, 0).toString());
}
else if (value instanceof BigDecimal)
{