[Libreoffice-commits] .: sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Dec 13 19:02:35 PST 2011
sc/source/ui/view/gridwin2.cxx | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
New commits:
commit 7352c717a307c46f0f1825375597fbe44b816ba5
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Dec 13 22:01:36 2011 -0500
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.
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index f2b10cf..7f2ce83 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
{
More information about the Libreoffice-commits
mailing list