fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / external / jfreereport / patches / libformula-datevalue_truncation.patch.1
blob069c667c19ac9f52c710320a21036fe7399e07c7
1 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
2 --- jfreereport_libformula.org/source/org/pentaho/reporting/libraries/formula/function/datetime/DateValueFunction.java  2010-06-01 17:15:50.000000000 +0200
3 +++ jfreereport_libformula/source/org/pentaho/reporting/libraries/formula/function/datetime/DateValueFunction.java      2015-07-14 17:24:42.503895240 +0200
4 @@ -18,6 +18,7 @@
5  package org.pentaho.reporting.libraries.formula.function.datetime;
6  
7  import java.util.Date;
8 +import java.util.Calendar;
9  
10  import org.pentaho.reporting.libraries.formula.EvaluationException;
11  import org.pentaho.reporting.libraries.formula.FormulaContext;
12 @@ -28,6 +29,7 @@
13  import org.pentaho.reporting.libraries.formula.typing.Type;
14  import org.pentaho.reporting.libraries.formula.typing.TypeRegistry;
15  import org.pentaho.reporting.libraries.formula.typing.coretypes.DateTimeType;
16 +import org.pentaho.reporting.libraries.formula.util.DateUtil;
18  /**
19   * This function returns
20 @@ -61,7 +63,8 @@
21      final Object value = parameters.getValue(0);
23      final Date date1 = typeRegistry.convertToDate(type, value);
24 -    return new TypeValuePair(DateTimeType.DATE_TYPE, date1);
25 +    final Date date  = DateUtil.normalizeDate(date1, DateTimeType.DATE_TYPE);
27 +    return new TypeValuePair(DateTimeType.DATE_TYPE, date);
28    }
29  }