Some optimizations on empty wxString comparison and on Search (Database)

This commit is contained in:
2010-08-21 09:54:04 +02:00
parent 3802460429
commit d12e00c6fb
7 changed files with 49 additions and 47 deletions

View File

@@ -277,27 +277,27 @@ void PreferencesPanel::OnAccountModified(wxGridEvent& event)
inModification = true;
value = _accountsGrid->GetCellValue(row, ACCOUNT_NAME);
if (value != wxT(""))
if (value.Length())
{
new_account.name = value;
op_complete--;
}
value = _accountsGrid->GetCellValue(row, ACCOUNT_NUMBER);
if (value != wxT(""))
if (value.Length())
{
new_account.number = value;
op_complete--;
}
value = _accountsGrid->GetCellValue(row, ACCOUNT_SHARED);
if (value != wxT("") && value != wxT("0"))
if (value.Length() && value != wxT("0"))
new_account.shared = true;
else
new_account.shared = false;
value = _accountsGrid->GetCellValue(row, ACCOUNT_DEFAULT);
if (value != wxT("") && value != wxT("0"))
if (value.Length() && value != wxT("0"))
new_account._default = true;
else
new_account._default = false;
@@ -430,7 +430,7 @@ void PreferencesPanel::OnCategoryModified(wxGridEvent& event)
inModification = true;
value = _categoriesGrid->GetCellValue(row, CATEGORY_NAME);
if (value != wxT(""))
if (value.Length())
{
new_cat.name = value;
op_complete--;