|
|
@ -115,9 +115,12 @@ int get_row(lua_State *L) {
|
|
|
|
std::string value;
|
|
|
|
std::string value;
|
|
|
|
auto cells = std::vector<std::string>();
|
|
|
|
auto cells = std::vector<std::string>();
|
|
|
|
while (get_next_cell(sheet_handle, value)) {
|
|
|
|
while (get_next_cell(sheet_handle, value)) {
|
|
|
|
cells.push_back(value);
|
|
|
|
// read all cells in the row, even if we don't need to;
|
|
|
|
if (max_tokens > 0 && cells.size() >= max_tokens)
|
|
|
|
// otherwise xlsxio will return a spurious empty row on
|
|
|
|
break;
|
|
|
|
// next call
|
|
|
|
|
|
|
|
if (max_tokens <= 0 || cells.size() < max_tokens) {
|
|
|
|
|
|
|
|
cells.push_back(value);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Lua::PushVector(L, cells, true);
|
|
|
|
Lua::PushVector(L, cells, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|