diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-12-13 22:01:36 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-12-13 22:03:20 -0500 |
commit | 7352c717a307c46f0f1825375597fbe44b816ba5 (patch) | |
tree | 24abf30b256bb295b67a6a9443ad9c2cffaf6092 | |
parent | 514af8a31fde244e750b3af80cc23025eb5be99e (diff) |
fdo#35981: Handle empty members correctly during field popup.
Or else filtering of field members will not work correctly when the
field contains an empty name.
-rw-r--r-- | sc/source/ui/view/gridwin2.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index f2b10cf57ed8..7f2ce839e6e8 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -480,7 +480,12 @@ void ScGridWindow::DPLaunchFieldPopupMenu( for (size_t i = 0; i < n; ++i) { const ScDPLabelData::Member& rMem = rLabelData.maMembers[i]; - mpDPFieldPopup->addMember(rMem.getDisplayName(), rMem.mbVisible); + rtl::OUString aName = rMem.getDisplayName(); + if (aName.isEmpty()) + // Use special string for an empty name. + mpDPFieldPopup->addMember(ScGlobal::GetRscString(STR_EMPTYDATA), rMem.mbVisible); + else + mpDPFieldPopup->addMember(rMem.getDisplayName(), rMem.mbVisible); } mpDPFieldPopup->initMembers(); } @@ -581,9 +586,14 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu() if (itrNameMap == aMemNameMap.end()) { // This is an original member name. Use it as-is. + rtl::OUString aName = itr->first; + if (aName.equals(ScGlobal::GetRscString(STR_EMPTYDATA))) + // Translate the special empty name into an empty string. + aName = rtl::OUString(); + aResult.insert( ScCheckListMenuWindow::ResultType::value_type( - itr->first, itr->second)); + aName, itr->second)); } else { |