Kaydet (Commit) 17f749af authored tarafından Caolán McNamara's avatar Caolán McNamara

only date autofilter menus need the space for the tree expanders

so for lists that don't include dates then drop the tree view bits
to save space to the left of the entries

Change-Id: I44f624d8a06d578674806813239a408466c87d70
üst b052acce
......@@ -877,7 +877,7 @@ void ScCheckListMenuWindow::CancelButton::Click()
ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc) :
ScMenuFloatingWindow(pParent, pDoc),
maEdSearch(VclPtr<ScSearchEdit>::Create(this)),
maChecks(VclPtr<ScCheckListBox>::Create(this, WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT) ),
maChecks(VclPtr<ScCheckListBox>::Create(this)),
maChkToggleAll(VclPtr<TriStateBox>::Create(this, 0)),
maBtnSelectSingle(VclPtr<ImageButton>::Create(this, 0)),
maBtnUnselectSingle(VclPtr<ImageButton>::Create(this, 0)),
......@@ -905,9 +905,6 @@ ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* p
maEdSearch->SetTabStopsContainer( &maTabStops );
maChecks->SetTabStopsContainer( &maTabStops );
// Enable type-ahead search in the check list box.
maChecks->SetStyle(maChecks->GetStyle() | WB_QUICK_SEARCH);
}
ScCheckListMenuWindow::~ScCheckListMenuWindow()
......@@ -1831,6 +1828,15 @@ void ScSearchEdit::MouseButtonDown(const MouseEvent& rMEvt)
mpTabStops->SetTabStop( this );
}
void ScCheckListMenuWindow::setHasDates(bool bHasDates)
{
// WB_QUICK_SEARCH Enables type-ahead search in the check list box.
if (bHasDates)
maChecks->SetStyle(WB_QUICK_SEARCH | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT);
else
maChecks->SetStyle(WB_QUICK_SEARCH | WB_HASBUTTONS);
}
void ScCheckListMenuWindow::initMembers()
{
size_t n = maMembers.size();
......
......@@ -325,6 +325,7 @@ public:
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
void setMemberSize(size_t n);
void setHasDates(bool bHasDates);
void addDateMember(const OUString& rName, double nVal, bool bVisible);
void addMember(const OUString& rName, bool bVisible);
void initMembers();
......
......@@ -714,6 +714,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
std::vector<ScTypedStrData> aStrings;
pDoc->GetFilterEntries(nCol, nRow, nTab, aStrings, bHasDates);
mpAutoFilterPopup->setHasDates(bHasDates);
mpAutoFilterPopup->setMemberSize(aStrings.size());
std::vector<ScTypedStrData>::const_iterator it = aStrings.begin(), itEnd = aStrings.end();
for (; it != itEnd; ++it)
......
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