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
057d4db9
Kaydet (Commit)
057d4db9
authored
Şub 18, 2012
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Properly transfer layout and subtotal names before and after the dialog.
üst
b6ddd700
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
68 additions
and
49 deletions
+68
-49
dpobject.hxx
sc/inc/dpobject.hxx
+9
-7
dpsave.hxx
sc/inc/dpsave.hxx
+1
-0
pivot.hxx
sc/inc/pivot.hxx
+6
-4
dpobject.cxx
sc/source/core/data/dpobject.cxx
+34
-14
dpsave.cxx
sc/source/core/data/dpsave.cxx
+9
-2
pivot2.cxx
sc/source/core/data/pivot2.cxx
+2
-1
pvlaydlg.cxx
sc/source/ui/dbgui/pvlaydlg.cxx
+7
-21
No files found.
sc/inc/dpobject.hxx
Dosyayı görüntüle @
057d4db9
...
@@ -238,13 +238,15 @@ public:
...
@@ -238,13 +238,15 @@ public:
static
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
sheet
::
XDimensionsSupplier
>
static
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
sheet
::
XDimensionsSupplier
>
CreateSource
(
const
ScDPServiceDesc
&
rDesc
);
CreateSource
(
const
ScDPServiceDesc
&
rDesc
);
static
void
ConvertOrientation
(
ScDPSaveData
&
rSaveData
,
static
void
ConvertOrientation
(
const
::
std
::
vector
<
PivotField
>&
rFields
,
sal_uInt16
nOrient
,
ScDPSaveData
&
rSaveData
,
const
com
::
sun
::
star
::
uno
::
Reference
<
const
::
std
::
vector
<
PivotField
>&
rFields
,
sal_uInt16
nOrient
,
com
::
sun
::
star
::
sheet
::
XDimensionsSupplier
>&
xSource
,
const
com
::
sun
::
star
::
uno
::
Reference
<
::
std
::
vector
<
PivotField
>*
pRefColFields
=
NULL
,
com
::
sun
::
star
::
sheet
::
XDimensionsSupplier
>&
xSource
,
::
std
::
vector
<
PivotField
>*
pRefRowFields
=
NULL
,
const
ScDPLabelDataVec
&
rLabels
,
::
std
::
vector
<
PivotField
>*
pRefPageFields
=
NULL
);
std
::
vector
<
PivotField
>*
pRefColFields
=
NULL
,
std
::
vector
<
PivotField
>*
pRefRowFields
=
NULL
,
std
::
vector
<
PivotField
>*
pRefPageFields
=
NULL
);
static
bool
IsOrientationAllowed
(
sal_uInt16
nOrient
,
sal_Int32
nDimFlags
);
static
bool
IsOrientationAllowed
(
sal_uInt16
nOrient
,
sal_Int32
nDimFlags
);
};
};
...
...
sc/inc/dpsave.hxx
Dosyayı görüntüle @
057d4db9
...
@@ -181,6 +181,7 @@ public:
...
@@ -181,6 +181,7 @@ public:
void
RemoveLayoutName
();
void
RemoveLayoutName
();
void
SetSubtotalName
(
const
::
rtl
::
OUString
&
rName
);
void
SetSubtotalName
(
const
::
rtl
::
OUString
&
rName
);
const
::
rtl
::
OUString
*
GetSubtotalName
()
const
;
const
::
rtl
::
OUString
*
GetSubtotalName
()
const
;
void
RemoveSubtotalName
();
bool
IsMemberNameInUse
(
const
::
rtl
::
OUString
&
rName
)
const
;
bool
IsMemberNameInUse
(
const
::
rtl
::
OUString
&
rName
)
const
;
...
...
sc/inc/pivot.hxx
Dosyayı görüntüle @
057d4db9
...
@@ -128,15 +128,17 @@ struct ScDPName
...
@@ -128,15 +128,17 @@ struct ScDPName
struct
ScDPLabelData
struct
ScDPLabelData
{
{
::
rtl
::
OUString
maName
;
/// Original name of the dimension.
rtl
::
OUString
maName
;
/// Original name of the dimension.
::
rtl
::
OUString
maLayoutName
;
/// Layout name (display name)
rtl
::
OUString
maLayoutName
;
/// Layout name (display name)
rtl
::
OUString
maSubtotalName
;
SCCOL
mnCol
;
/// 0-based field index (not the source column index)
SCCOL
mnCol
;
/// 0-based field index (not the source column index)
long
mnOriginalDim
;
/// original dimension index (>= 0 for duplicated dimension)
long
mnOriginalDim
;
/// original dimension index (>= 0 for duplicated dimension)
sal_uInt16
mnFuncMask
;
/// Page/Column/Row subtotal function.
sal_uInt16
mnFuncMask
;
/// Page/Column/Row subtotal function.
sal_Int32
mnUsedHier
;
/// Used hierarchy.
sal_Int32
mnUsedHier
;
/// Used hierarchy.
sal_Int32
mnFlags
;
/// Flags from the DataPilotSource dimension
sal_Int32
mnFlags
;
/// Flags from the DataPilotSource dimension
bool
mbShowAll
;
/// true = Show all (also empty) results.
bool
mbShowAll
:
1
;
/// true = Show all (also empty) results.
bool
mbIsValue
;
/// true = Sum or count in data field.
bool
mbIsValue
:
1
;
/// true = Sum or count in data field.
bool
mbDataLayout
:
1
;
struct
Member
struct
Member
{
{
...
...
sc/source/core/data/dpobject.cxx
Dosyayı görüntüle @
057d4db9
...
@@ -2014,21 +2014,27 @@ bool ScDPObject::FillLabelData(ScPivotParam& rParam)
...
@@ -2014,21 +2014,27 @@ bool ScDPObject::FillLabelData(ScPivotParam& rParam)
OUString
aLayoutName
=
ScUnoHelpFunctions
::
GetStringProperty
(
OUString
aLayoutName
=
ScUnoHelpFunctions
::
GetStringProperty
(
xDimProp
,
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
SC_UNO_DP_LAYOUTNAME
)),
OUString
());
xDimProp
,
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
SC_UNO_DP_LAYOUTNAME
)),
OUString
());
if
(
aFieldName
.
isEmpty
()
||
bData
)
OUString
aSubtotalName
=
ScUnoHelpFunctions
::
GetStringProperty
(
continue
;
xDimProp
,
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
SC_UNO_DP_FIELD_SUBTOTALNAME
)),
OUString
())
;
bool
bIsValue
=
true
;
//! check
bool
bIsValue
=
true
;
//! check
aFieldName
=
comphelper
::
string
::
stripEnd
(
aFieldName
,
sal_Unicode
(
'*'
));
aFieldName
=
comphelper
::
string
::
stripEnd
(
aFieldName
,
sal_Unicode
(
'*'
));
std
::
auto_ptr
<
ScDPLabelData
>
pNewLabel
(
std
::
auto_ptr
<
ScDPLabelData
>
pNewLabel
(
new
ScDPLabelData
(
aFieldName
,
static_cast
<
SCCOL
>
(
nDim
),
bIsValue
));
new
ScDPLabelData
(
aFieldName
,
static_cast
<
SCCOL
>
(
nDim
),
bIsValue
));
pNewLabel
->
mnOriginalDim
=
static_cast
<
long
>
(
nOrigPos
);
pNewLabel
->
mbDataLayout
=
bData
;
pNewLabel
->
maLayoutName
=
aLayoutName
;
GetHierarchies
(
nDim
,
pNewLabel
->
maHiers
);
if
(
!
bData
)
GetMembers
(
nDim
,
GetUsedHierarchy
(
nDim
),
pNewLabel
->
maMembers
);
{
lcl_FillLabelData
(
*
pNewLabel
,
xDimProp
);
pNewLabel
->
mnOriginalDim
=
static_cast
<
long
>
(
nOrigPos
);
pNewLabel
->
mnFlags
=
ScUnoHelpFunctions
::
GetLongProperty
(
xDimProp
,
pNewLabel
->
maLayoutName
=
aLayoutName
;
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
SC_UNO_DP_FLAGS
)),
0
);
pNewLabel
->
maSubtotalName
=
aSubtotalName
;
GetHierarchies
(
nDim
,
pNewLabel
->
maHiers
);
GetMembers
(
nDim
,
GetUsedHierarchy
(
nDim
),
pNewLabel
->
maMembers
);
lcl_FillLabelData
(
*
pNewLabel
,
xDimProp
);
pNewLabel
->
mnFlags
=
ScUnoHelpFunctions
::
GetLongProperty
(
xDimProp
,
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
SC_UNO_DP_FLAGS
)),
0
);
}
rParam
.
maLabelArray
.
push_back
(
pNewLabel
);
rParam
.
maLabelArray
.
push_back
(
pNewLabel
);
}
}
...
@@ -2179,6 +2185,7 @@ public:
...
@@ -2179,6 +2185,7 @@ public:
void
ScDPObject
::
ConvertOrientation
(
void
ScDPObject
::
ConvertOrientation
(
ScDPSaveData
&
rSaveData
,
const
vector
<
PivotField
>&
rFields
,
sal_uInt16
nOrient
,
ScDPSaveData
&
rSaveData
,
const
vector
<
PivotField
>&
rFields
,
sal_uInt16
nOrient
,
const
Reference
<
XDimensionsSupplier
>&
xSource
,
const
Reference
<
XDimensionsSupplier
>&
xSource
,
const
ScDPLabelDataVec
&
rLabels
,
vector
<
PivotField
>*
pRefColFields
,
vector
<
PivotField
>*
pRefRowFields
,
vector
<
PivotField
>*
pRefPageFields
)
vector
<
PivotField
>*
pRefColFields
,
vector
<
PivotField
>*
pRefRowFields
,
vector
<
PivotField
>*
pRefPageFields
)
{
{
// xSource must be set
// xSource must be set
...
@@ -2232,14 +2239,15 @@ void ScDPObject::ConvertOrientation(
...
@@ -2232,14 +2239,15 @@ void ScDPObject::ConvertOrientation(
}
}
sheet
::
GeneralFunction
eFunc
=
ScDataPilotConversion
::
FirstFunc
(
rField
.
nFuncMask
);
sheet
::
GeneralFunction
eFunc
=
ScDataPilotConversion
::
FirstFunc
(
rField
.
nFuncMask
);
ScDPSaveDimension
*
pCurrDim
=
bFirst
?
pDim
:
rSaveData
.
DuplicateDimension
(
pDim
->
GetName
());
if
(
!
bFirst
)
pCurrDim
->
SetOrientation
(
nOrient
);
pDim
=
rSaveData
.
DuplicateDimension
(
pDim
->
GetName
());
pCurrDim
->
SetFunction
(
sal
::
static_int_cast
<
sal_uInt16
>
(
eFunc
));
pDim
->
SetOrientation
(
nOrient
);
pDim
->
SetFunction
(
sal
::
static_int_cast
<
sal_uInt16
>
(
eFunc
));
if
(
rFieldRef
.
ReferenceType
==
sheet
::
DataPilotFieldReferenceType
::
NONE
)
if
(
rFieldRef
.
ReferenceType
==
sheet
::
DataPilotFieldReferenceType
::
NONE
)
p
CurrDim
->
SetReferenceValue
(
0
);
p
Dim
->
SetReferenceValue
(
0
);
else
else
p
CurrDim
->
SetReferenceValue
(
&
rFieldRef
);
p
Dim
->
SetReferenceValue
(
&
rFieldRef
);
}
}
else
// set SubTotals
else
// set SubTotals
{
{
...
@@ -2261,6 +2269,18 @@ void ScDPObject::ConvertOrientation(
...
@@ -2261,6 +2269,18 @@ void ScDPObject::ConvertOrientation(
if
(
nCol
==
PIVOT_DATA_FIELD
)
if
(
nCol
==
PIVOT_DATA_FIELD
)
pDim
->
SetShowEmpty
(
true
);
pDim
->
SetShowEmpty
(
true
);
}
}
size_t
nDimIndex
=
rField
.
nCol
;
pDim
->
RemoveLayoutName
();
pDim
->
RemoveSubtotalName
();
if
(
nDimIndex
<
rLabels
.
size
())
{
const
ScDPLabelData
&
rLabel
=
rLabels
[
nDimIndex
];
if
(
!
rLabel
.
maLayoutName
.
isEmpty
())
pDim
->
SetLayoutName
(
rLabel
.
maLayoutName
);
if
(
!
rLabel
.
maSubtotalName
.
isEmpty
())
pDim
->
SetSubtotalName
(
rLabel
.
maSubtotalName
);
}
}
}
}
}
...
...
sc/source/core/data/dpsave.cxx
Dosyayı görüntüle @
057d4db9
...
@@ -422,6 +422,11 @@ const OUString* ScDPSaveDimension::GetSubtotalName() const
...
@@ -422,6 +422,11 @@ const OUString* ScDPSaveDimension::GetSubtotalName() const
return
mpSubtotalName
.
get
();
return
mpSubtotalName
.
get
();
}
}
void
ScDPSaveDimension
::
RemoveSubtotalName
()
{
mpSubtotalName
.
reset
();
}
bool
ScDPSaveDimension
::
IsMemberNameInUse
(
const
OUString
&
rName
)
const
bool
ScDPSaveDimension
::
IsMemberNameInUse
(
const
OUString
&
rName
)
const
{
{
MemberList
::
const_iterator
itr
=
maMemberList
.
begin
(),
itrEnd
=
maMemberList
.
end
();
MemberList
::
const_iterator
itr
=
maMemberList
.
begin
(),
itrEnd
=
maMemberList
.
end
();
...
@@ -904,9 +909,11 @@ ScDPSaveDimension* ScDPSaveData::GetExistingDataLayoutDimension() const
...
@@ -904,9 +909,11 @@ ScDPSaveDimension* ScDPSaveData::GetExistingDataLayoutDimension() const
ScDPSaveDimension
*
ScDPSaveData
::
DuplicateDimension
(
const
::
rtl
::
OUString
&
rName
)
ScDPSaveDimension
*
ScDPSaveData
::
DuplicateDimension
(
const
::
rtl
::
OUString
&
rName
)
{
{
// always insert new
// always insert new
//! check if dimension is there?
ScDPSaveDimension
*
pOld
=
GetDimensionByName
(
rName
);
ScDPSaveDimension
*
pOld
=
GetExistingDimensionByName
(
rName
);
if
(
!
pOld
)
return
NULL
;
ScDPSaveDimension
*
pNew
=
new
ScDPSaveDimension
(
*
pOld
);
ScDPSaveDimension
*
pNew
=
new
ScDPSaveDimension
(
*
pOld
);
pNew
->
SetDupFlag
(
true
);
pNew
->
SetDupFlag
(
true
);
aDimList
.
push_back
(
pNew
);
aDimList
.
push_back
(
pNew
);
...
...
sc/source/core/data/pivot2.cxx
Dosyayı görüntüle @
057d4db9
...
@@ -100,7 +100,8 @@ ScDPLabelData::ScDPLabelData(const rtl::OUString& rName, SCCOL nCol, bool bIsVal
...
@@ -100,7 +100,8 @@ ScDPLabelData::ScDPLabelData(const rtl::OUString& rName, SCCOL nCol, bool bIsVal
mnUsedHier
(
0
),
mnUsedHier
(
0
),
mnFlags
(
0
),
mnFlags
(
0
),
mbShowAll
(
false
),
mbShowAll
(
false
),
mbIsValue
(
bIsValue
)
mbIsValue
(
bIsValue
),
mbDataLayout
(
false
)
{
{
}
}
...
...
sc/source/ui/dbgui/pvlaydlg.cxx
Dosyayı görüntüle @
057d4db9
...
@@ -357,7 +357,7 @@ void ScDPLayoutDlg::InitWndSelect(const ScDPLabelDataVec& rLabels)
...
@@ -357,7 +357,7 @@ void ScDPLayoutDlg::InitWndSelect(const ScDPLabelDataVec& rLabels)
const
ScDPLabelData
&
r
=
rLabels
[
i
];
const
ScDPLabelData
&
r
=
rLabels
[
i
];
aLabelDataArr
.
push_back
(
new
ScDPLabelData
(
r
));
aLabelDataArr
.
push_back
(
new
ScDPLabelData
(
r
));
if
(
r
.
mnOriginalDim
<
0
)
if
(
r
.
mnOriginalDim
<
0
&&
!
r
.
mbDataLayout
)
{
{
// TODO: For dimension with duplicates, use layout name only when
// TODO: For dimension with duplicates, use layout name only when
// all its duplicate dimensions use the same layout name.
// all its duplicate dimensions use the same layout name.
...
@@ -1452,7 +1452,7 @@ bool ScDPLayoutDlg::GetPivotArrays(
...
@@ -1452,7 +1452,7 @@ bool ScDPLayoutDlg::GetPivotArrays(
for_each
(
aPageArr
.
begin
(),
aPageArr
.
end
(),
PivotFieldInserter
(
aPageFields
,
aPageArr
.
size
()));
for_each
(
aPageArr
.
begin
(),
aPageArr
.
end
(),
PivotFieldInserter
(
aPageFields
,
aPageArr
.
size
()));
vector
<
PivotField
>
aColFields
;
vector
<
PivotField
>
aColFields
;
for_each
(
aColArr
.
begin
(),
aColArr
.
end
(),
PivotFieldInserter
(
aColFields
,
aColArr
.
size
()));
for_each
(
aColArr
.
begin
(),
aColArr
.
end
(),
PivotFieldInserter
(
aColFields
,
aColArr
.
size
()
+
1
));
vector
<
PivotField
>
aRowFields
;
vector
<
PivotField
>
aRowFields
;
for_each
(
aRowArr
.
begin
(),
aRowArr
.
end
(),
PivotFieldInserter
(
aRowFields
,
aRowArr
.
size
()
+
1
));
for_each
(
aRowArr
.
begin
(),
aRowArr
.
end
(),
PivotFieldInserter
(
aRowFields
,
aRowArr
.
size
()
+
1
));
...
@@ -1827,18 +1827,19 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG )
...
@@ -1827,18 +1827,19 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG )
uno
::
Reference
<
sheet
::
XDimensionsSupplier
>
xSource
=
xDlgDPObject
->
GetSource
();
uno
::
Reference
<
sheet
::
XDimensionsSupplier
>
xSource
=
xDlgDPObject
->
GetSource
();
ScDPObject
::
ConvertOrientation
(
ScDPObject
::
ConvertOrientation
(
aSaveData
,
aPageFields
,
sheet
::
DataPilotFieldOrientation_PAGE
,
xSource
);
aSaveData
,
aPageFields
,
sheet
::
DataPilotFieldOrientation_PAGE
,
xSource
,
aLabelDataArr
);
ScDPObject
::
ConvertOrientation
(
ScDPObject
::
ConvertOrientation
(
aSaveData
,
aColFields
,
sheet
::
DataPilotFieldOrientation_COLUMN
,
xSource
);
aSaveData
,
aColFields
,
sheet
::
DataPilotFieldOrientation_COLUMN
,
xSource
,
aLabelDataArr
);
ScDPObject
::
ConvertOrientation
(
ScDPObject
::
ConvertOrientation
(
aSaveData
,
aRowFields
,
sheet
::
DataPilotFieldOrientation_ROW
,
xSource
);
aSaveData
,
aRowFields
,
sheet
::
DataPilotFieldOrientation_ROW
,
xSource
,
aLabelDataArr
);
ScDPObject
::
ConvertOrientation
(
ScDPObject
::
ConvertOrientation
(
aSaveData
,
aDataFields
,
sheet
::
DataPilotFieldOrientation_DATA
,
xSource
,
aSaveData
,
aDataFields
,
sheet
::
DataPilotFieldOrientation_DATA
,
xSource
,
aLabelDataArr
,
&
aColFields
,
&
aRowFields
,
&
aPageFields
);
&
aColFields
,
&
aRowFields
,
&
aPageFields
);
for
(
ScDPLabelDataVec
::
const_iterator
aIt
=
aLabelDataArr
.
begin
(),
aEnd
=
aLabelDataArr
.
end
();
aIt
!=
aEnd
;
++
aIt
)
for
(
ScDPLabelDataVec
::
const_iterator
aIt
=
aLabelDataArr
.
begin
(),
aEnd
=
aLabelDataArr
.
end
();
aIt
!=
aEnd
;
++
aIt
)
{
{
ScDPSaveDimension
*
pDim
=
aSaveData
.
GetExistingDimensionByName
(
aIt
->
maName
);
ScDPSaveDimension
*
pDim
=
aSaveData
.
GetExistingDimensionByName
(
aIt
->
maName
);
if
(
!
pDim
)
if
(
!
pDim
)
continue
;
continue
;
...
@@ -1848,21 +1849,6 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG )
...
@@ -1848,21 +1849,6 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG )
pDim
->
SetLayoutInfo
(
&
aIt
->
maLayoutInfo
);
pDim
->
SetLayoutInfo
(
&
aIt
->
maLayoutInfo
);
pDim
->
SetAutoShowInfo
(
&
aIt
->
maShowInfo
);
pDim
->
SetAutoShowInfo
(
&
aIt
->
maShowInfo
);
ScDPSaveDimension
*
pOldDim
=
NULL
;
ScDPSaveDimension
*
pOldDim
=
NULL
;
if
(
pOldSaveData
)
{
// Transfer the existing layout names to new dimension instance.
pOldDim
=
pOldSaveData
->
GetExistingDimensionByName
(
aIt
->
maName
);
if
(
pOldDim
)
{
const
OUString
*
pLayoutName
=
pOldDim
->
GetLayoutName
();
if
(
pLayoutName
)
pDim
->
SetLayoutName
(
*
pLayoutName
);
const
OUString
*
pSubtotalName
=
pOldDim
->
GetSubtotalName
();
if
(
pSubtotalName
)
pDim
->
SetSubtotalName
(
*
pSubtotalName
);
}
}
bool
bManualSort
=
(
aIt
->
maSortInfo
.
Mode
==
sheet
::
DataPilotFieldSortMode
::
MANUAL
);
bool
bManualSort
=
(
aIt
->
maSortInfo
.
Mode
==
sheet
::
DataPilotFieldSortMode
::
MANUAL
);
...
...
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