mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
update check extension with xlnt function
This commit is contained in:
parent
4678048c21
commit
b0664ded17
|
@ -795,7 +795,7 @@ void workbook::load(const std::string &filename)
|
||||||
{
|
{
|
||||||
if (filename.find_last_of(".") != std::string::npos) // check extension
|
if (filename.find_last_of(".") != std::string::npos) // check extension
|
||||||
{
|
{
|
||||||
std::string file_format = filename.substr(filename.find_last_of(".")+1);
|
std::string file_format = path(filename).extension();
|
||||||
|
|
||||||
if (file_format == "xls") {
|
if (file_format == "xls") {
|
||||||
throw xlnt::exception(" xlnt does not support the old .xls file format");
|
throw xlnt::exception(" xlnt does not support the old .xls file format");
|
||||||
|
@ -832,7 +832,7 @@ void workbook::load(const std::string &filename, const std::string &password)
|
||||||
{
|
{
|
||||||
if (filename.find_last_of(".") != std::string::npos) // check extension
|
if (filename.find_last_of(".") != std::string::npos) // check extension
|
||||||
{
|
{
|
||||||
std::string file_format = filename.substr(filename.find_last_of(".")+1);
|
std::string file_format = path(filename).extension();
|
||||||
|
|
||||||
if (file_format == "xls") {
|
if (file_format == "xls") {
|
||||||
throw xlnt::exception(" xlnt does not support the old .xls file format");
|
throw xlnt::exception(" xlnt does not support the old .xls file format");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user