[Enh #11] Import from Excel: trim names

This commit is contained in:
Martin Brodbeck 2019-02-25 08:57:10 +01:00
parent 65f5da45ec
commit 45fe7ea8bd
3 changed files with 25 additions and 2 deletions

View file

@ -1,4 +1,5 @@
#include "excelreader.h"
#include "utils.h"
#include <xlnt/xlnt.hpp>
#include <fstream>
@ -40,8 +41,10 @@ void ExcelReader::readSellersFromFile(const fs::path& filePath, Marketplace* mar
seller->createUuid();
seller->setSellerNo(row[0].value<int>());
seller->setNumArticlesOffered(row[1].value<int>());
seller->setFirstName(row[2].value<std::string>());
seller->setLastName(row[3].value<std::string>());
std::string firstName = row[2].value<std::string>();
seller->setFirstName(trim(firstName));
std::string lastName = row[3].value<std::string>();
seller->setLastName(trim(lastName));
market->getSellers().push_back(std::move(seller));
rowCount++;
}