Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3363

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/63/3363/1

fdo#36858

1) No valueType (Format/Number/General) is like float valueType (Format/Number/any other)
2) We use 1/1/1900 as startdate for number-from-date, stick to it more consistently

Change-Id: Ib1008d1c30be602d8173457738c915087ed17391
---
M reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java
1 file changed, 8 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 99ff3e5..f82d890 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java
@@ -126,9 +126,10 @@
         }
         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 @@
         }
         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)
         {

-- 
To view, visit https://gerrit.libreoffice.org/3363
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib1008d1c30be602d8173457738c915087ed17391
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Lionel Elie Mamane <lionel@mamane.lu>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.