diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-07-26 13:45:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-07-27 09:26:52 +0200 |
commit | e41b7bc4cc2376b8fafeab0ef8fed388b0b9d7ae (patch) | |
tree | 0304cc5ac7755afaccecf870a55c6e67c556e67e /sc | |
parent | 3ff27fbcc23f4f076a9ca5edd25eebce9dbe24af (diff) |
ScDPObject is only needed in endFastElement
Change-Id: I8e1a7897777111c225e42ebcf81e67face6b29b9
Reviewed-on: https://gerrit.libreoffice.org/58114
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/xmldpimp.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/xml/xmldpimp.hxx | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx index ecfae1ab28a2..f1c1e96bf309 100644 --- a/sc/source/filter/xml/xmldpimp.cxx +++ b/sc/source/filter/xml/xmldpimp.cxx @@ -96,7 +96,6 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport, const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList ) : ScXMLImportContext( rImport ), pDoc(GetScImport().GetDocument()), - pDPObject(new ScDPObject(pDoc)), pDPSave(new ScDPSaveData()), pDPDimSaveData(nullptr), sDataPilotTableName(), @@ -320,7 +319,7 @@ ScDPOutputGeometry::FieldType toFieldType(sheet::DataPilotFieldOrientation nOrie } -void ScXMLDataPilotTableContext::SetButtons() +void ScXMLDataPilotTableContext::SetButtons(ScDPObject* pDPObject) { ScDPOutputGeometry aGeometry(aTargetRangeAddress, bShowFilter); aGeometry.setColumnFieldCount(mnColFieldCount); @@ -452,6 +451,7 @@ void SAL_CALL ScXMLDataPilotTableContext::endFastElement( sal_Int32 /*nElement*/ if (!bTargetRangeAddress) return; + ScDPObject* pDPObject(new ScDPObject(pDoc)); pDPObject->SetName(sDataPilotTableName); pDPObject->SetTag(sApplicationData); pDPObject->SetOutRange(aTargetRangeAddress); @@ -539,7 +539,7 @@ void SAL_CALL ScXMLDataPilotTableContext::endFastElement( sal_Int32 /*nElement*/ pDPCollection->InsertNewTable(pDPObject); - SetButtons(); + SetButtons(pDPObject); } void ScXMLDataPilotTableContext::SetGrandTotal( diff --git a/sc/source/filter/xml/xmldpimp.hxx b/sc/source/filter/xml/xmldpimp.hxx index 536a90d06557..b99dd73d38eb 100644 --- a/sc/source/filter/xml/xmldpimp.hxx +++ b/sc/source/filter/xml/xmldpimp.hxx @@ -71,7 +71,6 @@ class ScXMLDataPilotTableContext : public ScXMLImportContext GrandTotalItem(); }; ScDocument* pDoc; - ScDPObject* pDPObject; std::unique_ptr<ScDPSaveData> pDPSave; std::unique_ptr<ScDPDimensionSaveData> pDPDimSaveData; GrandTotalItem maRowGrandTotal; @@ -139,7 +138,7 @@ public: void AddDimension(ScDPSaveDimension* pDim); void AddGroupDim(const ScDPSaveNumGroupDimension& aNumGroupDim); void AddGroupDim(const ScDPSaveGroupDimension& aGroupDim); - void SetButtons(); + void SetButtons(ScDPObject* pDPObject); void SetSelectedPage( const OUString& rDimName, const OUString& rSelected ); }; |