diff options
-rw-r--r-- | sc/source/ui/dbgui/PivotLayoutTreeList.cxx | 11 | ||||
-rw-r--r-- | sc/source/ui/inc/PivotLayoutTreeList.hxx | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeList.cxx b/sc/source/ui/dbgui/PivotLayoutTreeList.cxx index 82e5911dd939..a4173e9cadca 100644 --- a/sc/source/ui/dbgui/PivotLayoutTreeList.cxx +++ b/sc/source/ui/dbgui/PivotLayoutTreeList.cxx @@ -71,12 +71,15 @@ bool ScPivotLayoutTreeList::DoubleClickHdl() void ScPivotLayoutTreeList::FillFields(ScPivotFieldVector& rFieldVector) { Clear(); + maItemValues.clear(); ScPivotFieldVector::iterator it; for (it = rFieldVector.begin(); it != rFieldVector.end(); ++it) { ScPivotField& rField = *it; - ScItemValue* pItemValue = mpParent->GetItem(rField.nCol); + OUString aLabel = mpParent->GetItem( rField.nCol )->maName; + ScItemValue* pItemValue = new ScItemValue( aLabel, rField.nCol, rField.nFuncMask ); + maItemValues.push_back(std::unique_ptr<ScItemValue>(pItemValue)); InsertEntry(pItemValue->maName, nullptr, false, TREELIST_APPEND, pItemValue); } } @@ -98,8 +101,10 @@ void ScPivotLayoutTreeList::InsertEntryForSourceTarget(SvTreeListEntry* pSource, void ScPivotLayoutTreeList::InsertEntryForItem(ScItemValue* pItemValue, sal_uLong nPosition) { - OUString rName = pItemValue->maName; - InsertEntry(rName, nullptr, false, nPosition, pItemValue); + ScItemValue *pListItemValue = new ScItemValue(pItemValue); + maItemValues.push_back(std::unique_ptr<ScItemValue>(pListItemValue)); + OUString rName = pListItemValue->maName; + InsertEntry(rName, nullptr, false, nPosition, pListItemValue); } void ScPivotLayoutTreeList::KeyInput(const KeyEvent& rKeyEvent) diff --git a/sc/source/ui/inc/PivotLayoutTreeList.hxx b/sc/source/ui/inc/PivotLayoutTreeList.hxx index 2ae1adb88410..60feb73df465 100644 --- a/sc/source/ui/inc/PivotLayoutTreeList.hxx +++ b/sc/source/ui/inc/PivotLayoutTreeList.hxx @@ -15,6 +15,9 @@ class ScPivotLayoutTreeList : public ScPivotLayoutTreeListBase { +private: + std::vector<std::unique_ptr<ScItemValue> > maItemValues; + public: ScPivotLayoutTreeList(vcl::Window* pParent, WinBits nBits); virtual ~ScPivotLayoutTreeList(); |