Fix a bug in search (selecting opposite types of operation)

This commit is contained in:
Grégory Soutadé 2010-12-10 19:08:41 +01:00
parent 8142c570d0
commit 9355c42093
3 changed files with 4 additions and 16 deletions

View File

@ -1328,7 +1328,8 @@ std::vector<Operation>* Database::Search(User* user, wxString* description, wxDa
if (types) if (types)
{ {
if ((types & FIX_OP) ^ (types & NON_FIX_OP)) if (((types & FIX_OP) && !(types & NON_FIX_OP)) ||
(!(types & FIX_OP) && (types & NON_FIX_OP)))
{ {
if (firstCond) req += wxT(" AND ") ; else firstCond = true; if (firstCond) req += wxT(" AND ") ; else firstCond = true;
@ -1338,7 +1339,8 @@ std::vector<Operation>* Database::Search(User* user, wxString* description, wxDa
req += wxT(" fix_cost='0'"); req += wxT(" fix_cost='0'");
} }
if ((types & CHECKED_OP) ^ (types & NOT_CHECKED_OP)) if (((types & CHECKED_OP) && !(types & NOT_CHECKED_OP)) ||
(!(types & CHECKED_OP) && (types & NOT_CHECKED_OP)))
{ {
if (firstCond) req += wxT(" AND ") ; else firstCond = true; if (firstCond) req += wxT(" AND ") ; else firstCond = true;

View File

@ -75,7 +75,6 @@ SearchPanel::SearchPanel(KissCount* kiss, wxUI *parent) : wxScrolledWindow(&(*pa
wxString stypes[] = {_("Fix"), _("Non fix"), _("Checked"), _("Not checked")}; wxString stypes[] = {_("Fix"), _("Non fix"), _("Checked"), _("Not checked")};
_optype = new wxCheckListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 4, stypes); _optype = new wxCheckListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 4, stypes);
_optype->Check(0); _optype->Check(1); _optype->Check(2); _optype->Check(3);
_account = new wxCheckListBox(this, wxID_ANY); _account = new wxCheckListBox(this, wxID_ANY);
for(accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); accountIt++) for(accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); accountIt++)

View File

@ -39,19 +39,6 @@ wxUI::wxUI(KissCount* kiss, const wxString& title, const wxPoint& pos, const wxS
{ {
_hbox = new wxBoxSizer(wxVERTICAL); _hbox = new wxBoxSizer(wxVERTICAL);
_buttonPanel = new ButtonPanel(_kiss, this); _buttonPanel = new ButtonPanel(_kiss, this);
// wxMenu *menuFile = new wxMenu;
// menuFile->Append( ID_About, wxT("&About...") );
// menuFile->AppendSeparator();
// menuFile->Append( ID_Quit, wxT("E&xit") );
// wxMenuBar *menuBar = new wxMenuBar;
// menuBar->Append( menuFile, wxT("&File") );
// SetMenuBar( menuBar );
// CreateStatusBar();
// SetStatusText( wxT("Welcome to wxWidgets!") );
SetSizer(_hbox); SetSizer(_hbox);