[Libreoffice-commits] core.git: external/jfreereport

Lionel Elie Mamane lionel at mamane.lu
Tue Jul 14 08:59:22 PDT 2015


 external/jfreereport/UnpackedTarball_jfreereport_flow_engine.mk      |    1 
 external/jfreereport/UnpackedTarball_jfreereport_libformula.mk       |    1 
 external/jfreereport/patches/flow-engine_date_is_datetime.patch.1    |   13 ++++
 external/jfreereport/patches/libformula-datevalue_truncation.patch.1 |   29 ++++++++++
 4 files changed, 44 insertions(+)

New commits:
commit 8c271621c8d2c1e50cfe8bf4866b9a42adf3c9d8
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Tue Jul 14 17:49:44 2015 +0200

    tdf#92654 a "Date" can contain a Time, so don't loose date by default
    
    also fix DATEVALUE() function that was relying on this dataloss
    
    Change-Id: I6030505a762df3ecbfe9a8331267846d3de817e8

diff --git a/external/jfreereport/UnpackedTarball_jfreereport_flow_engine.mk b/external/jfreereport/UnpackedTarball_jfreereport_flow_engine.mk
index f6640e4..e0d309a 100644
--- a/external/jfreereport/UnpackedTarball_jfreereport_flow_engine.mk
+++ b/external/jfreereport/UnpackedTarball_jfreereport_flow_engine.mk
@@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_flow_engine,\
 
 $(eval $(call gb_UnpackedTarball_add_patches,jfreereport_flow_engine,\
 	external/jfreereport/patches/flow-engine.patch \
+	external/jfreereport/patches/flow-engine_date_is_datetime.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/jfreereport/UnpackedTarball_jfreereport_libformula.mk b/external/jfreereport/UnpackedTarball_jfreereport_libformula.mk
index bb78966..ec9d29d 100644
--- a/external/jfreereport/UnpackedTarball_jfreereport_libformula.mk
+++ b/external/jfreereport/UnpackedTarball_jfreereport_libformula.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,jfreereport_libformula,\
 	external/jfreereport/patches/common_build.patch \
 	external/jfreereport/patches/libformula-time-notz.patch \
 	external/jfreereport/patches/libformula-minutes_truncation.patch.1 \
+	external/jfreereport/patches/libformula-datevalue_truncation.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/jfreereport/patches/flow-engine_date_is_datetime.patch.1 b/external/jfreereport/patches/flow-engine_date_is_datetime.patch.1
new file mode 100644
index 0000000..3ed23ee
--- /dev/null
+++ b/external/jfreereport/patches/flow-engine_date_is_datetime.patch.1
@@ -0,0 +1,13 @@
+diff -ur jfreereport_flow_engine.org/source/org/jfree/report/expressions/ReportFormulaContext.java jfreereport_flow_engine/source/org/jfree/report/expressions/ReportFormulaContext.java
+--- jfreereport_flow_engine.org/source/org/jfree/report/expressions/ReportFormulaContext.java	2015-07-14 17:24:51.924156060 +0200
++++ jfreereport_flow_engine/source/org/jfree/report/expressions/ReportFormulaContext.java	2015-07-14 17:27:56.669270298 +0200
+@@ -120,7 +120,7 @@
+       {
+         if (flags.isDate())
+         {
+-          return DateTimeType.DATE_TYPE;
++          return DateTimeType.DATETIME_TYPE;
+         }
+         if (flags.isNumeric())
+         {
+Only in jfreereport_flow_engine/source/org/jfree/report/expressions: ReportFormulaContext.java~
diff --git a/external/jfreereport/patches/libformula-datevalue_truncation.patch.1 b/external/jfreereport/patches/libformula-datevalue_truncation.patch.1
new file mode 100644
index 0000000..069c667
--- /dev/null
+++ b/external/jfreereport/patches/libformula-datevalue_truncation.patch.1
@@ -0,0 +1,29 @@
+diff -ur jfreereport_libformula.org/source/org/pentaho/reporting/libraries/formula/function/datetime/DateValueFunction.java jfreereport_libformula/source/org/pentaho/reporting/libraries/formula/function/datetime/DateValueFunction.java
+--- jfreereport_libformula.org/source/org/pentaho/reporting/libraries/formula/function/datetime/DateValueFunction.java	2010-06-01 17:15:50.000000000 +0200
++++ jfreereport_libformula/source/org/pentaho/reporting/libraries/formula/function/datetime/DateValueFunction.java	2015-07-14 17:24:42.503895240 +0200
+@@ -18,6 +18,7 @@
+ package org.pentaho.reporting.libraries.formula.function.datetime;
+ 
+ import java.util.Date;
++import java.util.Calendar;
+ 
+ import org.pentaho.reporting.libraries.formula.EvaluationException;
+ import org.pentaho.reporting.libraries.formula.FormulaContext;
+@@ -28,6 +29,7 @@
+ import org.pentaho.reporting.libraries.formula.typing.Type;
+ import org.pentaho.reporting.libraries.formula.typing.TypeRegistry;
+ import org.pentaho.reporting.libraries.formula.typing.coretypes.DateTimeType;
++import org.pentaho.reporting.libraries.formula.util.DateUtil;
+ 
+ /**
+  * This function returns
+@@ -61,7 +63,8 @@
+     final Object value = parameters.getValue(0);
+ 
+     final Date date1 = typeRegistry.convertToDate(type, value);
+-    return new TypeValuePair(DateTimeType.DATE_TYPE, date1);
++    final Date date  = DateUtil.normalizeDate(date1, DateTimeType.DATE_TYPE);
+ 
++    return new TypeValuePair(DateTimeType.DATE_TYPE, date);
+   }
+ }


More information about the Libreoffice-commits mailing list