summaryrefslogtreecommitdiff
path: root/sc/source/ui/dbgui
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2015-11-18 14:10:55 +0100
committerEike Rathke <erack@redhat.com>2015-12-10 17:24:22 +0000
commit0bfa6ddc99710c1e166140f97cf3212348d04d05 (patch)
tree0bdc07f9546687f570106d87eb061e8edcaa692b /sc/source/ui/dbgui
parenta16da9d851a4c46db1fd56e9115a97d43ca51074 (diff)
tdf#93263: Take function mask from ScPivotField
and not from ScDPLabelData (that's what old code used to do as well). Afaics ScDPLabelData.mnFuncMask member is never modified as the array gets populated in ScDPObject::FillLabelDataForDimension. UI has thus only its default value (PIVOT_FUNC_NONE) and so subtotals get reset on every change. ScPivotField however contains the right func mask, so take it from there. Change-Id: I862be121683aac079e788ce535f714ac8cdbcd0b Reviewed-on: https://gerrit.libreoffice.org/20041 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/ui/dbgui')
-rw-r--r--sc/source/ui/dbgui/PivotLayoutTreeList.cxx11
1 files changed, 8 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)