sc/source/ui/cctrl/checklistmenu.cxx | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-)
New commits: commit 7967e5e51e5210b8c3d3dc63502bd7d875eb36b7 Author: Markus Mohrhard <[email protected]> Date: Sat Feb 20 09:29:08 2016 +0100 use O(n) algorithm to change all autofilter entries Change-Id: Iae80c0c23b15a9c2ba0cd4913d6e22dc4c3a1816 Reviewed-on: https://gerrit.libreoffice.org/22516 Reviewed-by: Markus Mohrhard <[email protected]> Tested-by: Markus Mohrhard <[email protected]> diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 553babd..865fb7b 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -1131,13 +1131,30 @@ void ScCheckListMenuWindow::packWindow() void ScCheckListMenuWindow::setAllMemberState(bool bSet) { size_t n = maMembers.size(); - OUString aLabel; + std::set<SvTreeListEntry*> maParents; for (size_t i = 0; i < n; ++i) { - aLabel = maMembers[i].maName; - if (aLabel.isEmpty()) - aLabel = ScGlobal::GetRscString(STR_EMPTYDATA); - maChecks->ShowCheckEntry( aLabel, maMembers[i].mpParent, true, bSet); + maParents.insert(maMembers[i].mpParent); + } + for (auto itr = maParents.begin(), itrEnd = maParents.end(); itr != itrEnd; ++itr) + { + if (!(*itr)) + { + sal_uInt16 nCount = maChecks->GetEntryCount(); + for( sal_uInt16 i = 0; i < nCount; ++i) + { + SvTreeListEntry* pEntry = maChecks->GetEntry(i); + maChecks->CheckEntry(pEntry, bSet); + } + } + else + { + SvTreeListEntries& rEntries = (*itr)->GetChildEntries(); + for (auto it = rEntries.begin(), itEnd = rEntries.end(); it != itEnd; ++ it) + { + maChecks->CheckEntry(*itr, bSet); + } + } } if (!maConfig.mbAllowEmptySet) _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
