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
5dcf5e9b
Kaydet (Commit)
5dcf5e9b
authored
Kas 28, 2012
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
cache calls to Date::SYSTEM
Change-Id: Iccdfeb45519dfc7e1373bf1303ecfc0c83f4cbc0
üst
03949c87
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
17 deletions
+41
-17
conditio.hxx
sc/inc/conditio.hxx
+11
-0
conditio.cxx
sc/source/core/data/conditio.cxx
+30
-17
No files found.
sc/inc/conditio.hxx
Dosyayı görüntüle @
5dcf5e9b
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#include "rangelst.hxx"
#include "rangelst.hxx"
#include <rtl/math.hxx>
#include <rtl/math.hxx>
#include <tools/date.hxx>
#include <map>
#include <map>
...
@@ -375,9 +376,19 @@ public:
...
@@ -375,9 +376,19 @@ public:
virtual
void
dumpInfo
(
rtl
::
OUStringBuffer
&
rBuf
)
const
;
virtual
void
dumpInfo
(
rtl
::
OUStringBuffer
&
rBuf
)
const
;
#endif
#endif
virtual
void
startRendering
();
virtual
void
endRendering
();
private
:
private
:
condformat
::
ScCondFormatDateType
meType
;
condformat
::
ScCondFormatDateType
meType
;
struct
ScCondDateFormatCache
{
Date
aCachedDate
;
};
boost
::
scoped_ptr
<
ScCondDateFormatCache
>
mpCache
;
rtl
::
OUString
maStyleName
;
rtl
::
OUString
maStyleName
;
};
};
...
...
sc/source/core/data/conditio.cxx
Dosyayı görüntüle @
5dcf5e9b
...
@@ -1662,9 +1662,12 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
...
@@ -1662,9 +1662,12 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
if
(
pBaseCell
->
GetCellType
()
!=
CELLTYPE_VALUE
&&
pBaseCell
->
GetCellType
()
!=
CELLTYPE_FORMULA
)
if
(
pBaseCell
->
GetCellType
()
!=
CELLTYPE_VALUE
&&
pBaseCell
->
GetCellType
()
!=
CELLTYPE_FORMULA
)
return
false
;
return
false
;
Date
aActDate
(
Date
::
SYSTEM
);
if
(
!
mpCache
)
mpCache
->
aCachedDate
=
Date
(
Date
::
SYSTEM
);
const
Date
&
rActDate
=
mpCache
->
aCachedDate
;
SvNumberFormatter
*
pFormatter
=
mpDoc
->
GetFormatTable
();
SvNumberFormatter
*
pFormatter
=
mpDoc
->
GetFormatTable
();
long
nCurrentDate
=
a
ActDate
-
*
(
pFormatter
->
GetNullDate
());
long
nCurrentDate
=
r
ActDate
-
*
(
pFormatter
->
GetNullDate
());
double
nVal
=
mpDoc
->
GetValue
(
rPos
);
double
nVal
=
mpDoc
->
GetValue
(
rPos
);
long
nCellDate
=
(
long
)
::
rtl
::
math
::
approxFloor
(
nVal
);
long
nCellDate
=
(
long
)
::
rtl
::
math
::
approxFloor
(
nVal
);
...
@@ -1690,57 +1693,57 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
...
@@ -1690,57 +1693,57 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
return
true
;
return
true
;
break
;
break
;
case
condformat
:
:
LASTWEEK
:
case
condformat
:
:
LASTWEEK
:
if
(
aActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
&&
a
ActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
)
if
(
rActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
&&
r
ActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
)
{
{
if
(
a
ActDate
.
GetWeekOfYear
(
SUNDAY
)
==
aCellDate
.
GetWeekOfYear
(
SUNDAY
)
+
1
)
if
(
r
ActDate
.
GetWeekOfYear
(
SUNDAY
)
==
aCellDate
.
GetWeekOfYear
(
SUNDAY
)
+
1
)
return
true
;
return
true
;
}
}
break
;
break
;
case
condformat
:
:
THISWEEK
:
case
condformat
:
:
THISWEEK
:
if
(
aActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
&&
a
ActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
)
if
(
rActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
&&
r
ActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
)
{
{
if
(
a
ActDate
.
GetWeekOfYear
(
SUNDAY
)
==
aCellDate
.
GetWeekOfYear
(
SUNDAY
)
)
if
(
r
ActDate
.
GetWeekOfYear
(
SUNDAY
)
==
aCellDate
.
GetWeekOfYear
(
SUNDAY
)
)
return
true
;
return
true
;
}
}
break
;
break
;
case
condformat
:
:
NEXTWEEK
:
case
condformat
:
:
NEXTWEEK
:
if
(
aActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
&&
a
ActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
)
if
(
rActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
&&
r
ActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
)
{
{
if
(
a
ActDate
.
GetWeekOfYear
(
SUNDAY
)
==
aCellDate
.
GetWeekOfYear
(
SUNDAY
)
-
1
)
if
(
r
ActDate
.
GetWeekOfYear
(
SUNDAY
)
==
aCellDate
.
GetWeekOfYear
(
SUNDAY
)
-
1
)
return
true
;
return
true
;
}
}
break
;
break
;
case
condformat
:
:
LASTMONTH
:
case
condformat
:
:
LASTMONTH
:
if
(
a
ActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
)
if
(
r
ActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
)
{
{
if
(
a
ActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
+
1
)
if
(
r
ActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
+
1
)
return
true
;
return
true
;
}
}
break
;
break
;
case
condformat
:
:
THISMONTH
:
case
condformat
:
:
THISMONTH
:
if
(
a
ActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
)
if
(
r
ActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
)
{
{
if
(
a
ActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
)
if
(
r
ActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
)
return
true
;
return
true
;
}
}
break
;
break
;
case
condformat
:
:
NEXTMONTH
:
case
condformat
:
:
NEXTMONTH
:
if
(
a
ActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
)
if
(
r
ActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
)
{
{
if
(
a
ActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
-
1
)
if
(
r
ActDate
.
GetMonth
()
==
aCellDate
.
GetMonth
()
-
1
)
return
true
;
return
true
;
}
}
break
;
break
;
case
condformat
:
:
LASTYEAR
:
case
condformat
:
:
LASTYEAR
:
if
(
a
ActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
+
1
)
if
(
r
ActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
+
1
)
return
true
;
return
true
;
break
;
break
;
case
condformat
:
:
THISYEAR
:
case
condformat
:
:
THISYEAR
:
if
(
a
ActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
)
if
(
r
ActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
)
return
true
;
return
true
;
break
;
break
;
case
condformat
:
:
NEXTYEAR
:
case
condformat
:
:
NEXTYEAR
:
if
(
a
ActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
-
1
)
if
(
r
ActDate
.
GetYear
()
==
aCellDate
.
GetYear
()
-
1
)
return
true
;
return
true
;
break
;
break
;
}
}
...
@@ -1791,6 +1794,16 @@ void ScCondDateFormatEntry::dumpInfo( rtl::OUStringBuffer& rBuffer ) const
...
@@ -1791,6 +1794,16 @@ void ScCondDateFormatEntry::dumpInfo( rtl::OUStringBuffer& rBuffer ) const
rBuffer
.
append
(
"Date Format"
);
rBuffer
.
append
(
"Date Format"
);
}
}
void
ScCondDateFormatEntry
::
startRendering
()
{
mpCache
.
reset
();
}
void
ScCondDateFormatEntry
::
endRendering
()
{
mpCache
.
reset
();
}
//------------------------------------------------------------------------
//------------------------------------------------------------------------
ScConditionalFormat
::
ScConditionalFormat
(
sal_uInt32
nNewKey
,
ScDocument
*
pDocument
)
:
ScConditionalFormat
::
ScConditionalFormat
(
sal_uInt32
nNewKey
,
ScDocument
*
pDocument
)
:
...
...
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