Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This is summary of my GSoC project with LibreOffice

Google Summer of Code 2020 Work Product Submission

This is the summary of my GSoC Project - "Move Gallery Code to use ZIP Files" with LibreOffice.

Table of Contents

Introduction

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.

Phase 1 - Unit Testing (Completed)

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.

Work Done

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.

Merged Code

  1. https://gerrit.libreoffice.org/c/core/+/92679
  2. https://gerrit.libreoffice.org/c/core/+/93305
  3. https://gerrit.libreoffice.org/c/core/+/94646

Phase 2 - Code Refactoring (Completed)

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.

Work Done

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

Merged Code

  1. https://gerrit.libreoffice.org/c/core/+/95922
  2. https://gerrit.libreoffice.org/c/core/+/96253
  3. https://gerrit.libreoffice.org/c/core/+/96408
  4. https://gerrit.libreoffice.org/c/core/+/96527
  5. https://gerrit.libreoffice.org/c/core/+/96541
  6. https://gerrit.libreoffice.org/c/core/+/96764
  7. https://gerrit.libreoffice.org/c/core/+/98979
  8. https://gerrit.libreoffice.org/c/core/+/99035
  9. https://gerrit.libreoffice.org/c/core/+/99940/
  10. https://gerrit.libreoffice.org/c/core/+/98492
  11. https://gerrit.libreoffice.org/c/core/+/99479
  12. https://gerrit.libreoffice.org/c/core/+/99789
  13. https://gerrit.libreoffice.org/c/core/+/99945
  14. https://gerrit.libreoffice.org/c/core/+/99940
  15. https://gerrit.libreoffice.org/c/core/+/101084
  16. https://gerrit.libreoffice.org/c/core/+/101420
  17. https://gerrit.libreoffice.org/c/core/+/101495
  18. https://gerrit.libreoffice.org/c/core/+/101496
  19. https://gerrit.libreoffice.org/c/core/+/101505
  20. https://gerrit.libreoffice.org/c/core/+/101508
  21. https://gerrit.libreoffice.org/c/core/+/101434
  22. https://gerrit.libreoffice.org/c/core/+/101547
  23. https://gerrit.libreoffice.org/c/core/+/101557
  24. https://gerrit.libreoffice.org/c/core/+/101642
  25. https://gerrit.libreoffice.org/c/core/+/101655
  26. https://gerrit.libreoffice.org/c/core/+/101643

Phase 3 - Implement XML ZIP Engine (Partially Completed)

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).

Work Done

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.

Future Work

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.

Code (Unmerged)

  1. https://gerrit.libreoffice.org/c/core/+/100158
  2. https://gerrit.libreoffice.org/c/core/+/100609
  3. https://gerrit.libreoffice.org/c/core/+/101661
  4. https://gerrit.libreoffice.org/c/core/+/101662
  5. https://gerrit.libreoffice.org/c/core/+/101664

Conclusion

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.

References

Links to my blog posts about the project

  1. GSoC'20 Project Overview
  2. GSoc'20 Part 1
  3. GSoc'20 Part 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.