Fixing an Interoperability Bug in LibreOffice: Missing Lines from DOCX (part 1/3)

By Hossein Nourikah, Developer Community Architect at The Document Foundation

In LibreOffice, interoperability is considered a very important aspect of the software. Today, LibreOffice can load and save various file formats from many different office applications from different companies across the world. But bugs are inevitable parts of every software:there are situations where the application does not behave as it should, and a developer should take action and fix it, so that it will behave as it is expected by the user.

What if you encounter a bug in LibreOffice, and how does a developer fix the problem? In these series of articles, we discuss the steps needed to fix a bug. In the end, we will provide a test and make sure that the same problem does not happen in the future.

The article is presented in three parts:

  1. Understanding the Bugs and QA
  2. Developing a Bug Fix
  3. Writing the Tests and Finishing the Task

This blog post is the first part.

1. Understanding the Bugs / QA

Bugs can be found in any software and in a broader view, every technological product. There are situations that a system behaves in a way that the user does not like or expect, and then the engineers come in, take action and fix that. It is proven that no software can be completely bug-free, because there is no exact way to describe all the aspects of a software, even mathematically using formal methods.

Although we can not avoid the bugs completely, we can improve the situation. The important thing here is to document these bugs, reproduce them using sample documents, investigate the cause(s), and hopefully fix them as soon as possible while considering the priority. The whole process of dealing with the bugs and improving the quality of the software is is called: “Quality Assurance”, or simply “QA”.

You can take a look at LibreOffice Wiki QA section and ask QA questions in the IRC channel #libreoffice-qa on the Libera.Chat network connect via webchat

1.1. Bug Report

So, you have encountered a problem in the LibreOffice! In this case, first of all you should try to report the bug to Bugzilla. If a bug is not recorded in Bugzilla, there is a little chance that it will be fixed.

So, everything starts with a bug report in TDF’s Bugzilla. A detailed explanation of what a good bug report should contain is available in the TDF Wiki: https://wiki.documentfoundation.org/BugReport

In short, a good bug report should have suitable summary for the problem, appropriate description and specific components/hardware/version for the context of the problem. Steps to reproduce the bug are important parts of every report, because a developer should be able to reproduce the bug in order to fix it.

The bug reporter should carefully describe the “actual results” and why it is different from the “expected results”. This is also important because the desired software’s behaviour is not always as obvious as it seems to be for the bug reporter.

Let’s talk about a regression bug that is recently fixed. The “NISZ LibreOffice Team” reported this bug. The National Infocommunications Service Company Ltd. (NISZ) has an active team in LibreOffice development and QA.

This is the bug title and description provided by the NISZ LibreOffice Team:

Bug 123321 – FILEOPEN | DOC, missing longer line when saved in LO (shorter line remains)

https://bugs.documentfoundation.org/show_bug.cgi?id=123321

Description:
When the attached original document gets saved in LO as doc the middle line gets its length resized.

Steps to Reproduce:

  1. Open the attached doc in LO.
  2. Save it as doc.
  3. Reload.
  4. Notice the changes.

Actual Results: The middle arrow gets smaller.
Expected Results: It should stay the same size even after saving in LO.
Reproducible: Always
User Profile Reset: No

Every bug has a number associated to it, and at TDF Bugzilla, it is referred to by its number, like tdf#123321.

1.2. Bug Confirmation

After a bug is reported, it is needed that someone else check and see If it is reproducible or not. If so, the bug is then confirmed and its status will be set to “New”. In this case, a user named Timur from the QA team of volunteers has confirmed this bug. It is needed that someone else other than the original bug reporter confirms the bug report.

Here, the bug reporter has provided several examples:

Attachments

  • The original file (39.50 KB, application/msword)
  • The saved file. (24.00 KB, application/msword)
  • Screenshot of the original and exported document side by
    side in Writer. (298.50 KB, image/png)
  • Minimized test document in docx format (19.66 KB,
    application/vnd.openxmlformats-officedocument.wordprocessingml.document)

Opening the first file, we see that it contains several shapes. 4 ellipses, 2 diagonal lines, and a vertical line. But if we look closely, we find out that the vertical line actually consists of 3 different vertical lines. This can be understood by try selecting the line, and then pressing the tab to select the other lines.

The Shapelinelength_min.docx only contains 3 overlapped vertical lines (the overlap is not important).

  • First one on the top with the length 0.17″ (Verified in Word 2007)
  • Second one in the middle with the length of 1″ (Verified in Word 2007)
  • Third one at the bottom with the length of 2.77″ (Verified in Word 2007)

When you save it in LibreOffice and reload it, the first and the third vertical lines disappear, but if you select the second one (the only visible after save and reload), you can select the two other lines by pressing “tab” button. If you look at the size of these two lines, you will see that both have the length of 0″.

By opening the examples, saving and reloading them, we can verify that the bug is present even in the latest master build.

Images showing the bug

(Good)

(Bad)

Figure 1. The visible lines in the middle become smaller after save and reload

1.3. Bisect / Bibisect

Regression bugs are special kinds of bugs. They describe a feature that was previously working well, but at some point a change in the code has caused it to stop working. They are source of disappointment for the user, but they are easier to fix for the developers compared to other bugs! Why? Because every single change to the LibreOffice code is kept in the source code management system (Git), it is possible to find that which change actually introduced the bug.

Git has a special tool for this purpose, which is call bisect. It uses a binary search to find the commit that introduced the bug. But for LibreOffice which is a huge piece of software consisting of roughly 10 million lines of code, this can take a lot of time. So, a trick is used here: bisecting with the binaries! If you have access to every built LibreOffice for the commits, you can use git bisect command to find the source for problem in a very short time: This is called bibisect!

A very detailed description is on the wiki: https://wiki.documentfoundation.org/QA/Bibisect

Aron Budea from Collabora Productivity Ltd’s core engineering team did the bibisect, and now we know the exact commit that caused the problem:

Bibisected to the following commit using repo bibisect-win32-6.0.

https://git.libreoffice.org/core/+/d72e0cadceb0b43928a9b4f18d75c9d5d30afdda

Watermark: tdf#91687 correct size in the .doc

Export:
* Watermarks saved using Writer were very small in the MSO.
  Export fUsegtextFStretch property in the Geometry Text
  Boolean Properties.
* tdf#91687: SnapRect contains size of Watermark after rotation.
  We have to export size without rotation.

Import:
* When import set height depending on used font and width.
  Text will keep the ratio. Remember the padding for export.

* added unit test
* introduced enum to avoid magic numbers for stretch and best fit
  properties.

Change-Id: 
I3427afe78488d499f13c543ca401c096161aaf34
Reviewed-on: 
https://gerrit.libreoffice.org/38979
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Andras Timar <andras.timar@collabora.com>

This bug is a regression. The DOCX import/export was working well before this commit, but after that, it doesn’t work: Good catch!

In the second part of this series, we talk about how we can create a fix for the bug.


Hossein Nourikhah is the Developer Community Architect at the The Document Foundation (TDF), the non-profit behind LibreOffice. If you need assistance getting started with LibreOffice development, you can get in touch with him:

E-Mail: hossein@libreoffice.org

IRC: hossein in the IRC channel #libreoffice-dev on the Libera.Chat network connect via webchat

The Draw Guide 7.1 has arrived!

Led by Peter Schofield, the LibreOffice Documentation Team is proud to announce the release of the LibreOffice Draw Guide 7.1, the ultimate guide for LibreOffice Draw.

LibreOffice Draw produces anything from a quick sketch to a complex plan, and gives the means to communicate with graphics and diagrams. With a maximum page size of 300cm by 300cm, Draw is an excellent package for producing technical drawings, brochures, posters and many other documents. Draw manipulates graphical objects, group them, crop them, use objects in 3D and much more.

“The Draw guide update is long due in the set of LibreOffice Guides and I am happy to have coordinated the effort to bring it to the community. LibreOffice Draw is a powerful vector drawing tool plenty of resources and the Guide is the most comprehensive text on the features. I hope the Draw community will thrive with this book.”

Peter Schofield
Peter Schofield

The Draw Guide is available in PDF format and is part of the LibreOffice Library, a set of advanced guides for the LibreOffice productivity suite. Download other important LibreOffice guides in our Documentation website.

Meet the documentation team page!

Happy documenting!

LibreOffice Conference Sponsorship Package

By sponsoring the LibreOffice Conference you will have the opportunity to connect with one of the largest and most dynamic FOSS communities, with supporters, volunteers and users in every country in the world. The virtual event lasts for three days, from 23 to 25 September 2021. You can download the prospectus from this link: https://conference.libreoffice.org/assets/libocon2021/2021conferencesponsorship.pdf – And contact us here if you’re interested! #libreoffice #libocon

Announcement of LibreOffice 7.1.5 Community

Berlin, July 22, 2021 – LibreOffice 7.1.5 Community, the fifth minor release of the LibreOffice 7.1 family, targeted at technology enthusiasts and power users, is available for download from https://www.libreoffice.org/download/. LibreOffice 7.1.5 includes around 55 bug fixes, with 20% focused on Microsoft Office file compatibility (DOCX, XLSX and PPTX, and legacy DOCs).

For enterprise-class deployments, TDF strongly recommends the LibreOffice Enterprise family of applications from ecosystem partners, with long-term support options, professional assistance, custom features and Service Level Agreements: https://www.libreoffice.org/download/libreoffice-in-business/.

LibreOffice Community and the LibreOffice Enterprise family of products are based on the LibreOffice Technology platform, the result of years of development efforts with the objective of providing a state of the art office suite not only for the desktop but also for mobile and the cloud.

Products based on LibreOffice Technology are available for major desktop operating systems (Windows, macOS, Linux and Chrome OS), mobile platforms (Android and iOS) and the cloud. They may have a different name, according to each company brand, but they share the same LibreOffice unique advantages, robustness and flexibility.

Migrations to LibreOffice

The Document Foundation has developed a Migration Protocol to support enterprises moving from proprietary office suites to LibreOffice, which is based on the deployment of a LTS version from the LibreOffice Enterprise family, plus migration consultancy and training sourced from certified professionals who offer CIOs and IT managers value-added solutions in line with proprietary offerings. Reference: https://www.libreoffice.org/get-help/professional-support/.

Availability of LibreOffice 7.1.5 Community

LibreOffice 7.1.5 Community represents the bleeding edge in term of features for open source office suites. For users whose main objective is personal productivity and therefore prefer a release that has undergone more testing and bug fixing over the new features, The Document Foundation provides LibreOffice 7.0.6.

LibreOffice 7.1.5 change log pages are available on TDF’s wiki: https://wiki.documentfoundation.org/Releases/7.1.5/RC1 (changed in RC1) and https://wiki.documentfoundation.org/Releases/7.1.5/RC2 (changed in RC2).

LibreOffice Technology based products for Android and iOS are listed here: https://www.libreoffice.org/download/android-and-ios/, while for App Stores and ChromeOS are listed here: https://www.libreoffice.org/download/libreoffice-from-microsoft-and-mac-app-stores/

LibreOffice individual users are assisted by a global community of volunteers: https://www.libreoffice.org/get-help/community-support/. On the website and the wiki there are guides, manuals, tutorials and HowTos. Donations help us to make all of these resources available.

LibreOffice users are invited to join the community at https://ask.libreoffice.org, where they can get and provide user-to-user support. People willing to contribute their time and professional skills to the project can visit the dedicated website at https://whatcanidoforlibreoffice.org.

LibreOffice users, free software advocates and community members can provide financial support to The Document Foundation with a donation via PayPal, credit card or other tools at https://www.libreoffice.org/donate.

LibreOffice 7.1.5 is built with document conversion libraries from the Document Liberation Project: https://www.documentliberation.org.

LibreOffice’s New Website: Meet the Design Team

LibreOffice is getting a shiny new website! We’re still working on it, and everyone interested in testing and helping out can join our mailing list for updates.

But today, we’re talking to the team who created the new design. Say hello to Dan Gallagher, Cat de Leon, Irene Geller, Helen Tran and Zarema Ross. Together, they identified needs and use cases for the website, created mockups, and then moved on to more concrete designs. Let’s see what they have to say…


Tell us a bit about yourselves!

Dan Gallagher: I’m a UX Designer coming from a background in psychology and education. I’m interested in creating intuitive designs based on human psychology. I’m currently living in Chicago, IL. In my free time, I like to box, make music, or play Dungeons and Dragons.

Cat de Leon: My name is Cat and I’m from the San Francisco Bay Area. I have an untraditional background, having majored in math in college, worked in higher education as an institutional researcher, and recently worked as a social media manager. Luckily, I’ve found my dream job in product design! If I’m not designing, I’m probably eating good food, playing video games, playing tennis, watching NBA games, or working out. I will never reject an opportunity to see a picture of your pet. 🙂

Irene Geller: I’m a digital designer from New Jersey (USA) with a focus on UI, visual assets, and branding at the moment. But I began my creative life as a traditional artist, just painting, drawing, and teaching others, too!

Helen Tran: I’m from San Francisco, California. My hobbies include finding scenic sights and building on my UX Research career on the side. I’m a killer for awesome views!

Zarema Ross: Originally I’m from Russia. Today, I live and work in the USA as a UX designer. Before my career in design, I finished an MS in Economics and Management, conducted market research, analysis, and built strategies in the oil and gas industry. I’ve led 10 subsidiaries, approved budgets, and was involved in financial planning.

Being skilled in turning data into actionable information to improve business results, andbeing passionate about solving problems, I end up becoming a User Experience Designer. I get my inspiration from my hobbies such as traveling, Russian ballet, Broadway shows, contemporary art galleries, and digital trends (AR, VR, etc.).

I consider myself a dreamer and a futurist. I hope new technologies will bring enhancements into our everyday lives, and will offer the opportunity to all people around the world to use them. That is why today, I’m working on different UX design projects, helping the world become a better place.

New banner for the front page


How did you get involved in the LibreOffice website redesign project?

Dan Gallagher: I was connected with a member of the website redesign project through a friend. We hopped on a video call and discussed the project, and it sounded like a great opportunity! I had used LibreOffice before, and I really like the idea of giving free office tools away to anyone.

Cat de Leon: I was recruited by Christine Louie and Lisa Lin who did the initial research for LibreOffice’s redesign project. They brought on a team of designers and researchers to continue their work and bring their concepts to life.

Irene Geller: During the 2020 pandemic year, I attended several webinars about UX/UI, to keep myself occupied, fresh on industry knowledge, and to be quite honest, sane. Apparently, at one of these webinars- we don’t even remember which one!- I had connected with Christine Louie (who is now a UX Researcher at Facebook). I must have made a positive impression in the live comments section, because some time after the webinar, Christine reached out to me about volunteering to assist with LibreOffice’s website redesign project. Since I was already a user of LibreOffice in my day-to-day life, I thought it would be an interesting project to take on!

Helen Tran: I met Christine, who was the lead UX Researcher, through a webinar – and after getting to know each other she reached out to me for this amazing opportunity to join the LibreOffice website redesign project. I got to meet the rest of the team which included Lisa, Dan, Cat, Zarema, and Irene who were also all a pleasure to work with. Thanks to everyone who contributed as this team and the team at LibreOffice made this project such a success! 🙂

Zarema Ross: I was invited into the project by one of my colleagues from the UX bootcamp I went to. I liked LibreOffice’s mission to support the community and develop software that everyone can use. I’ve met an amazing team of software developers and UX designers. I really enjoyed working on the project, as it was well organized, and I had a chance to collaborate with cross-functional teams from software developers to the marketing team, as well as run workshops with them in order to improve the information architecture.

New graphics and cleaner design


What particular aspects did you work on, and what was it like?

Dan Gallagher: I focused more on the sketching, wireframing, and documentation of the project. It was my first time working on a team of designers and researchers – it was amazing to be able to share my work and get feedback at every stage of the design process. Every call, someone suggested something I wouldn’t have thought of if I were working alone. I was fortunate to be on a team of skilled and dedicated designers!

Cat de Leon: Before this project, I have only done solo projects so working with a team has been absolutely fantastic. I’ve enjoyed every conversation and meeting I’ve had with this team and I hope to continue our relationships after we’re all done here. I’ve also thoroughly enjoyed connecting with our stakeholders all over the world, like Ilmari, Heiko, and Mike! Our team would probably agree that we’ve gotten far more well versed in time zones after this project. 🙂

Irene Geller: I helped with creating high fidelity UI designs that captured our stakeholders’ key goals for various webpage designs. However, the best part of this project wasn’t working as an individual designer – but as a team!

We used Figma for all of our design work, which allows multiple users to collaboratively work on a design, in real-time. That was a new experience for me as I usually work as a “design team of one”. I found that we often came up with our best ideas when we worked together!

For example, one time we met up to look over the page designs that Cat, Dan, and Zarema had completed. I immediately saw which elements worked best in each approach (ie what fit the stakeholders’ goals best), and quickly combined them together in one new page design, with adjustments to make it all cohesive. Everyone responded positively, so we spent the remainder of the meeting polishing all the elements of this new design. When we presented it at our next stakeholder meeting, they absolutely loved it – an immediate success! That showed me the power of collaborative design.

Overall, it was a real pleasure to work with such talented and smart individuals for a good cause. It certainly made the pandemic lockdown a little brighter, too!

Helen Tran: I worked as a UX Researcher for this project. I helped recruit participants, ran usability tests, and interpreted data to test the projected website launches. It was an amazing experience! It was definitely enjoyable to see the combined efforts made by everyone on this team go into play during the usability runs to witness how individuals engaged with the various features. This experience was rewarding from start to finish seeing the behind the scenes work to a polished website based on all of our hard efforts.

Zarema Ross: Working within an international team of UX designers and Software developers (in the USA and Germany), I:

  • Led design workshops with cross-functional teams to explore innovative solutions for problems and opportunities identified through research and data
  • Performed content audit, validated the SiteMap, restructured the information architecture
  • Sketched designs, created low and hi-fi mockups
  • Iterated on designs and performed usability testing
  • Contributed and maintained the UI kit and style guides

At the end of the day, it was teamwork that drove us to the results we have. I would like to say special thanks to our UX design team: Helen Tran – the time we spent on usability testing, deriving the insights from the research; Dan Gallagher, Cat de Leon and Irene Geller- for the brainstorming we did together, going from lo-fi to hi-fi designs.

And a redesigned download page


What are you interested in doing next?

Dan Gallagher: I’ll continue freelancing, working on personal projects, and searching for a full-time job. Working on this project was a great experience to highlight on my resume, it shows I work well within a team and can balance user and business needs!

Cat de Leon: Now I’m a product Designer for CaaStle. And I just know that wherever I go in future, I’ll be solving users’ problems to the best of my product design abilities and I’ll be having a blast doing it. Thank you so much for this opportunity, LibreOffice!

Helen Tran: I’m interested in growing my UX Research career! I’m ready to dive deep and hop along new projects to learn and enhance my UX skills. Hoping for many more grateful experiences like this project! 🙂

Zarema Ross: I’m interested in the topic of accessibility and inclusive design. I’m currently working on Accessifier which is a crowdsourced web app that provides accessibility ratings of specific apps for users with accessibility needs. I also do UX design on a freelance basis. And I’m looking forward to collaborating with new people, exchange knowledge and create impactful designs. Here’s my LinkedIn page.


Many thanks again to the whole team for their work! And as mentioned, anyone can join our website mailing list to help us to finalise, test and promote the new website. Let’s make it happen together!

Community Member Monday: Jackson Cavalcanti Junior

Today we’re talking to Jackson Cavalcanti Junior, who’s active in the LibreOffice documentation community and was recently awarded a custom badge for his work

Tell us a bit about yourself!

I am Brazilian, from the city of Olinda, Pernambuco. I am 62 years old, and work as a public servant in the municipality of Olinda. I am one of the creators of the Municipal Public Archive of Olinda. I am also a human rights activist, especially for LGBT people. I am a proofreader and I also write for my blog.

In my work, in the city of Olinda, since 2001 I have been working with free office software, having started with OpenOffice.org, then with BrOffice and LibreOffice Writer, with which I created several models of documents to be used by the agencies that are part of the administrative structure of the Municipality of Olinda. These models remained on the City Hall’s intranet until 2016, when in that year’s elections another political party was elected, and that project was discontinued.

As a citizen, I am an activist in the LGBT movement, in which I have worked since 1980, when I helped found the Homosexual Action Group (GATHO), which was the first group in Pernambuco to fight in defense of citizenship for homosexual people. This group no longer exists, but I am a member of the LGBT Forum of Pernambuco, where I work as an independent activist, to which I was invited by my history as an activist for the LGBT cause in the state where I reside.

I also advertise LibreOffice among my friends, in the institutions where I work, and also in the WhatsApp and Telegram groups.

I like to photograph my city, my animals and nature.

What are you working on in the LibreOffice project right now?

I am currently working on the team of proofreaders for Brazilian translations of LibreOffice documentation.

Why did you decide to become a member of The Document Foundation, the non-profit behind LibreOffice?

Because, still at the time of BrOffice, I was the creator of the User Group for the software in my state. After I joined the team of Brazilian reviewers for the LibreOffice documentation, I felt it was time to request my entry as a member of TDF. I was very happy when I heard that I was approved as a member of the foundation.

Anything else you plan to do in the future? What does LibreOffice
really need?

For the future, in addition to continuing to revise the new LibreOffice guides, I will further encourage the use of this software.

Thanks a lot to Jackson for his contributions and help in our projects! All LibreOffice users are welcome to find out what they can do for LibreOffice, and build up useful skills at the same time…