diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-03-06 15:09:40 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-03-09 11:13:32 -0500 |
commit | abb5bc40caf58e32a05fb8e04e4f0de9c8de6489 (patch) | |
tree | 4f52dec96f24279b8c7d36c417d01d7987c0152c /sc/source/ui/view/gridwin2.cxx | |
parent | 1957c22f6267cc3466c96fdfe4dfccb87e7873a9 (diff) |
Only load members of the clicked field, not of all fields.
This can mean the difference of 10 seconds vs 0.01 second depending
on the type of data.
Diffstat (limited to 'sc/source/ui/view/gridwin2.cxx')
-rw-r--r-- | sc/source/ui/view/gridwin2.cxx | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 54c3d53d1709..564acd993810 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -398,7 +398,7 @@ namespace { struct DPFieldPopupData : public ScCheckListMenuWindow::ExtendedData { - ScPivotParam maDPParam; + ScDPLabelData maLabels; ScDPObject* mpDPObj; long mnDim; }; @@ -457,17 +457,12 @@ void ScGridWindow::DPLaunchFieldPopupMenu( { // We need to get the list of field members. auto_ptr<DPFieldPopupData> pDPData(new DPFieldPopupData); - pDPObj->FillLabelData(pDPData->maDPParam); - pDPData->mpDPObj = pDPObj; - sal_uInt16 nOrient; pDPData->mnDim = pDPObj->GetHeaderDim(rPos, nOrient); + pDPObj->FillLabelData(pDPData->mnDim, pDPData->maLabels); + pDPData->mpDPObj = pDPObj; - if (pDPData->maDPParam.maLabelArray.size() <= static_cast<size_t>(pDPData->mnDim)) - // out-of-bound dimension ID. This should never happen! - return; - - const ScDPLabelData& rLabelData = pDPData->maDPParam.maLabelArray[pDPData->mnDim]; + const ScDPLabelData& rLabelData = pDPData->maLabels; mpDPFieldPopup.reset(new ScCheckListMenuWindow(this, pViewData->GetDocument())); mpDPFieldPopup->setName(OUString(RTL_CONSTASCII_USTRINGPARAM("DataPilot field member popup"))); @@ -568,7 +563,7 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu() return; // Build a map of layout names to original names. - const ScDPLabelData& rLabelData = pDPData->maDPParam.maLabelArray[pDPData->mnDim]; + const ScDPLabelData& rLabelData = pDPData->maLabels; MemNameMapType aMemNameMap; for (vector<ScDPLabelData::Member>::const_iterator itr = rLabelData.maMembers.begin(), itrEnd = rLabelData.maMembers.end(); itr != itrEnd; ++itr) |