-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial commit for supporting reading xls (old) files. #22
base: master
Are you sure you want to change the base?
Conversation
@@ -120,7 +120,7 @@ class datetime_test_suite : public test_suite | |||
xlnt_assert_equals(xlnt::date(2000, 1, 1).weekday(), 6); // January 1st 2000 was a Saturday | |||
xlnt_assert_equals(xlnt::date(2016, 7, 15).weekday(), 5); // July 15th 2016 was a Friday | |||
xlnt_assert_equals(xlnt::date(2018, 10, 29).weekday(), 1); // October 29th 2018 was Monday | |||
xlnt_assert_equals(xlnt::date(1970, 1, 1).weekday(), 4); // January 1st 1970 was a Thursday | |||
xlnt_assert_equals(xlnt::date(1970, 1, 1).weekday(), -1); // January 1st 1970 was a Thursday |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change this line?
See my comment below about a possible reason.
@flaviu22 Thanks for your contribution. I will conduct a more thorough review later. If the code between xls and xlsx reading is very similar, it may be a good idea to move the common code to a |
@flaviu22 Thanks for your contribution! I'll take a closer look at it tomorrow or later this week 😉 However, I took a quick look and I must agree to @m7913d that, if possible, the same code should be used for both types of files (as much as possible, at least) to avoid code duplication. @m7913d About the unit test: my guess is that he is using Visual Studio, and since XLNT uses Just in case you are interested, this can be fixed by using C++20's
Long story short, we did manage to fix the limitation around 1970-01-01 for some projects using Some things that I would like to mention which are NOT related to this pull request:
|
@doomlaur Changing the unit test to January 2nd 1970 is fine for me. |
@flaviu22 What is the progress status of this xls implementation. It seems to me that most of the code is a copy paste from the xlsx version, without much of the changes required to actually read the old (binary) xls format? Do you plan to work further on the xls implementation? Should we convert this PR to a draft for now? |
I converted this PR to a draft, as the current implementation seems to be a WIP. Feel free to mark this PR as "Ready for review", once you think your code is ready for inclusion into the project. @flaviu22 If you need further assistance to implement the xls support, please let us now. |
Hi all. Yes, good to converted as draft, until we have a ready to integrate code. "it may be a good idea to move the common code to a common_consumer/common_producer class" I'll come back with comments ... |
Off course. When I posted that comment, I hadn't fully reviewed the code and assumed it was already functional. |
@flaviu22 I would appreciate if you could:
This is because Pull Request #27 fixes the issue you had with the unit test, so you should no longer see the failed unit test for |
Where can I find documentation about how to read xls files? To be honest, I didn't find such a thing. On my version of code, I have to change how excel file is read from early beginning:
Here, |
It may be useful to have a look at the official documentation: https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-xls/cd03cb5f-ca02-4934-a391-bb674cb8aa06 |
If you haven't done so, I highly suggest to read tfussell#227 (comment) |
Thank you for your willingness to maintain this great library. I would like to tell you that there is a very powerful library to work with xls files in C++, which I recommend, it is called ExcelFormat and was created by Martin Fuchs, but it was only maintained until 2011 and then it fell into abandonment, however some enthusiasts in the community have been maintaining and updating it, one of the most popular derived projects being that of dmytro-y-dev. It would be good if, in order not to start from scratch, what has already been advanced in this project could be reused and adapted to the Xlnt API. The author based his code on this OpenOffice documentation. Regards |
The xls code is pretty similar with xlsx for the moment, I have prepared the code to implement code to read xls files.