[Libreoffice-commits] core.git: sc/source

Deena Francis deena.francis at gmail.com
Mon Feb 16 09:23:58 PST 2015


 sc/source/core/data/column3.cxx      |   12 +++++++++++-
 sc/source/ui/cctrl/checklistmenu.cxx |   20 ++++++++++++++++----
 2 files changed, 27 insertions(+), 5 deletions(-)

New commits:
commit 726430db96434f64037af719ad649ab109add5d1
Author: Deena Francis <deena.francis at gmail.com>
Date:   Sun Dec 21 11:34:58 2014 +0530

    tdf#65505 tdf#57431 Autofilter checkbox for blank cells like in MS Excel
    
    Change-Id: I955d0a3c99aa516677cac9c38b81aff41b616dc3
    Reviewed-on: https://gerrit.libreoffice.org/13573
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 5170d14..b8c99c5 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2053,6 +2053,16 @@ public:
         processCell(nRow, aCell);
     }
 
+    void operator() (const int nElemType, size_t nRow, size_t /* nDataSize */)
+    {
+        if ( nElemType == sc::element_type_empty ) {
+            mrStrings.push_back(ScTypedStrData(OUString()));
+            return;
+        }
+        ScRefCellValue aCell = mrColumn.GetCellValue(nRow);
+        processCell(nRow, aCell);
+    }
+
     bool hasDates() const { return mbHasDates; }
 };
 
@@ -2064,7 +2074,7 @@ void ScColumn::GetFilterEntries(
 {
     FilterEntriesHandler aFunc(*this, rStrings);
     rBlockPos.miCellPos =
-        sc::ParseAllNonEmpty(rBlockPos.miCellPos, maCells, nStartRow, nEndRow, aFunc);
+        sc::ParseAll(rBlockPos.miCellPos, maCells, nStartRow, nEndRow, aFunc, aFunc);
     rHasDates = aFunc.hasDates();
 }
 
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 8e1ce73..a9d1701 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -20,6 +20,7 @@
 #include "checklistmenu.hxx"
 #include "checklistmenu.hrc"
 #include "strload.hxx"
+#include "globstr.hrc"
 
 #include <vcl/decoview.hxx>
 #include <vcl/settings.hxx>
@@ -1053,8 +1054,13 @@ void ScCheckListMenuWindow::packWindow()
 void ScCheckListMenuWindow::setAllMemberState(bool bSet)
 {
     size_t n = maMembers.size();
-    for (size_t i = 0; i < n; ++i)
-        maChecks.CheckEntry( maMembers[i].maName, maMembers[i].mpParent, bSet);
+    OUString aLabel;
+    for (size_t i = 0; i < n; ++i) {
+        aLabel = maMembers[i].maName;
+        if (aLabel.isEmpty())
+            aLabel = ScGlobal::GetRscString(STR_EMPTYDATA);
+        maChecks.CheckEntry( aLabel, maMembers[i].mpParent, bSet);
+    }
 
     if (!maConfig.mbAllowEmptySet)
         // We need to have at least one member selected.
@@ -1493,8 +1499,11 @@ void ScCheckListMenuWindow::initMembers()
         }
         else
         {
+            OUString aLabel = maMembers[i].maName;
+            if (aLabel.isEmpty())
+                aLabel = ScGlobal::GetRscString(STR_EMPTYDATA);
             SvTreeListEntry* pEntry = maChecks.InsertEntry(
-                maMembers[i].maName, NULL, false, TREELIST_APPEND, NULL,
+                aLabel, NULL, false, TREELIST_APPEND, NULL,
                 SvLBoxButtonKind_enabledCheckbox);
 
             maChecks.SetCheckButtonState(
@@ -1544,7 +1553,10 @@ void ScCheckListMenuWindow::getResult(ResultType& rResult)
     {
         if ( maMembers[i].mbLeaf )
         {
-            bool bState =  maChecks.IsChecked( maMembers[i].maName,  maMembers[i].mpParent );
+            OUString aLabel = maMembers[i].maName;
+            if (aLabel.isEmpty())
+                aLabel = ScGlobal::GetRscString(STR_EMPTYDATA);
+            bool bState =  maChecks.IsChecked( aLabel,  maMembers[i].mpParent );
             OUString sName;
             if ( maMembers[i].mbDate )
                 sName = maMembers[i].maRealName;


More information about the Libreoffice-commits mailing list