Some optimizations on empty wxString comparison and on Search (Database)
This commit is contained in:
@@ -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--;
|
||||
|
Reference in New Issue
Block a user