[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Dec 13 19:03:31 PST 2011


 sc/source/ui/view/gridwin2.cxx |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit e23c5aa10619d69cfd7ea7222fc38019c411757a
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