[Libreoffice-commits] core.git: dbaccess/source
Julien Nabet
serval2412 at yahoo.fr
Mon May 28 14:53:28 UTC 2018
dbaccess/source/filter/hsqldb/rowinputbinary.cxx | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
New commits:
commit 91e6174a088b8c722e8c6d3482c1ae9a6818a7c5
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Mon May 21 18:56:52 2018 +0200
tdf#117732: Mig FB, fix reading of time
Change-Id: Ie67b50d899c4684f6fadd0c42337f54ef952078e
Reviewed-on: https://gerrit.libreoffice.org/54646
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
diff --git a/dbaccess/source/filter/hsqldb/rowinputbinary.cxx b/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
index 62c37525367d..d47901d2d7a4 100644
--- a/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
+++ b/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
@@ -333,7 +333,20 @@ std::vector<Any> HsqlRowInputStream::readOneRow(const ColumnTypeVector& nColType
{
sal_Int64 value = 0;
m_pStream->ReadInt64(value);
- css::util::Time time((value % 1000) * 1000000, value / 1000, 0, 0, true);
+ auto valueInSecs = value / 1000;
+ sal_uInt16 nHours = 0;
+ // in negative case value is comprised between
+ // -24 * 60 * 60 and -1
+ // so add 24 * 60 * 60 in order the rest of calculus is ok
+ if (valueInSecs < 0)
+ valueInSecs += 24 * 60 * 60;
+ else
+ nHours = (valueInSecs / 3600) + 1;
+
+ valueInSecs = valueInSecs % 3600;
+ const sal_uInt16 nMins = valueInSecs / 60;
+ const sal_uInt16 nSecs = valueInSecs % 60;
+ css::util::Time time((value % 1000) * 1000000, nSecs, nMins, nHours, true);
aData.push_back(makeAny(time));
}
break;
More information about the Libreoffice-commits
mailing list