summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/xml/xmldpimp.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx
index 1b9260be627e..83f58f7b9e56 100644
--- a/sc/source/filter/xml/xmldpimp.cxx
+++ b/sc/source/filter/xml/xmldpimp.cxx
@@ -541,16 +541,14 @@ void ScXMLDataPilotTableContext::EndElement()
if (pDPDimSaveData)
pDPSave->SetDimensionData(pDPDimSaveData);
pDPObject->SetSaveData(*pDPSave);
- 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
+ ScDPCollection* pDPCollection = pDoc->GetDPCollection();
- pDPCollection->InsertNewTable(pDPObject);
- }
+ // #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
+
+ pDPCollection->InsertNewTable(pDPObject);
SetButtons();
}