troldal/OpenXLSX

The bug fix on MacOs is missing in branch master

Closed this issue · 4 comments

https://github.com/troldal/OpenXLSX/blob/master/OpenXLSX/sources/XLDateTime.cpp
The bug fix on MacOs is missing and should include "#include <string>" in the header

I do not understand. XLDateTime.cpp does not use std::strings anywhere? How can this be a bug? Could you be more specific / maybe post a compiler error message?

The parameter of the constructor of the class XLDateTimeError is type of "const std::string &", so there exists a conversion of "const char *" to "const std::string &". You can see in line 89, for example. The compiler throw the err

"error: no matching conversion for functional-style cast from 'const char[59]' to 'XLDateTimeError'
if (serial < 1.0) throw XLDateTimeError("Excel date/time serial number is invalid (must be >= 1.0.)")".

So if there is no #include the compiler can not identify this, at least on MacOS. I saw that the repository author fixed this bug earlier, but now it's gone.

Understood - thank you for reporting this. The actual missing include was in XLException.hpp - please have a look at commit 58950be - this should address the follow-up error you are seeing.

closing as resolved (based on your thumbs up reaction ;)