Kaydet (Commit) b6656993 authored tarafından Katarina Behrens's avatar Katarina Behrens Kaydeden (comit) Eike Rathke

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/20041Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
(cherry picked from commit 0bfa6ddc)
Reviewed-on: https://gerrit.libreoffice.org/20626
üst 7d40531c
...@@ -71,12 +71,15 @@ bool ScPivotLayoutTreeList::DoubleClickHdl() ...@@ -71,12 +71,15 @@ bool ScPivotLayoutTreeList::DoubleClickHdl()
void ScPivotLayoutTreeList::FillFields(ScPivotFieldVector& rFieldVector) void ScPivotLayoutTreeList::FillFields(ScPivotFieldVector& rFieldVector)
{ {
Clear(); Clear();
maItemValues.clear();
ScPivotFieldVector::iterator it; ScPivotFieldVector::iterator it;
for (it = rFieldVector.begin(); it != rFieldVector.end(); ++it) for (it = rFieldVector.begin(); it != rFieldVector.end(); ++it)
{ {
ScPivotField& rField = *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); InsertEntry(pItemValue->maName, nullptr, false, TREELIST_APPEND, pItemValue);
} }
} }
...@@ -98,8 +101,10 @@ void ScPivotLayoutTreeList::InsertEntryForSourceTarget(SvTreeListEntry* pSource, ...@@ -98,8 +101,10 @@ void ScPivotLayoutTreeList::InsertEntryForSourceTarget(SvTreeListEntry* pSource,
void ScPivotLayoutTreeList::InsertEntryForItem(ScItemValue* pItemValue, sal_uLong nPosition) void ScPivotLayoutTreeList::InsertEntryForItem(ScItemValue* pItemValue, sal_uLong nPosition)
{ {
OUString rName = pItemValue->maName; ScItemValue *pListItemValue = new ScItemValue(pItemValue);
InsertEntry(rName, nullptr, false, nPosition, 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) void ScPivotLayoutTreeList::KeyInput(const KeyEvent& rKeyEvent)
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
class ScPivotLayoutTreeList : public ScPivotLayoutTreeListBase class ScPivotLayoutTreeList : public ScPivotLayoutTreeListBase
{ {
private:
std::vector<std::unique_ptr<ScItemValue> > maItemValues;
public: public:
ScPivotLayoutTreeList(vcl::Window* pParent, WinBits nBits); ScPivotLayoutTreeList(vcl::Window* pParent, WinBits nBits);
virtual ~ScPivotLayoutTreeList(); virtual ~ScPivotLayoutTreeList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment