- Introduction
- Phase 1 - Unit Testing
- Phase 2 - Code Refactoring
- Phase 3 - Implement XML ZIP Engine
- Conclusion
- References
Hi, I'm Aditya Sahu and I have been working towards the project for 3 months under the mentorship of Tomaž Vajngerl and Michael Meeks. The objective of the project was to get rid of the custom old binary file formats that LibreOffice used to store its gallery themes. These binary files were not human friendly and it was difficult to read what's inside of them by a user. As a replacement, use ZIP Files to store the theme as a whole and inside it, use XML file to store the contents of the metadata of the theme. This will make the gallery storage system user friendly as XML and ZIP files can be easily accessed by the user.
First phase was to write unit tests of the gallery functions. This constitutes of the whole process starting from creation of gallery theme to renaming of the theme to deleting the theme. I started working on it in the middle of community bonding period itself to get a head start on my project. The month of may and the first week of June was spent completing this phase.
I wrote 10 unit tests for gallery module contributing ~500 lines of code in the first phase of the project. Previously, there were no tests available for the same. Now each time Jenkins will run the build, it will test if there is any inconsistency or any failed tests, which reduced risk of failure and improved quality of code.
- https://gerrit.libreoffice.org/c/core/+/92679
- https://gerrit.libreoffice.org/c/core/+/93305
- https://gerrit.libreoffice.org/c/core/+/94646
The second phase was to refactor the gallery code. Previously, the classes on the backend were dealing with the main gallery code as well as the reading and writing part. The objective of this part was to separate the classes dealing with reading/writing part from the ones dealing with the actual back-end code. This would allow us to separate out the code dealing with binary files, and in future we can simply generate an alternate version of this code dealing with XML-ZIP files.
Changed the gallery structure by introducing new classes and putting the reading/writing part of the code there.
Old Gallery Structure: https://imgur.com/a/i2r689u
New Gallery Structure: https://imgur.com/a/vDdUlgE
- https://gerrit.libreoffice.org/c/core/+/95922
- https://gerrit.libreoffice.org/c/core/+/96253
- https://gerrit.libreoffice.org/c/core/+/96408
- https://gerrit.libreoffice.org/c/core/+/96527
- https://gerrit.libreoffice.org/c/core/+/96541
- https://gerrit.libreoffice.org/c/core/+/96764
- https://gerrit.libreoffice.org/c/core/+/98979
- https://gerrit.libreoffice.org/c/core/+/99035
- https://gerrit.libreoffice.org/c/core/+/99940/
- https://gerrit.libreoffice.org/c/core/+/98492
- https://gerrit.libreoffice.org/c/core/+/99479
- https://gerrit.libreoffice.org/c/core/+/99789
- https://gerrit.libreoffice.org/c/core/+/99945
- https://gerrit.libreoffice.org/c/core/+/99940
- https://gerrit.libreoffice.org/c/core/+/101084
- https://gerrit.libreoffice.org/c/core/+/101420
- https://gerrit.libreoffice.org/c/core/+/101495
- https://gerrit.libreoffice.org/c/core/+/101496
- https://gerrit.libreoffice.org/c/core/+/101505
- https://gerrit.libreoffice.org/c/core/+/101508
- https://gerrit.libreoffice.org/c/core/+/101434
- https://gerrit.libreoffice.org/c/core/+/101547
- https://gerrit.libreoffice.org/c/core/+/101557
- https://gerrit.libreoffice.org/c/core/+/101642
- https://gerrit.libreoffice.org/c/core/+/101655
- https://gerrit.libreoffice.org/c/core/+/101643
Final phase of the project is to implement the XML ZIP Engine. This is the part where the ZIP File is created and inside it, contents are added to it. The contents are mimetype, xml file and binary files (images, audio).
Created a class for XML Engine and taught the engine how to read from a ZIP file, write to a ZIP file, insert XML file inside the ZIP file, read XML file and write mimetype of the ZIP file.
But there are some major things left from the phase, that are yet to be done. Firstly, I have to add a switch to Gallery class that would determine if the type is Binary or XML ZIP file. Then, implement alternate some functions of Gallery Binary Engine into Gallery XML Engine. After this is done, if we turn on the XML ZIP switch, we can use the project easily. I will do this bit post GSoC.
- https://gerrit.libreoffice.org/c/core/+/100158
- https://gerrit.libreoffice.org/c/core/+/100609
- https://gerrit.libreoffice.org/c/core/+/101661
- https://gerrit.libreoffice.org/c/core/+/101662
- https://gerrit.libreoffice.org/c/core/+/101664
It has really been a great summer for me, full of learning things and contributing to open source community has been a real pleasure for me. During the period of three months, I have improved the code structure of the gallery module in LibreOffice software. I have written unit tests which will always be helpful to other LO developers in future.
I am very grateful to my mentor Tomaž Vajngerl, who supported me throughout the entire journey of GSoC and never left me stranded. It is because of him I have come this close to finishing the project. I will finish up the project keep contributing to open source community even after GSoC ends.
Links to my blog posts about the project