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:
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();
}
......
......@@ -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;
......
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