summaryrefslogtreecommitdiff
path: root/sc
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
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')
-rw-r--r--sc/source/ui/dbgui/PivotLayoutTreeList.cxx11
-rw-r--r--sc/source/ui/inc/PivotLayoutTreeList.hxx3
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();