Use std C++ algorithmes in model
This commit is contained in:
@@ -54,13 +54,13 @@ void XMLImportEngine::LoadAccount(XMLImportEngine* _this, const char** attrs)
|
||||
|
||||
if (account_number.Length())
|
||||
{
|
||||
for (i=0; i<(int)_this->_user->_accounts.size(); i++)
|
||||
try {
|
||||
Account ac = _this->_user->GetAccount(account_number);
|
||||
_this->_accounts[id] = ac.id;
|
||||
return;
|
||||
}
|
||||
catch (User::AccountNotFound)
|
||||
{
|
||||
if (_this->_user->_accounts[i].number == account_number)
|
||||
{
|
||||
_this->_accounts[id] = _this->_user->_accounts[i].id;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,13 +135,12 @@ void XMLImportEngine::LoadCategory(XMLImportEngine* _this, const char** attrs)
|
||||
|
||||
UNESCAPE_CHARS(cat.name);
|
||||
|
||||
for (i=0; i<(int)_this->_user->_categories.size(); i++)
|
||||
wxString catId = _this->_user->GetCategoryId(name);
|
||||
|
||||
if (catId != wxT("0"))
|
||||
{
|
||||
if (_this->_user->_categories[i].name == name)
|
||||
{
|
||||
_this->_categories[id] = _this->_user->_categories[i].id;
|
||||
return;
|
||||
}
|
||||
_this->_categories[id] = catId;
|
||||
return;
|
||||
}
|
||||
|
||||
_this->_categories[id] = wxT("unknown-") + name;
|
||||
|
||||
Reference in New Issue
Block a user