[Libreoffice-commits] .: sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Aug 31 10:19:43 PDT 2012
sc/source/filter/xml/XMLExportDataPilot.cxx | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
New commits:
commit fe0ef1b2f13d1c2cc8e4f777911c158390183053
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Fri Aug 31 13:17:51 2012 -0400
Don't export the internal field name suffix '*' to ods.
These '*' suffix is used internally to make duplicate field names
unique. However, we were exporting the raw names (names with the '*'s)
by mistake when saving to ods. We need to stop this ASAP before someone
gets hurt.
Change-Id: Iaff7a6343cf202f5fb9855fb7dfe59b872920e4f
diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx
index 92532d9..191319c 100644
--- a/sc/source/filter/xml/XMLExportDataPilot.cxx
+++ b/sc/source/filter/xml/XMLExportDataPilot.cxx
@@ -46,6 +46,7 @@
#include "dpsdbtab.hxx"
#include "dpdimsave.hxx"
#include "dpgroup.hxx"
+#include "dputil.hxx"
#include "rangeutl.hxx"
#include "queryentry.hxx"
#include <com/sun/star/sheet/DataImportMode.hpp>
@@ -608,8 +609,9 @@ void ScXMLExportDataPilot::WriteGroupDimAttributes(const ScDPSaveGroupDimension*
{
if (pGroupDim)
{
+ OUString aSrcFieldName = ScDPUtil::getSourceDimensionName(pGroupDim->GetSourceDimName());
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_IS_GROUP_FIELD, XML_TRUE);
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SOURCE_FIELD_NAME, pGroupDim->GetSourceDimName());
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SOURCE_FIELD_NAME, aSrcFieldName);
if (pGroupDim->GetDatePart())
{
WriteDatePart(pGroupDim->GetDatePart());
@@ -682,7 +684,8 @@ void ScXMLExportDataPilot::WriteGroupDimElements(ScDPSaveDimension* pDim, const
void ScXMLExportDataPilot::WriteDimension(ScDPSaveDimension* pDim, const ScDPDimensionSaveData* pDimData)
{
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SOURCE_FIELD_NAME, rtl::OUString(pDim->GetName()));
+ OUString aSrcDimName = ScDPUtil::getSourceDimensionName(pDim->GetName());
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SOURCE_FIELD_NAME, aSrcDimName);
if (rExport.getDefaultVersion() > SvtSaveOptions::ODFVER_012)
{
// Export display names only for ODF 1.2 extended or later.
More information about the Libreoffice-commits
mailing list