Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
0ccbd588
Kaydet (Commit)
0ccbd588
authored
Agu 02, 2017
tarafından
Lionel Elie Mamane
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tdf#110997 protect calls to implBuildFromRelative from year overflow
Change-Id: I5c6768766673832b7271292af85db1b76e51042c
üst
cb4fd238
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
4 deletions
+28
-4
dbconversion.cxx
connectivity/source/commontools/dbconversion.cxx
+28
-4
No files found.
connectivity/source/commontools/dbconversion.cxx
Dosyayı görüntüle @
0ccbd588
...
...
@@ -42,6 +42,16 @@ namespace
const
sal_Int64
hourMask
=
10000000000000LL
;
const
double
fNanoSecondsPerDay
=
nanoSecInSec
*
secInMin
*
minInHour
*
24.0
;
// 32767-12-31 in "(days since 0001-01-01) + 1" format
const
sal_Int32
maxDays
=
11967896
;
// -32768-01-01 in "(days since 0001-01-01) + 1" format
// Yes, I know it is currently unused. Will have to be used
// when we implement negative years. Writing down the correct
// value for future reference.
// *** Please don't remove just because it is unused ***
// Lionel Élie Mamane 2017-08-02
// const sal_Int32 minDays = -11968270;
}
...
...
@@ -269,8 +279,15 @@ namespace dbtools
sal_Int32
nTempDays
=
implRelativeToAbsoluteNull
(
_rDate
);
nTempDays
+=
nDays
;
// TODO: can we remove that check? Would allow dates before 1900.
if
(
nTempDays
<=
0
)
if
(
nTempDays
>
maxDays
)
{
_rDate
.
Day
=
31
;
_rDate
.
Month
=
12
;
_rDate
.
Year
=
9999
;
}
// TODO: can we replace that check by minDays? Would allow dates BCE
// implBuildFromRelative probably needs to be updated for the "no year 0" question
else
if
(
nTempDays
<=
0
)
{
_rDate
.
Day
=
1
;
_rDate
.
Month
=
1
;
...
...
@@ -285,8 +302,15 @@ namespace dbtools
sal_Int32
nTempDays
=
implRelativeToAbsoluteNull
(
_rDate
);
nTempDays
-=
nDays
;
// TODO: can we remove that check? Would allow dates before 1900.
if
(
nTempDays
<=
0
)
if
(
nTempDays
>
maxDays
)
{
_rDate
.
Day
=
31
;
_rDate
.
Month
=
12
;
_rDate
.
Year
=
9999
;
}
// TODO: can we replace that check by minDays? Would allow dates BCE
// implBuildFromRelative probably needs to be updated for the "no year 0" question
else
if
(
nTempDays
<=
0
)
{
_rDate
.
Day
=
1
;
_rDate
.
Month
=
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment