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
e75f8d8e
Kaydet (Commit)
e75f8d8e
authored
Mar 31, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sc: clean-up pivot.hxx/pivot2.cxx
Change-Id: I88ed4da8dd2ca026eeea4a3fb267f4f9954c180a
üst
4f1f8b8e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
92 deletions
+100
-92
pivot.hxx
sc/inc/pivot.hxx
+15
-12
pivot2.cxx
sc/source/core/data/pivot2.cxx
+85
-80
No files found.
sc/inc/pivot.hxx
Dosyayı görüntüle @
e75f8d8e
...
@@ -92,11 +92,11 @@ struct ScDPLabelData
...
@@ -92,11 +92,11 @@ struct ScDPLabelData
*/
*/
OUString
SC_DLLPUBLIC
getDisplayName
()
const
;
OUString
SC_DLLPUBLIC
getDisplayName
()
const
;
};
};
::
std
::
vector
<
Member
>
maMembers
;
std
::
vector
<
Member
>
maMembers
;
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>
maHiers
;
///< Hierarchies.
css
::
uno
::
Sequence
<
OUString
>
maHiers
;
///< Hierarchies.
::
com
::
sun
::
star
::
sheet
::
DataPilotFieldSortInfo
maSortInfo
;
///< Sorting info.
css
::
sheet
::
DataPilotFieldSortInfo
maSortInfo
;
///< Sorting info.
::
com
::
sun
::
star
::
sheet
::
DataPilotFieldLayoutInfo
maLayoutInfo
;
///< Layout info.
css
::
sheet
::
DataPilotFieldLayoutInfo
maLayoutInfo
;
///< Layout info.
::
com
::
sun
::
star
::
sheet
::
DataPilotFieldAutoShowInfo
maShowInfo
;
///< AutoShow info.
css
::
sheet
::
DataPilotFieldAutoShowInfo
maShowInfo
;
///< AutoShow info.
ScDPLabelData
();
ScDPLabelData
();
...
@@ -115,7 +115,8 @@ struct ScPivotField
...
@@ -115,7 +115,8 @@ struct ScPivotField
long
mnOriginalDim
;
///< >= 0 for duplicated field.
long
mnOriginalDim
;
///< >= 0 for duplicated field.
sal_uInt16
nFuncMask
;
sal_uInt16
nFuncMask
;
sal_uInt8
mnDupCount
;
sal_uInt8
mnDupCount
;
::
com
::
sun
::
star
::
sheet
::
DataPilotFieldReference
maFieldRef
;
css
::
sheet
::
DataPilotFieldReference
maFieldRef
;
explicit
ScPivotField
(
SCCOL
nNewCol
=
0
,
sal_uInt16
nNewFuncMask
=
PIVOT_FUNC_NONE
);
explicit
ScPivotField
(
SCCOL
nNewCol
=
0
,
sal_uInt16
nNewFuncMask
=
PIVOT_FUNC_NONE
);
ScPivotField
(
const
ScPivotField
&
r
);
ScPivotField
(
const
ScPivotField
&
r
);
...
@@ -124,18 +125,20 @@ struct ScPivotField
...
@@ -124,18 +125,20 @@ struct ScPivotField
bool
operator
==
(
const
ScPivotField
&
r
)
const
;
bool
operator
==
(
const
ScPivotField
&
r
)
const
;
};
};
typedef
::
std
::
vector
<
ScPivotField
>
ScPivotFieldVector
;
typedef
std
::
vector
<
ScPivotField
>
ScPivotFieldVector
;
struct
ScPivotParam
struct
ScPivotParam
{
{
SCCOL
nCol
;
///< Cursor Position /
SCCOL
nCol
;
///< Cursor Position /
SCROW
nRow
;
///< or start of destination area
SCROW
nRow
;
///< or start of destination area
SCTAB
nTab
;
SCTAB
nTab
;
ScDPLabelDataVector
maLabelArray
;
ScDPLabelDataVector
maLabelArray
;
ScPivotFieldVector
maPageFields
;
ScPivotFieldVector
maPageFields
;
ScPivotFieldVector
maColFields
;
ScPivotFieldVector
maColFields
;
ScPivotFieldVector
maRowFields
;
ScPivotFieldVector
maRowFields
;
ScPivotFieldVector
maDataFields
;
ScPivotFieldVector
maDataFields
;
bool
bIgnoreEmptyRows
;
bool
bIgnoreEmptyRows
;
bool
bDetectCategories
;
bool
bDetectCategories
;
bool
bMakeTotalCol
;
bool
bMakeTotalCol
;
...
@@ -156,12 +159,12 @@ struct ScPivotFuncData
...
@@ -156,12 +159,12 @@ struct ScPivotFuncData
long
mnOriginalDim
;
long
mnOriginalDim
;
sal_uInt16
mnFuncMask
;
sal_uInt16
mnFuncMask
;
sal_uInt8
mnDupCount
;
sal_uInt8
mnDupCount
;
::
com
::
sun
::
star
::
sheet
::
DataPilotFieldReference
maFieldRef
;
css
::
sheet
::
DataPilotFieldReference
maFieldRef
;
explicit
ScPivotFuncData
(
SCCOL
nCol
,
sal_uInt16
nFuncMask
);
explicit
ScPivotFuncData
(
SCCOL
nCol
,
sal_uInt16
nFuncMask
);
explicit
ScPivotFuncData
(
explicit
ScPivotFuncData
(
SCCOL
nCol
,
long
nOriginalDim
,
sal_uInt16
nFuncMask
,
sal_uInt8
nDupCount
,
SCCOL
nCol
,
long
nOriginalDim
,
sal_uInt16
nFuncMask
,
sal_uInt8
nDupCount
,
const
css
::
sheet
::
DataPilotFieldReference
&
rFieldRef
);
const
::
com
::
sun
::
star
::
sheet
::
DataPilotFieldReference
&
rFieldRef
);
bool
operator
==
(
const
ScPivotFuncData
&
r
)
const
;
bool
operator
==
(
const
ScPivotFuncData
&
r
)
const
;
...
@@ -170,7 +173,7 @@ struct ScPivotFuncData
...
@@ -170,7 +173,7 @@ struct ScPivotFuncData
#endif
#endif
};
};
typedef
::
std
::
vector
<
ScPivotFuncData
>
ScPivotFuncDataVector
;
typedef
std
::
vector
<
ScPivotFuncData
>
ScPivotFuncDataVector
;
typedef
std
::
vector
<
ScDPName
>
ScDPNameVec
;
typedef
std
::
vector
<
ScDPName
>
ScDPNameVec
;
#endif
#endif
...
...
sc/source/core/data/pivot2.cxx
Dosyayı görüntüle @
e75f8d8e
...
@@ -43,10 +43,11 @@ using std::cout;
...
@@ -43,10 +43,11 @@ using std::cout;
using
std
::
endl
;
using
std
::
endl
;
#endif
#endif
using
::
com
::
sun
::
star
::
sheet
::
DataPilotFieldReference
;
using
css
::
sheet
::
DataPilotFieldReference
;
using
::
std
::
vector
;
using
std
::
vector
;
namespace
{
namespace
{
bool
equals
(
const
DataPilotFieldReference
&
left
,
const
DataPilotFieldReference
&
right
)
bool
equals
(
const
DataPilotFieldReference
&
left
,
const
DataPilotFieldReference
&
right
)
{
{
...
@@ -56,20 +57,23 @@ bool equals(const DataPilotFieldReference& left, const DataPilotFieldReference&
...
@@ -56,20 +57,23 @@ bool equals(const DataPilotFieldReference& left, const DataPilotFieldReference&
&&
(
left
.
ReferenceItemName
==
right
.
ReferenceItemName
);
&&
(
left
.
ReferenceItemName
==
right
.
ReferenceItemName
);
}
}
}
}
// namespace
ScDPName
::
ScDPName
()
:
mnDupCount
(
0
)
{}
// ScDPName
ScDPName
::
ScDPName
(
const
OUString
&
rName
,
const
OUString
&
rLayoutName
,
sal_uInt8
nDupCount
)
:
ScDPName
::
ScDPName
(
)
:
mnDupCount
(
0
)
maName
(
rName
),
maLayoutName
(
rLayoutName
),
mnDupCount
(
nDupCount
)
{}
{}
ScDPName
::
ScDPName
(
const
OUString
&
rName
,
const
OUString
&
rLayoutName
,
sal_uInt8
nDupCount
)
:
maName
(
rName
),
maLayoutName
(
rLayoutName
),
mnDupCount
(
nDupCount
)
{}
// ScDPLabelData
ScDPLabelData
::
Member
::
Member
()
:
ScDPLabelData
::
Member
::
Member
()
:
mbVisible
(
true
),
mbVisible
(
true
),
mbShowDetails
(
true
)
mbShowDetails
(
true
)
{
{}
}
OUString
ScDPLabelData
::
Member
::
getDisplayName
()
const
OUString
ScDPLabelData
::
Member
::
getDisplayName
()
const
{
{
...
@@ -89,8 +93,7 @@ ScDPLabelData::ScDPLabelData() :
...
@@ -89,8 +93,7 @@ ScDPLabelData::ScDPLabelData() :
mbShowAll
(
false
),
mbShowAll
(
false
),
mbIsValue
(
false
),
mbIsValue
(
false
),
mbDataLayout
(
false
)
mbDataLayout
(
false
)
{
{}
}
OUString
ScDPLabelData
::
getDisplayName
()
const
OUString
ScDPLabelData
::
getDisplayName
()
const
{
{
...
@@ -100,20 +103,22 @@ OUString ScDPLabelData::getDisplayName() const
...
@@ -100,20 +103,22 @@ OUString ScDPLabelData::getDisplayName() const
return
maName
;
return
maName
;
}
}
// ScPivotField
ScPivotField
::
ScPivotField
(
SCCOL
nNewCol
,
sal_uInt16
nNewFuncMask
)
:
ScPivotField
::
ScPivotField
(
SCCOL
nNewCol
,
sal_uInt16
nNewFuncMask
)
:
nCol
(
nNewCol
),
nCol
(
nNewCol
),
mnOriginalDim
(
-
1
),
mnOriginalDim
(
-
1
),
nFuncMask
(
nNewFuncMask
),
nFuncMask
(
nNewFuncMask
),
mnDupCount
(
0
)
mnDupCount
(
0
)
{
{}
}
ScPivotField
::
ScPivotField
(
const
ScPivotField
&
r
)
:
ScPivotField
::
ScPivotField
(
const
ScPivotField
&
rPivotField
)
:
nCol
(
r
.
nCol
),
nCol
(
rPivotField
.
nCol
),
mnOriginalDim
(
r
.
mnOriginalDim
),
mnOriginalDim
(
rPivotField
.
mnOriginalDim
),
nFuncMask
(
r
.
nFuncMask
),
nFuncMask
(
rPivotField
.
nFuncMask
),
mnDupCount
(
r
.
mnDupCount
),
mnDupCount
(
rPivotField
.
mnDupCount
),
maFieldRef
(
r
.
maFieldRef
)
{}
maFieldRef
(
rPivotField
.
maFieldRef
)
{}
long
ScPivotField
::
getOriginalDim
()
const
long
ScPivotField
::
getOriginalDim
()
const
{
{
...
@@ -128,12 +133,13 @@ bool ScPivotField::operator==( const ScPivotField& r ) const
...
@@ -128,12 +133,13 @@ bool ScPivotField::operator==( const ScPivotField& r ) const
&&
equals
(
maFieldRef
,
r
.
maFieldRef
);
&&
equals
(
maFieldRef
,
r
.
maFieldRef
);
}
}
ScPivotParam
::
ScPivotParam
()
// ScPivotParam
:
nCol
(
0
),
nRow
(
0
),
nTab
(
0
),
ScPivotParam
::
ScPivotParam
()
:
nCol
(
0
),
nRow
(
0
),
nTab
(
0
),
bIgnoreEmptyRows
(
false
),
bDetectCategories
(
false
),
bIgnoreEmptyRows
(
false
),
bDetectCategories
(
false
),
bMakeTotalCol
(
true
),
bMakeTotalRow
(
true
)
bMakeTotalCol
(
true
),
bMakeTotalRow
(
true
)
{
{}
}
ScPivotParam
::
ScPivotParam
(
const
ScPivotParam
&
r
)
ScPivotParam
::
ScPivotParam
(
const
ScPivotParam
&
r
)
:
nCol
(
r
.
nCol
),
nRow
(
r
.
nRow
),
nTab
(
r
.
nTab
),
:
nCol
(
r
.
nCol
),
nRow
(
r
.
nRow
),
nTab
(
r
.
nTab
),
...
@@ -150,83 +156,84 @@ ScPivotParam::ScPivotParam( const ScPivotParam& r )
...
@@ -150,83 +156,84 @@ ScPivotParam::ScPivotParam( const ScPivotParam& r )
}
}
ScPivotParam
::~
ScPivotParam
()
ScPivotParam
::~
ScPivotParam
()
{
{}
}
void
ScPivotParam
::
SetLabelData
(
const
ScDPLabelDataVector
&
r
)
void
ScPivotParam
::
SetLabelData
(
const
ScDPLabelDataVector
&
r
Vector
)
{
{
ScDPLabelDataVector
aNewArray
;
ScDPLabelDataVector
aNewArray
;
aNewArray
.
reserve
(
r
.
size
());
aNewArray
.
reserve
(
rVector
.
size
());
for
(
ScDPLabelDataVector
::
const_iterator
itr
=
r
.
begin
(),
itrEnd
=
r
.
end
();
ScDPLabelDataVector
::
const_iterator
it
;
itr
!=
itrEnd
;
++
itr
)
for
(
it
=
rVector
.
begin
();
it
!=
rVector
.
end
();
++
it
)
aNewArray
.
push_back
(
new
ScDPLabelData
(
*
itr
));
{
aNewArray
.
push_back
(
new
ScDPLabelData
(
*
it
));
}
maLabelArray
.
swap
(
aNewArray
);
maLabelArray
.
swap
(
aNewArray
);
}
}
ScPivotParam
&
ScPivotParam
::
operator
=
(
const
ScPivotParam
&
r
)
ScPivotParam
&
ScPivotParam
::
operator
=
(
const
ScPivotParam
&
r
PivotParam
)
{
{
nCol
=
r
.
nCol
;
nCol
=
rPivotParam
.
nCol
;
nRow
=
r
.
nRow
;
nRow
=
rPivotParam
.
nRow
;
nTab
=
r
.
nTab
;
nTab
=
rPivotParam
.
nTab
;
bIgnoreEmptyRows
=
r
.
bIgnoreEmptyRows
;
bIgnoreEmptyRows
=
rPivotParam
.
bIgnoreEmptyRows
;
bDetectCategories
=
r
.
bDetectCategories
;
bDetectCategories
=
rPivotParam
.
bDetectCategories
;
bMakeTotalCol
=
r
.
bMakeTotalCol
;
bMakeTotalCol
=
rPivotParam
.
bMakeTotalCol
;
bMakeTotalRow
=
r
.
bMakeTotalRow
;
bMakeTotalRow
=
rPivotParam
.
bMakeTotalRow
;
maPageFields
=
r
.
maPageFields
;
maPageFields
=
rPivotParam
.
maPageFields
;
maColFields
=
r
.
maColFields
;
maColFields
=
rPivotParam
.
maColFields
;
maRowFields
=
r
.
maRowFields
;
maRowFields
=
rPivotParam
.
maRowFields
;
maDataFields
=
r
.
maDataFields
;
maDataFields
=
rPivotParam
.
maDataFields
;
SetLabelData
(
r
.
maLabelArray
);
SetLabelData
(
rPivotParam
.
maLabelArray
);
return
*
this
;
return
*
this
;
}
}
bool
ScPivotParam
::
operator
==
(
const
ScPivotParam
&
r
)
const
bool
ScPivotParam
::
operator
==
(
const
ScPivotParam
&
rPivotParam
)
const
{
{
bool
bEqual
=
(
nCol
==
r
.
nCol
)
bool
bEqual
=
(
nCol
==
rPivotParam
.
nCol
&&
&&
(
nRow
==
r
.
nRow
)
nRow
==
rPivotParam
.
nRow
&&
&&
(
nTab
==
r
.
nTab
)
nTab
==
rPivotParam
.
nTab
&&
&&
(
bIgnoreEmptyRows
==
r
.
bIgnoreEmptyRows
)
bIgnoreEmptyRows
==
rPivotParam
.
bIgnoreEmptyRows
&&
&&
(
bDetectCategories
==
r
.
bDetectCategories
)
bDetectCategories
==
rPivotParam
.
bDetectCategories
&&
&&
(
bMakeTotalCol
==
r
.
bMakeTotalCol
)
bMakeTotalCol
==
rPivotParam
.
bMakeTotalCol
&&
&&
(
bMakeTotalRow
==
r
.
bMakeTotalRow
)
bMakeTotalRow
==
rPivotParam
.
bMakeTotalRow
&&
&&
(
maLabelArray
.
size
()
==
r
.
maLabelArray
.
size
())
maLabelArray
.
size
()
==
rPivotParam
.
maLabelArray
.
size
()
&&
&&
maPageFields
==
r
.
maPageFields
maPageFields
==
rPivotParam
.
maPageFields
&&
&&
maColFields
==
r
.
maColFields
maColFields
==
rPivotParam
.
maColFields
&&
&&
maRowFields
==
r
.
maRowFields
maRowFields
==
rPivotParam
.
maRowFields
&&
&&
maDataFields
==
r
.
maDataFields
;
maDataFields
==
rPivotParam
.
maDataFields
);
return
bEqual
;
return
bEqual
;
}
}
// ScPivotFuncData
ScPivotFuncData
::
ScPivotFuncData
(
SCCOL
nCol
,
sal_uInt16
nFuncMask
)
:
ScPivotFuncData
::
ScPivotFuncData
(
SCCOL
nCol
,
sal_uInt16
nFuncMask
)
:
mnCol
(
nCol
),
mnCol
(
nCol
),
mnOriginalDim
(
-
1
),
mnOriginalDim
(
-
1
),
mnFuncMask
(
nFuncMask
),
mnFuncMask
(
nFuncMask
),
mnDupCount
(
0
)
mnDupCount
(
0
)
{
{}
}
ScPivotFuncData
::
ScPivotFuncData
(
ScPivotFuncData
::
ScPivotFuncData
(
SCCOL
nCol
,
long
nOriginalDim
,
sal_uInt16
nFuncMask
,
SCCOL
nCol
,
long
nOriginalDim
,
sal_uInt16
nFuncMask
,
sal_uInt8
nDupCount
,
sal_uInt8
nDupCount
,
const
DataPilotFieldReference
&
rFieldRef
)
:
const
DataPilotFieldReference
&
rFieldRef
)
:
mnCol
(
nCol
),
mnCol
(
nCol
),
mnOriginalDim
(
nOriginalDim
),
mnOriginalDim
(
nOriginalDim
),
mnFuncMask
(
nFuncMask
),
mnFuncMask
(
nFuncMask
),
mnDupCount
(
nDupCount
),
mnDupCount
(
nDupCount
),
maFieldRef
(
rFieldRef
)
maFieldRef
(
rFieldRef
)
{
{}
}
bool
ScPivotFuncData
::
operator
==
(
const
ScPivotFuncData
&
r
)
const
bool
ScPivotFuncData
::
operator
==
(
const
ScPivotFuncData
&
r
FuncData
)
const
{
{
if
(
mnCol
!=
r
.
mnCol
||
mnOriginalDim
!=
r
.
mnOriginalDim
||
mnFuncMask
!=
r
.
mnFuncMask
||
mnDupCount
!=
r
.
mnDupCount
)
if
(
mnCol
!=
rFuncData
.
mnCol
||
mnOriginalDim
!=
rFuncData
.
mnOriginalDim
||
mnFuncMask
!=
rFuncData
.
mnFuncMask
||
mnDupCount
!=
rFuncData
.
mnDupCount
)
{
return
false
;
return
false
;
}
return
equals
(
maFieldRef
,
r
.
maFieldRef
);
return
equals
(
maFieldRef
,
r
FuncData
.
maFieldRef
);
}
}
#if DEBUG_PIVOT_TABLE
#if DEBUG_PIVOT_TABLE
...
@@ -238,6 +245,4 @@ void ScPivotFuncData::Dump() const
...
@@ -238,6 +245,4 @@ void ScPivotFuncData::Dump() const
}
}
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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