diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-10-18 15:02:36 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-10-21 21:59:14 +0200 |
commit | 760a684155ba4b41a1db56d85374575a20abd375 (patch) | |
tree | 6fdd22a2cce466de2d54fef415b3e783e270bd37 /sc/source | |
parent | 968e2faff6d4283dacd9010d31cb4c0df45eb7c5 (diff) |
make our pivot table export a bit better
Change-Id: I62fe627eab0163715fc90d17a9b8992bc17682b9
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/filter/excel/xepivotxml.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx index d3bd613aa831..917af8d95c7d 100644 --- a/sc/source/filter/excel/xepivotxml.cxx +++ b/sc/source/filter/excel/xepivotxml.cxx @@ -228,11 +228,25 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( XclExpXmlStream& rStrm, const Entr const ScDPCache::ItemsType& rFieldItems = rCache.GetDimMemberValues(i); + ScDPCache::ItemsType::const_iterator it = rFieldItems.begin(), itEnd = rFieldItems.end(); + + std::set<ScDPItemData::Type> aDPTypes; + for (; it != itEnd; ++it) + { + aDPTypes.insert(it->GetType()); + } + + auto aDPTypeEnd = aDPTypes.cend(); + pDefStrm->startElement(XML_sharedItems, XML_count, OString::number(static_cast<long>(rFieldItems.size())).getStr(), + XML_containsMixedTypes, XclXmlUtils::ToPsz10(aDPTypes.size() > 1), + XML_containsSemiMixedTypes, XclXmlUtils::ToPsz10(aDPTypes.size() > 1), + XML_containsString, XclXmlUtils::ToPsz10(aDPTypes.find(ScDPItemData::String) != aDPTypeEnd), + XML_containsNumber, XclXmlUtils::ToPsz10(aDPTypes.find(ScDPItemData::Value) != aDPTypeEnd), FSEND); - ScDPCache::ItemsType::const_iterator it = rFieldItems.begin(), itEnd = rFieldItems.end(); + it = rFieldItems.begin(); for (; it != itEnd; ++it) { const ScDPItemData& rItem = *it; |