Kaydet (Commit) 726430db authored tarafından Deena Francis's avatar Deena Francis Kaydeden (comit) Eike Rathke

tdf#65505 tdf#57431 Autofilter checkbox for blank cells like in MS Excel

Change-Id: I955d0a3c99aa516677cac9c38b81aff41b616dc3
Reviewed-on: https://gerrit.libreoffice.org/13573Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
üst c21b1807
...@@ -2053,6 +2053,16 @@ public: ...@@ -2053,6 +2053,16 @@ public:
processCell(nRow, aCell); 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; } bool hasDates() const { return mbHasDates; }
}; };
...@@ -2064,7 +2074,7 @@ void ScColumn::GetFilterEntries( ...@@ -2064,7 +2074,7 @@ void ScColumn::GetFilterEntries(
{ {
FilterEntriesHandler aFunc(*this, rStrings); FilterEntriesHandler aFunc(*this, rStrings);
rBlockPos.miCellPos = rBlockPos.miCellPos =
sc::ParseAllNonEmpty(rBlockPos.miCellPos, maCells, nStartRow, nEndRow, aFunc); sc::ParseAll(rBlockPos.miCellPos, maCells, nStartRow, nEndRow, aFunc, aFunc);
rHasDates = aFunc.hasDates(); rHasDates = aFunc.hasDates();
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "checklistmenu.hxx" #include "checklistmenu.hxx"
#include "checklistmenu.hrc" #include "checklistmenu.hrc"
#include "strload.hxx" #include "strload.hxx"
#include "globstr.hrc"
#include <vcl/decoview.hxx> #include <vcl/decoview.hxx>
#include <vcl/settings.hxx> #include <vcl/settings.hxx>
...@@ -1053,8 +1054,13 @@ void ScCheckListMenuWindow::packWindow() ...@@ -1053,8 +1054,13 @@ void ScCheckListMenuWindow::packWindow()
void ScCheckListMenuWindow::setAllMemberState(bool bSet) void ScCheckListMenuWindow::setAllMemberState(bool bSet)
{ {
size_t n = maMembers.size(); size_t n = maMembers.size();
for (size_t i = 0; i < n; ++i) OUString aLabel;
maChecks.CheckEntry( maMembers[i].maName, maMembers[i].mpParent, bSet); 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) if (!maConfig.mbAllowEmptySet)
// We need to have at least one member selected. // We need to have at least one member selected.
...@@ -1493,8 +1499,11 @@ void ScCheckListMenuWindow::initMembers() ...@@ -1493,8 +1499,11 @@ void ScCheckListMenuWindow::initMembers()
} }
else else
{ {
OUString aLabel = maMembers[i].maName;
if (aLabel.isEmpty())
aLabel = ScGlobal::GetRscString(STR_EMPTYDATA);
SvTreeListEntry* pEntry = maChecks.InsertEntry( SvTreeListEntry* pEntry = maChecks.InsertEntry(
maMembers[i].maName, NULL, false, TREELIST_APPEND, NULL, aLabel, NULL, false, TREELIST_APPEND, NULL,
SvLBoxButtonKind_enabledCheckbox); SvLBoxButtonKind_enabledCheckbox);
maChecks.SetCheckButtonState( maChecks.SetCheckButtonState(
...@@ -1544,7 +1553,10 @@ void ScCheckListMenuWindow::getResult(ResultType& rResult) ...@@ -1544,7 +1553,10 @@ void ScCheckListMenuWindow::getResult(ResultType& rResult)
{ {
if ( maMembers[i].mbLeaf ) 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; OUString sName;
if ( maMembers[i].mbDate ) if ( maMembers[i].mbDate )
sName = maMembers[i].maRealName; sName = maMembers[i].maRealName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment