summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2015-07-13 16:03:15 +0200
committerAndras Timar <andras.timar@collabora.com>2015-09-28 10:06:43 +0200
commitb63ce61dcb9c6417eacbbecb6d1fc7ec8bc12b9d (patch)
tree121f72285d0d37ac955f72d0b90248a3fa6c7521
parent5af4e8e37e187949724ac4f57573341429bdebf8 (diff)
tdf#92693: ReportBuilder: MINUTES() rounded to nearest for fractional minutes
... instead of the correct truncation. Thanks to Lionel for the idea of the fix and his patience for newbies like me! Change-Id: I9864aeb08de2c054ee47aa6b04a31bdb4e20dc8c Reviewed-on: https://gerrit.libreoffice.org/17050 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 8a12cb1a98186deaedf21446592e2aedbda52e80)
-rw-r--r--external/jfreereport/UnpackedTarball_jfreereport_libformula.mk1
-rw-r--r--external/jfreereport/patches/libformula-minutes_truncation.patch.117
2 files changed, 18 insertions, 0 deletions
diff --git a/external/jfreereport/UnpackedTarball_jfreereport_libformula.mk b/external/jfreereport/UnpackedTarball_jfreereport_libformula.mk
index 2bc3229e54f7..bb789666ae62 100644
--- a/external/jfreereport/UnpackedTarball_jfreereport_libformula.mk
+++ b/external/jfreereport/UnpackedTarball_jfreereport_libformula.mk
@@ -18,6 +18,7 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_libformula,\
$(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 \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/jfreereport/patches/libformula-minutes_truncation.patch.1 b/external/jfreereport/patches/libformula-minutes_truncation.patch.1
new file mode 100644
index 000000000000..0df98db94016
--- /dev/null
+++ b/external/jfreereport/patches/libformula-minutes_truncation.patch.1
@@ -0,0 +1,17 @@
+Seulement dans jfreereport_libformula: bin
+Seulement dans jfreereport_libformula: build.log
+Seulement dans jfreereport_libformula: dist
+diff -ur jfreereport_libformula.org/source/org/pentaho/reporting/libraries/formula/function/datetime/MinuteFunction.java jfreereport_libformula/source/org/pentaho/reporting/libraries/formula/function/datetime/MinuteFunction.java
+--- jfreereport_libformula.org/source/org/pentaho/reporting/libraries/formula/function/datetime/MinuteFunction.java 2015-07-13 15:55:31.752539618 +0200
++++ jfreereport_libformula/source/org/pentaho/reporting/libraries/formula/function/datetime/MinuteFunction.java 2015-07-13 15:56:27.084394065 +0200
+@@ -74,7 +74,7 @@
+
+ // Multiply the minutes with 60 to get the minutes as ints
+ final BigDecimal minutes = minutesFraction.multiply(MINUTES);
+- final BigDecimal minutesAsInt = minutes.setScale(0, BigDecimal.ROUND_HALF_UP);
++ final BigDecimal minutesAsInt = NumberUtil.performIntRounding(minutes);
+ return new TypeValuePair(NumberType.GENERIC_NUMBER, minutesAsInt);
+ }
+-}
+\ Pas de fin de ligne à la fin du fichier
++}