summaryrefslogtreecommitdiff
path: root/sc/source/filter/xml
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2010-06-07 19:26:06 +0200
committerNiklas Nebel <nn@openoffice.org>2010-06-07 19:26:06 +0200
commit3de4d76f48fcde2915c94ba6a3541eb6cff69332 (patch)
treeecf9846040d0a27920a24c918e340264c328089c /sc/source/filter/xml
parentba5ea750b1c821f7f2edc14061334d44d86bb8e1 (diff)
#i94570# keep DataPilot table names unique, get document from DocShell in RefreshDPObject
Diffstat (limited to 'sc/source/filter/xml')
-rw-r--r--sc/source/filter/xml/xmldpimp.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx
index 93e529c4ceca..ba107347b46a 100644
--- a/sc/source/filter/xml/xmldpimp.cxx
+++ b/sc/source/filter/xml/xmldpimp.cxx
@@ -464,6 +464,11 @@ void ScXMLDataPilotTableContext::EndElement()
if (pDoc)
{
ScDPCollection* pDPCollection = pDoc->GetDPCollection();
+
+ // #i94570# Names have to be unique, or the tables can't be accessed by API.
+ if ( pDPCollection->GetByName(pDPObject->GetName()) )
+ pDPObject->SetName( String() ); // ignore the invalid name, create a new name in AfterXMLLoading
+
pDPObject->SetAlive(sal_True);
pDPCollection->InsertNewTable(pDPObject);
}