summaryrefslogtreecommitdiff
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 18:17:45 +0000
commitb6656993429cd18e8a31825de45c9515f93cd0cd (patch)
treeb627f069960f45a48e7cb47c0c7e9641234936a3
parent7d40531c1b92d1a00f08943bd9a5f9c7442db5c0 (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> (cherry picked from commit 0bfa6ddc99710c1e166140f97cf3212348d04d05) Reviewed-on: https://gerrit.libreoffice.org/20626
-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();