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
83a7d544
Kaydet (Commit)
83a7d544
authored
Mar 24, 2012
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Store the group type (aka date part) with the cache, and use that.
With this, we can phase out the "DateHelper" class...
üst
09bc4a1e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
13 deletions
+38
-13
dpcache.hxx
sc/inc/dpcache.hxx
+4
-2
dpcache.cxx
sc/source/core/data/dpcache.cxx
+27
-5
dpdimsave.cxx
sc/source/core/data/dpdimsave.cxx
+3
-3
dpgroup.cxx
sc/source/core/data/dpgroup.cxx
+4
-3
No files found.
sc/inc/dpcache.hxx
Dosyayı görüntüle @
83a7d544
...
@@ -72,9 +72,10 @@ public:
...
@@ -72,9 +72,10 @@ public:
{
{
ItemsType
maItems
;
ItemsType
maItems
;
ScDPNumGroupInfo
maInfo
;
ScDPNumGroupInfo
maInfo
;
sal_Int32
mnGroupType
;
GroupItems
();
GroupItems
();
GroupItems
(
const
ScDPNumGroupInfo
&
rInfo
);
GroupItems
(
const
ScDPNumGroupInfo
&
rInfo
,
sal_Int32
nGroupType
);
};
};
struct
Field
:
boost
::
noncopyable
struct
Field
:
boost
::
noncopyable
...
@@ -132,11 +133,12 @@ public:
...
@@ -132,11 +133,12 @@ public:
SCROW
GetIdByItemData
(
long
nDim
,
const
ScDPItemData
&
rItem
)
const
;
SCROW
GetIdByItemData
(
long
nDim
,
const
ScDPItemData
&
rItem
)
const
;
rtl
::
OUString
GetFormattedString
(
long
nDim
,
const
ScDPItemData
&
rItem
)
const
;
rtl
::
OUString
GetFormattedString
(
long
nDim
,
const
ScDPItemData
&
rItem
)
const
;
long
AppendGroupField
();
long
AppendGroupField
();
void
ResetGroupItems
(
long
nDim
,
const
ScDPNumGroupInfo
&
rNumInfo
);
void
ResetGroupItems
(
long
nDim
,
const
ScDPNumGroupInfo
&
rNumInfo
,
sal_Int32
nGroupType
);
SCROW
SetGroupItem
(
long
nDim
,
const
ScDPItemData
&
rData
);
SCROW
SetGroupItem
(
long
nDim
,
const
ScDPItemData
&
rData
);
void
GetGroupDimMemberIds
(
long
nDim
,
std
::
vector
<
SCROW
>&
rIds
)
const
;
void
GetGroupDimMemberIds
(
long
nDim
,
std
::
vector
<
SCROW
>&
rIds
)
const
;
void
ClearGroupFields
();
void
ClearGroupFields
();
const
ScDPNumGroupInfo
*
GetNumGroupInfo
(
long
nDim
)
const
;
const
ScDPNumGroupInfo
*
GetNumGroupInfo
(
long
nDim
)
const
;
sal_Int32
GetGroupType
(
long
nDim
)
const
;
SCCOL
GetDimensionIndex
(
const
rtl
::
OUString
&
sName
)
const
;
SCCOL
GetDimensionIndex
(
const
rtl
::
OUString
&
sName
)
const
;
sal_uLong
GetNumberFormat
(
long
nDim
)
const
;
sal_uLong
GetNumberFormat
(
long
nDim
)
const
;
...
...
sc/source/core/data/dpcache.cxx
Dosyayı görüntüle @
83a7d544
...
@@ -62,10 +62,10 @@ using ::com::sun::star::uno::Reference;
...
@@ -62,10 +62,10 @@ using ::com::sun::star::uno::Reference;
using
::
com
::
sun
::
star
::
uno
::
UNO_QUERY
;
using
::
com
::
sun
::
star
::
uno
::
UNO_QUERY
;
using
::
com
::
sun
::
star
::
uno
::
UNO_QUERY_THROW
;
using
::
com
::
sun
::
star
::
uno
::
UNO_QUERY_THROW
;
ScDPCache
::
GroupItems
::
GroupItems
()
{}
ScDPCache
::
GroupItems
::
GroupItems
()
:
mnGroupType
(
0
)
{}
ScDPCache
::
GroupItems
::
GroupItems
(
const
ScDPNumGroupInfo
&
rInfo
)
:
ScDPCache
::
GroupItems
::
GroupItems
(
const
ScDPNumGroupInfo
&
rInfo
,
sal_Int32
nGroupType
)
:
maInfo
(
rInfo
)
{}
maInfo
(
rInfo
)
,
mnGroupType
(
nGroupType
)
{}
ScDPCache
::
Field
::
Field
()
:
mnNumFormat
(
0
)
{}
ScDPCache
::
Field
::
Field
()
:
mnNumFormat
(
0
)
{}
...
@@ -1019,7 +1019,7 @@ long ScDPCache::AppendGroupField()
...
@@ -1019,7 +1019,7 @@ long ScDPCache::AppendGroupField()
return
static_cast
<
long
>
(
maFields
.
size
()
+
maGroupFields
.
size
()
-
1
);
return
static_cast
<
long
>
(
maFields
.
size
()
+
maGroupFields
.
size
()
-
1
);
}
}
void
ScDPCache
::
ResetGroupItems
(
long
nDim
,
const
ScDPNumGroupInfo
&
rNumInfo
)
void
ScDPCache
::
ResetGroupItems
(
long
nDim
,
const
ScDPNumGroupInfo
&
rNumInfo
,
sal_Int32
nGroupType
)
{
{
if
(
nDim
<
0
)
if
(
nDim
<
0
)
return
;
return
;
...
@@ -1027,7 +1027,7 @@ void ScDPCache::ResetGroupItems(long nDim, const ScDPNumGroupInfo& rNumInfo)
...
@@ -1027,7 +1027,7 @@ void ScDPCache::ResetGroupItems(long nDim, const ScDPNumGroupInfo& rNumInfo)
long
nSourceCount
=
static_cast
<
long
>
(
maFields
.
size
());
long
nSourceCount
=
static_cast
<
long
>
(
maFields
.
size
());
if
(
nDim
<
nSourceCount
)
if
(
nDim
<
nSourceCount
)
{
{
maFields
.
at
(
nDim
).
mpGroup
.
reset
(
new
GroupItems
(
rNumInfo
));
maFields
.
at
(
nDim
).
mpGroup
.
reset
(
new
GroupItems
(
rNumInfo
,
nGroupType
));
return
;
return
;
}
}
...
@@ -1037,6 +1037,7 @@ void ScDPCache::ResetGroupItems(long nDim, const ScDPNumGroupInfo& rNumInfo)
...
@@ -1037,6 +1037,7 @@ void ScDPCache::ResetGroupItems(long nDim, const ScDPNumGroupInfo& rNumInfo)
GroupItems
&
rGI
=
maGroupFields
[
nDim
];
GroupItems
&
rGI
=
maGroupFields
[
nDim
];
rGI
.
maItems
.
clear
();
rGI
.
maItems
.
clear
();
rGI
.
maInfo
=
rNumInfo
;
rGI
.
maInfo
=
rNumInfo
;
rGI
.
mnGroupType
=
nGroupType
;
}
}
}
}
...
@@ -1132,6 +1133,27 @@ const ScDPNumGroupInfo* ScDPCache::GetNumGroupInfo(long nDim) const
...
@@ -1132,6 +1133,27 @@ const ScDPNumGroupInfo* ScDPCache::GetNumGroupInfo(long nDim) const
return
NULL
;
return
NULL
;
}
}
sal_Int32
ScDPCache
::
GetGroupType
(
long
nDim
)
const
{
if
(
nDim
<
0
)
return
0
;
long
nSourceCount
=
static_cast
<
long
>
(
maFields
.
size
());
if
(
nDim
<
nSourceCount
)
{
if
(
!
maFields
.
at
(
nDim
).
mpGroup
)
return
0
;
return
maFields
[
nDim
].
mpGroup
->
mnGroupType
;
}
nDim
-=
nSourceCount
;
if
(
nDim
<
static_cast
<
long
>
(
maGroupFields
.
size
()))
return
maGroupFields
.
at
(
nDim
).
mnGroupType
;
return
0
;
}
SCROW
ScDPCache
::
GetOrder
(
long
/*nDim*/
,
SCROW
nIndex
)
const
SCROW
ScDPCache
::
GetOrder
(
long
/*nDim*/
,
SCROW
nIndex
)
const
{
{
return
nIndex
;
return
nIndex
;
...
...
sc/source/core/data/dpdimsave.cxx
Dosyayı görüntüle @
83a7d544
...
@@ -357,7 +357,7 @@ void fillDateGroupDimension(
...
@@ -357,7 +357,7 @@ void fillDateGroupDimension(
}
}
// Now, populate the group items in the cache.
// Now, populate the group items in the cache.
rCache
.
ResetGroupItems
(
nGroupDim
,
rDateInfo
);
rCache
.
ResetGroupItems
(
nGroupDim
,
rDateInfo
,
nDatePart
);
for
(
sal_Int32
nValue
=
nStart
;
nValue
<=
nEnd
;
++
nValue
)
for
(
sal_Int32
nValue
=
nStart
;
nValue
<=
nEnd
;
++
nValue
)
rCache
.
SetGroupItem
(
nGroupDim
,
ScDPItemData
(
nDatePart
,
nValue
));
rCache
.
SetGroupItem
(
nGroupDim
,
ScDPItemData
(
nDatePart
,
nValue
));
...
@@ -408,7 +408,7 @@ void ScDPSaveGroupDimension::AddToCache(ScDPCache& rCache) const
...
@@ -408,7 +408,7 @@ void ScDPSaveGroupDimension::AddToCache(ScDPCache& rCache) const
return
;
return
;
}
}
rCache
.
ResetGroupItems
(
nDim
,
aDateInfo
);
rCache
.
ResetGroupItems
(
nDim
,
aDateInfo
,
0
);
{
{
ScDPSaveGroupItemVec
::
const_iterator
it
=
aGroups
.
begin
(),
itEnd
=
aGroups
.
end
();
ScDPSaveGroupItemVec
::
const_iterator
it
=
aGroups
.
begin
(),
itEnd
=
aGroups
.
end
();
for
(;
it
!=
itEnd
;
++
it
)
for
(;
it
!=
itEnd
;
++
it
)
...
@@ -541,7 +541,7 @@ void ScDPSaveNumGroupDimension::AddToCache(ScDPCache& rCache) const
...
@@ -541,7 +541,7 @@ void ScDPSaveNumGroupDimension::AddToCache(ScDPCache& rCache) const
long
nLoopCount
=
0
;
long
nLoopCount
=
0
;
double
fLoop
=
aGroupInfo
.
mfStart
;
double
fLoop
=
aGroupInfo
.
mfStart
;
rCache
.
ResetGroupItems
(
nDim
,
aGroupInfo
);
rCache
.
ResetGroupItems
(
nDim
,
aGroupInfo
,
0
);
// Use "less than" instead of "less or equal" for the loop - don't
// Use "less than" instead of "less or equal" for the loop - don't
// create a group that consists only of the end value. Instead, the
// create a group that consists only of the end value. Instead, the
...
...
sc/source/core/data/dpgroup.cxx
Dosyayı görüntüle @
83a7d544
...
@@ -901,16 +901,17 @@ void ScDPGroupTableData::FillGroupValues(vector<SCROW>& rItems, const vector<lon
...
@@ -901,16 +901,17 @@ void ScDPGroupTableData::FillGroupValues(vector<SCROW>& rItems, const vector<lon
if
(
pDateHelper
&&
pNumInfo
)
if
(
pDateHelper
&&
pNumInfo
)
{
{
sal_Int32
nDatePart
=
pCache
->
GetGroupType
(
nColumn
);
const
ScDPItemData
*
pData
=
pCache
->
GetItemDataById
(
nSourceDim
,
rItems
[
i
]);
const
ScDPItemData
*
pData
=
pCache
->
GetItemDataById
(
nSourceDim
,
rItems
[
i
]);
if
(
pData
->
GetType
()
==
ScDPItemData
::
Value
)
if
(
pData
->
GetType
()
==
ScDPItemData
::
Value
)
{
{
SvNumberFormatter
*
pFormatter
=
pDoc
->
GetFormatTable
();
SvNumberFormatter
*
pFormatter
=
pDoc
->
GetFormatTable
();
sal_Int32
nPartValue
=
ScDPUtil
::
getDatePartValue
(
sal_Int32
nPartValue
=
ScDPUtil
::
getDatePartValue
(
pData
->
GetValue
(),
*
pNumInfo
,
pDateHelper
->
GetDatePart
()
,
pFormatter
);
pData
->
GetValue
(),
*
pNumInfo
,
nDatePart
,
pFormatter
);
rtl
::
OUString
aName
=
ScDPUtil
::
getDateGroupName
(
rtl
::
OUString
aName
=
ScDPUtil
::
getDateGroupName
(
pDateHelper
->
GetDatePart
()
,
nPartValue
,
pFormatter
,
pNumInfo
->
mfStart
,
pNumInfo
->
mfEnd
);
nDatePart
,
nPartValue
,
pFormatter
,
pNumInfo
->
mfStart
,
pNumInfo
->
mfEnd
);
ScDPItemData
aItem
(
pDateHelper
->
GetDatePart
()
,
nPartValue
);
ScDPItemData
aItem
(
nDatePart
,
nPartValue
);
rItems
[
i
]
=
pCache
->
GetIdByItemData
(
nColumn
,
aItem
);
rItems
[
i
]
=
pCache
->
GetIdByItemData
(
nColumn
,
aItem
);
}
}
}
}
...
...
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