Use std C++ algorithmes in model

This commit is contained in:
2011-08-14 19:26:54 +02:00
parent 6596097f72
commit 8d7a019ca7
7 changed files with 45 additions and 37 deletions

View File

@@ -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;