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
8232eaf9
Kaydet (Commit)
8232eaf9
authored
May 17, 2013
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ImplDateIncrementYear: handle February 29
Change-Id: I1120950f1161e51591701368229844f6a5344eeb
üst
eea4a30a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
field2.cxx
vcl/source/control/field2.cxx
+15
-0
No files found.
vcl/source/control/field2.cxx
Dosyayı görüntüle @
8232eaf9
...
@@ -1372,6 +1372,7 @@ static void ImplDateIncrementYear( Date& rDate, sal_Bool bUp )
...
@@ -1372,6 +1372,7 @@ static void ImplDateIncrementYear( Date& rDate, sal_Bool bUp )
DateFormatter
::
ExpandCentury
(
rDate
);
DateFormatter
::
ExpandCentury
(
rDate
);
sal_uInt16
nYear
=
rDate
.
GetYear
();
sal_uInt16
nYear
=
rDate
.
GetYear
();
sal_uInt16
nMonth
=
rDate
.
GetMonth
();
if
(
bUp
)
if
(
bUp
)
{
{
if
(
nYear
<
9999
)
if
(
nYear
<
9999
)
...
@@ -1382,6 +1383,20 @@ static void ImplDateIncrementYear( Date& rDate, sal_Bool bUp )
...
@@ -1382,6 +1383,20 @@ static void ImplDateIncrementYear( Date& rDate, sal_Bool bUp )
if
(
nYear
>
0
)
if
(
nYear
>
0
)
rDate
.
SetYear
(
nYear
-
1
);
rDate
.
SetYear
(
nYear
-
1
);
}
}
if
(
nMonth
==
2
)
{
// Handle February 29 from leap year to non-leap year.
sal_uInt16
nDay
=
rDate
.
GetDay
();
if
(
nDay
>
28
)
{
// The check would not be necessary if it was guaranteed that the
// date was valid before and actually was a leap year,
// de-/incrementing a leap year with 29 always results in 28.
sal_uInt16
nDaysInMonth
=
Date
::
GetDaysInMonth
(
nMonth
,
rDate
.
GetYear
());
if
(
nDay
>
nDaysInMonth
)
rDate
.
SetDay
(
nDaysInMonth
);
}
}
}
}
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
...
...
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