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

This commit is contained in:
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 & 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;
@@ -1338,7 +1339,8 @@ std::vector<Operation>* Database::Search(User* user, wxString* description, wxDa
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;