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
ee1af679
Kaydet (Commit)
ee1af679
authored
Kas 15, 2012
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
implement remaining conditional date formats
Change-Id: I0a514f305367f556be2fea6650afb63bff4c5a8c
üst
f3ddf092
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
8 deletions
+69
-8
conditio.hxx
sc/inc/conditio.hxx
+7
-4
conditio.cxx
sc/source/core/data/conditio.cxx
+62
-4
No files found.
sc/inc/conditio.hxx
Dosyayı görüntüle @
ee1af679
...
...
@@ -329,16 +329,19 @@ namespace condformat {
enum
ScCondFormatDateType
{
TODAY
,
YESTERDAY
,
TOMORROW
,
TODAY
,
LAST7DAYS
,
LASTWEEK
,
THISWEEK
,
LASTWEEK
,
NEXTWEEK
,
LASTMONTH
,
THISMONTH
,
NEXTMONTH
LASTMONTH
,
NEXTMONTH
,
THISYEAR
,
LASTYEAR
,
NEXTYEAR
};
}
...
...
sc/source/core/data/conditio.cxx
Dosyayı görüntüle @
ee1af679
...
...
@@ -1650,12 +1650,15 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
if
(
pBaseCell
->
GetCellType
()
!=
CELLTYPE_VALUE
&&
pBaseCell
->
GetCellType
()
!=
CELLTYPE_FORMULA
)
return
false
;
double
nVal
=
mpDoc
->
GetValue
(
rPos
);
long
nCellDate
=
static_cast
<
long
>
(
nVal
);
Date
aActDate
(
Date
::
SYSTEM
);
SvNumberFormatter
*
pFormatter
=
mpDoc
->
GetFormatTable
();
long
nCurrentDate
=
aActDate
-
*
(
pFormatter
->
GetNullDate
());
double
nVal
=
mpDoc
->
GetValue
(
rPos
);
long
nCellDate
=
static_cast
<
long
>
(
nVal
);
Date
aCellDate
=
*
(
pFormatter
->
GetNullDate
());
aCellDate
+=
(
long
)
::
rtl
::
math
::
approxFloor
(
nVal
);
switch
(
meType
)
{
case
condformat
:
:
TODAY
:
...
...
@@ -1670,8 +1673,63 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
if
(
nCurrentDate
==
nCellDate
+
1
)
return
true
;
break
;
default
:
return
true
;
case
condformat
:
:
LAST7DAYS
:
if
(
nCurrentDate
>=
nCellDate
&&
nCurrentDate
-
7
<
nCellDate
)
return
true
;
break
;
case
condformat
:
:
LASTWEEK
:
if
(
aActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
&&
aActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
)
{
if
(
aActDate
.
GetWeekOfYear
(
SUNDAY
)
==
aCellDate
.
GetWeekOfYear
(
SUNDAY
)
+
1
)
return
true
;
}
break
;
case
condformat
:
:
THISWEEK
:
if
(
aActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
&&
aActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
)
{
if
(
aActDate
.
GetWeekOfYear
(
SUNDAY
)
==
aCellDate
.
GetWeekOfYear
(
SUNDAY
)
)
return
true
;
}
break
;
case
condformat
:
:
NEXTWEEK
:
if
(
aActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
&&
aActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
)
{
if
(
aActDate
.
GetWeekOfYear
(
SUNDAY
)
==
aCellDate
.
GetWeekOfYear
(
SUNDAY
)
-
1
)
return
true
;
}
break
;
case
condformat
:
:
LASTMONTH
:
if
(
aActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
)
{
if
(
aActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
+
1
)
return
true
;
}
break
;
case
condformat
:
:
THISMONTH
:
if
(
aActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
)
{
if
(
aActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
)
return
true
;
}
break
;
case
condformat
:
:
NEXTMONTH
:
if
(
aActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
)
{
if
(
aActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
-
1
)
return
true
;
}
break
;
case
condformat
:
:
LASTYEAR
:
if
(
aActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
+
1
)
return
true
;
break
;
case
condformat
:
:
THISYEAR
:
if
(
aActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
)
return
true
;
break
;
case
condformat
:
:
NEXTYEAR
:
if
(
aActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
-
1
)
return
true
;
break
;
}
...
...
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