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
3d62ea9a
Kaydet (Commit)
3d62ea9a
authored
Ock 27, 2012
tarafından
Noel Power
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
import group field group name user captions fdo#45310
üst
50be8ec9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
1 deletion
+46
-1
pivotcachebuffer.hxx
oox/inc/oox/xls/pivotcachebuffer.hxx
+9
-1
pivottablebuffer.hxx
oox/inc/oox/xls/pivottablebuffer.hxx
+1
-0
pivotcachebuffer.cxx
oox/source/xls/pivotcachebuffer.cxx
+23
-0
pivottablebuffer.cxx
oox/source/xls/pivottablebuffer.cxx
+13
-0
No files found.
oox/inc/oox/xls/pivotcachebuffer.hxx
Dosyayı görüntüle @
3d62ea9a
...
...
@@ -49,6 +49,9 @@ class WorksheetHelper;
// ============================================================================
typedef
::
std
::
pair
<
sal_Int32
,
rtl
::
OUString
>
IdCaptionPair
;
typedef
::
std
::
vector
<
IdCaptionPair
>
IdCaptionPairList
;
class
PivotCacheItem
{
public
:
...
...
@@ -103,6 +106,9 @@ public:
inline
bool
isUnused
()
const
{
return
mbUnused
;
}
private
:
friend
class
PivotCacheItemList
;
// #FIXME hack Sets the value of this item to the given string ( and overwrites type if necessary
void
setStringValue
(
const
rtl
::
OUString
&
sName
);
::
com
::
sun
::
star
::
uno
::
Any
maValue
;
/// Value of the item.
sal_Int32
mnType
;
/// Value type (OOXML token identifier).
bool
mbUnused
;
...
...
@@ -131,6 +137,7 @@ public:
const
PivotCacheItem
*
getCacheItem
(
sal_Int32
nItemIdx
)
const
;
/** Returns the names of all items. */
void
getCacheItemNames
(
::
std
::
vector
<
::
rtl
::
OUString
>&
orItemNames
)
const
;
void
applyItemCaptions
(
const
IdCaptionPairList
&
vCaptions
);
private
:
/** Creates and returns a new item at the end of the items list. */
...
...
@@ -262,6 +269,8 @@ public:
void
importPCDFRangePr
(
BiffInputStream
&
rStrm
);
/** Imports the mapping between group items and base items from the PCDFDISCRETEPR record. */
void
importPCDFDiscretePr
(
BiffInputStream
&
rStrm
);
/** Apply user Captions to imported group data */
void
applyItemCaptions
(
const
IdCaptionPairList
&
vCaptions
);
/** Returns true, if the field is based on source data, or false if it is grouped or calculated. */
inline
bool
isDatabaseField
()
const
{
return
maFieldModel
.
mbDatabaseField
;
}
...
...
@@ -318,7 +327,6 @@ public:
void
importPCItemIndex
(
BiffInputStream
&
rStrm
,
WorksheetHelper
&
rSheetHelper
,
sal_Int32
nCol
,
sal_Int32
nRow
)
const
;
private
:
/** Tries to write the passed value to the passed sheet position. */
void
writeItemToSourceDataCell
(
WorksheetHelper
&
rSheetHelper
,
...
...
oox/inc/oox/xls/pivottablebuffer.hxx
Dosyayı görüntüle @
3d62ea9a
...
...
@@ -49,6 +49,7 @@ struct PTFieldItemModel
{
sal_Int32
mnCacheItem
;
/// Index to shared item in pivot cache.
sal_Int32
mnType
;
/// Type of the item.
rtl
::
OUString
msCaption
;
/// User caption of the item
bool
mbShowDetails
;
/// True = show item details (items of child fields).
bool
mbHidden
;
/// True = item is hidden.
...
...
oox/source/xls/pivotcachebuffer.cxx
Dosyayı görüntüle @
3d62ea9a
...
...
@@ -302,6 +302,12 @@ void PivotCacheItem::readError( BiffInputStream& rStrm )
mnType
=
XML_e
;
}
void
PivotCacheItem
::
setStringValue
(
const
OUString
&
sString
)
{
mnType
=
XML_s
;
maValue
<<=
sString
;
}
OUString
PivotCacheItem
::
getName
()
const
{
switch
(
mnType
)
...
...
@@ -393,6 +399,15 @@ const PivotCacheItem* PivotCacheItemList::getCacheItem( sal_Int32 nItemIdx ) con
return
ContainerHelper
::
getVectorElement
(
maItems
,
nItemIdx
);
}
void
PivotCacheItemList
::
applyItemCaptions
(
const
IdCaptionPairList
&
vCaptions
)
{
for
(
IdCaptionPairList
::
const_iterator
aIt
=
vCaptions
.
begin
(),
aEnd
=
vCaptions
.
end
();
aIt
!=
aEnd
;
++
aIt
)
{
if
(
static_cast
<
sal_uInt32
>
(
aIt
->
first
)
<
maItems
.
size
()
)
maItems
[
aIt
->
first
].
setStringValue
(
aIt
->
second
);
}
}
void
PivotCacheItemList
::
getCacheItemNames
(
::
std
::
vector
<
OUString
>&
orItemNames
)
const
{
orItemNames
.
clear
();
...
...
@@ -753,6 +768,14 @@ const PivotCacheItem* PivotCacheField::getCacheItem( sal_Int32 nItemIdx ) const
return
0
;
}
void
PivotCacheField
::
applyItemCaptions
(
const
IdCaptionPairList
&
vCaptions
)
{
if
(
hasGroupItems
()
)
maGroupItems
.
applyItemCaptions
(
vCaptions
);
if
(
hasSharedItems
()
)
maSharedItems
.
applyItemCaptions
(
vCaptions
);
}
void
PivotCacheField
::
getCacheItemNames
(
::
std
::
vector
<
OUString
>&
orItemNames
)
const
{
if
(
hasGroupItems
()
)
...
...
oox/source/xls/pivottablebuffer.cxx
Dosyayı görüntüle @
3d62ea9a
...
...
@@ -370,6 +370,7 @@ void PivotTableField::importItem( const AttributeList& rAttribs )
aModel
.
mnType
=
rAttribs
.
getToken
(
XML_t
,
XML_data
);
aModel
.
mbShowDetails
=
rAttribs
.
getBool
(
XML_sd
,
true
);
aModel
.
mbHidden
=
rAttribs
.
getBool
(
XML_h
,
false
);
aModel
.
msCaption
=
rAttribs
.
getXString
(
XML_n
,
OUString
()
);
maItems
.
push_back
(
aModel
);
}
...
...
@@ -548,6 +549,7 @@ void PivotTableField::finalizeImport( const Reference< XDataPilotDescriptor >& r
}
else
if
(
pCacheField
->
hasParentGrouping
()
)
{
// create a list of all item names, needed to map between original and group items
::
std
::
vector
<
OUString
>
aItems
;
pCacheField
->
getCacheItemNames
(
aItems
);
...
...
@@ -585,6 +587,17 @@ void PivotTableField::finalizeParentGroupingImport( const Reference< XDataPilotF
{
if
(
const
PivotCacheField
*
pCacheField
=
mrPivotTable
.
getCacheField
(
mnFieldIndex
)
)
{
// data field can have user defined groupname captions, apply them
// if they do
IdCaptionPairList
captionList
;
for
(
ItemModelVector
::
iterator
aIt
=
maItems
.
begin
(),
aEnd
=
maItems
.
end
();
aIt
!=
aEnd
;
++
aIt
)
{
if
(
aIt
->
mnType
==
XML_data
&&
aIt
->
msCaption
.
getLength
()
)
captionList
.
push_back
(
IdCaptionPair
(
aIt
->
mnCacheItem
,
aIt
->
msCaption
)
);
}
// #FIXME find another way out of this const nightmare prison
if
(
!
captionList
.
empty
()
)
const_cast
<
PivotCacheField
*>
(
pCacheField
)
->
applyItemCaptions
(
captionList
);
maDPFieldName
=
pCacheField
->
createParentGroupField
(
rxBaseDPField
,
rBaseCacheField
,
orItemNames
);
// on success, try to create nested group fields
Reference
<
XDataPilotField
>
xDPField
=
mrPivotTable
.
getDataPilotField
(
maDPFieldName
);
...
...
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