Welcome to The Document Foundation Planet

This is a feed aggregator that collects what LibreOffice and Document Foundation contributors are writing in their respective blogs.

To have your blog added to this aggregator, please mail the website@global.libreoffice.org mailinglist or file a ticket in Redmine.


Monday
11 March, 2024


face

General Activities

  1. LibreOffice 7.6.5 was released on February 22
  2. LibreOffice 24.2.1 was released on February 29
  3. Olivier Hallot (TDF) added help content for Calc’s XLOOKUP and XMATCH functions, Navigate By in Find toolbar, Draw’s Shrink text on overflow and did many fixed and cleanups in Help
  4. Rafael Lima made it so selected text in the BASIC editor is automatically inserted into the search bar, added a command for toggling code block commenting in BASIC IDE and fixed an issue where Duplicate Sheet command might create the sheet in the wrong file, if having two open files with the same name
  5. Stanislav Horacek updated command paths in Help
  6. Stéphane Guillou (TDF) updated command paths in Help
  7. Alain Romedenne updated ScriptForge Help pages, updated Python shell script Help for macOS and improved Python example in SDK
  8. Dione Maddern did many fixes and updates to Help pages, mostly fixing links
  9. Gábor Kelemen (allotropia) made some cleanups in Help and in UI and UNO bridges code
  10. Laurent Balland fixed an issue with skip empty cells option not working for the last column in Calc Text Import dialog, made it so custom number formats using the ? character replace trailing zeroes with figure spaces which have a width approximating a digit and removed unneeded thumbnail.png images from Wizard templates
  11. Miklós Vajna (Collabora) added legal numbering support for DOC and RTF files, made Calc HTML import support data-sheets attributes, made Calc’s cell editing accept pasted HTML fragments, made DOCX content control handling more robust and continued polishing floating table support
  12. Szymon Kłos, Gülşah Köse, Marco Cecchetti, Gökay Şatır, Pranam Lashkari, Michael Meeks and Méven Car (Collabora) worked on LOKit used by Collabora Online
  13. Attila Szűcs (Collabora) fixed PPTX issues with multiline field wrapping and stacked text
  14. Henry Castro (Collabora) tweaked Calc’s background colour filter to not extend transparent colours to empty cells and fixed an issue with Sidebar not displaying the full localised currency string for cell properties
  15. Tomaž Vajngerl (Collabora) made it so the currencies used in a spreadsheet are put at the top of the currency pop-up list, made pivot table data cache handling smarter and improved the handling of XLS documents with unknown DRM encryption (mainly due to some Excel addons)
  16. Julien Nabet fixed an issue where Data validation without error check allowed entering incorrect data, fixed LOWER not being supported in Base’s Query-GUI if condition was LIKE and fixed an issue with Calc Macro setting SearchWildcard to False changing SearchRegularExpression value. He also fixed some crashes
  17. Andreas Heinisch made Calc’s Autofilter sorting and removing duplicates more robust and made it so a single click is enough to access options through Calc’s status bar
  18. Xisco Faulí (TDF) made over a dozen additions and changes to automated tests, improved dark mode support of Writer comment UI, fixed an issue with Autofilter empty option, made SVG text baseline handling more intuitive, added support

face

Git Git Git Git Git Git Git

What do I want to achieve

It’s important to set some target before jumping into and starting to do the thing. I would like to make an annoying “Donate Now” dialog

  • The dialog would show up whenever the user starts libreoffice, or whenever he switches to different modules like calc or writer etc.

  • The dialog would look something like the mockup shown below. The dialog should have a faint background image which shows all the community members, to give out cheerfull vibes. Other than that it would have a text which would be some interesting fact about libreoffice.

  • It would have an image on the top, and a “donate now” and a “close” button on the bottom It would also have a checkbox saying “I am broke”, which would be unchecked by default. If the user checks it, then the dialog will stop asking for monitory donations, and instead pester the user with “Other Ways To Contribute”, which would include all the getting involved stuff.

  • Other than that It would also have an “I don’t care” checkbox, which will be unchecked by default, and if checked, the dialog won’t show up again, and then one has to reactivate it from about > user-hostile-donation-dialog.

Git

This would makeup for a nice and fun learning experience. It would involve playing around with the UI, listeners, strings, “the user centiments” etc.

It’s not a rigid outline, but rather an idea to atleast get started. Patch on gerrit.

Starting with the UI

I will start with understanding how the about dialog is implemented, how does it display images and custom text etc. One thing that I noticed previously is that the “Tip Of The Day” dialog uses GtkDrawingArea while the about dialog uses GtkImage.

I asked on the #gtk IRC channel, and found that GtkImage is an image loaded from the disk at a specific size, while GtkDrawingArea is a canvas you draw on using cario.

This might have been the reason for why Libreoffice was carshing when I used GtkImage while trying to recreate the “Tip Of The Day” dialog. There I just created a bare constructor, without specifying the image.

Well for the user hostile dialog, GtkImage would work fine as I don’t need to change the image on the go.

Creating a Dialog

I created a dialog box using glade. The challenge that I faced was that I was not able to move the checkboxes in the ButtonBox of the GtkDialog to the left side. All 4 controls were stuck together. Then I looked into how the tip-of-the-day dialog does it, and there I found that whatever control I wanted to left align (in the button box), I had to turn on the packing > secondary control. What that is, I am still to investigate into.I got this Documentation Reference from the #gtk IRC channel.

For some reason, the dialog doesn’t carsh now :). Other issue that I faced was related to text wrapping. So if I set


Friday
01 March, 2024


face

Writer now supports legal numbering for two more formats: DOC and RTF (ODT and DOCX were working already.)

This work is primarily for Collabora Online, done as a HackWeek project, but the feature is fully available in desktop Writer as well.

Motivation

Legal numbering is a way to influence the number format of values inherited in a multi-level numbering. Say, the outer numbering uses Roman numerals and the inner numbering uses X.Y as the number format, but the inner level wants to display the outer values as Arabic numerals. If this is wanted (and guessing from the name, sometimes lawyers do want this), then the inner number portion will expand to values like "2.01" instead of "II.01", while the outer number portions will remain values like "II".

Mike did 80% of the work, what you can see here is just the RTF/DOC filters.

Picking a smaller feature task like this looked like a good idea, since I wanted to spend some of the time on regression fixing around last year's multi-page floating table project.

Results so far

For (binary) DOC, the relevant detail is the fLegal bit in the LVLF structure. Here is the result:

Improved handling of legal numbering from DOC: old, new and reference rendering

It shows how the outer "II" gets turned into "2", while it remained "II" in the past. This works for both loading and saving.

The same feature is now handled in the RTF filter as well. There the relevant detail is the \levellegal control word, which has an odd 1 default value (the default is usually 0). Here is the result:

Improved handling of legal numbering from RTF: old, new and reference rendering

It shows that the RTF filter is up to speed with the DOC one by now.

As for the multi-page floating tables, I looked at tdf#158986 and tdf#158801.

How is this implemented?

If you would like to know a bit more about how this works, continue reading... :-)

As usual, the high-level problem was addressed by a series of small changes:

Want to start using this?

You can get a snapshot / demo of Collabora Office 24.04 and try it out yourself right now: try the unstable snapshot. Collabora intends to continue supporting and contributing to LibreOffice, the code is merged so we expect all of this work will be available in TDF's next release too (24.8).


Thursday
29 February, 2024


face

If you copy contents from LibreOffice Writer to a plain text editor like gedit or Notepad, you will see that it does a straightforward thing: It copies the text and some basic formatting like converting bullets to ‘•’. For the Writer tables, the conversion is very simple right now: every cell is written in a separate line.

For example, if you have a table like this:

A | B
--|--
C | D

When you copy the table from LibreOffice Writer and paste it into a plain text editor, it will become something like this, which is not always desirable.

A
B
C
D

It is requested that like LibreOffice Calc, or Microsoft Word, and many other programs, the copy/paste mechanism should create a text like this:

A	B
C	D

The columns are separated by <tab>.

This feature request is filed in Bugzilla as tdf#144576:

Code pointers for Handling Writer tables

There are many steps in copy/pasting, including the data/format conversion and clipboard format handling. Here, you have to know that the document is converted to plain text via “text” filter.

The plaintext (ASCII) filter is located here in the LibreOffice core source code:

Therefore, to change the copy/paste output, you have to fix the ASCII filter. That would also provide the benefit that plain text export will be also fixed as requested here.

In this folder, there are a few files:

$ ls sw/source/filter/ascii/
ascatr.cxx parasc.cxx wrtasc.cxx wrtasc.hxx

To change the output, you have to edit this file:

In this file, there is a loop dedicated to create the output.

// Output all areas of the pam into the ASC file
do {
    bool bTstFly = true;
    ...
}

Inside this loop, the code iterates over the nodes inside the document structure, and extracts text from them. To check for yourself, add the one line below to the code, build LibreOffice, and then test. You will see that a * is appended before each node.

SwTextNode* pNd = m_pCurrentPam->GetPoint()->GetNode().GetTextNode();
if( pNd )
{
+   Strm().WriteUChar('*');
    ...
}

For example, having this table, with 1 blank paragraph up and down:

A | B
--|--
C | D

You will get this after copy/paste into a plain text editor:

*
*a
*b
*c
*d
*

To fix the bug, you have to differentiate between table cells and other nodes. Then, you should take care of the table columns and print tab between them.

To go further, you can only add star before table cells:

if( pNd )
{
    SwTableNode *pTableNd = pNd->FindTableNode();
+   if (pTableNd)
+   {
+       Strm().WriteUChar('*');
+    }
    ...
}

You can look into how other filters handled tables. For example, inside sw/source/filter/html/htmltab.cxx you will see how table is managed, first cell is tracked and appropriate functions to handle HTML table are called.

For the merged cells, the EasyHacker should first checks the behavior in


Thursday
22 February, 2024


face

When working with LibreOffice Impress, “Slide Master” is the place where you can change the templates used for different types of the slides used in your presentation. Here we discuss a possible improvement for the “Slide Master” by making the copy from master slides possible.

Copying the Master Page in Impress

To see the problem and the room for enhancement, open LibreOffice Impress, then choose “View->Master->Slide Master” from the menus. Then, try to copy the master page on the left in the slide sorter. Unfortunately, it is not possible.

Impress slide master

Impress slide master

Having this feature is helpful, because different page types have many things in common, and being able to copy/paste helps creating templates much faster.

Impress Code Pointers

Looking into sd/source/core/drawdoc3.cxx, you can see a huge function SdDrawDocument::InsertBookmarkAsPage, which is relevant here. It contains ~600 lines of code. This huge function is in itself a problem. Therefore, to implement the enhancement, on should try to first refactor the function, then add a unit test in sd/qa/unit, find and then separate all the ~6 use cases, and fix the style/name merging.

After the cleanup, the main fix should be implemented. The suggested path to implement this comes from Jean-Francois. He suggest to improve the duplicate() method, which is described in the documentation:

As described in the above documentation, its role is to duplicate a page:

Creates a duplicate of a DrawPage or MasterPage, including the Shapes on that page and inserts it into the same model.

However, the implementation does not work for master slides, as the macros in the attachment file implies. The solution should add the needed implementation for master slides.

The implementation is inside sd/source/ui/unoidl/unomodel.cxx inside duplicate function:

// XDrawPageDuplicator
uno::Reference< drawing::XDrawPage > SAL_CALL SdXImpressDocument::duplicate( const uno::Reference< drawing::XDrawPage >& xPage )
{

...

}

Final Words

The above issue is filed as tdf#45617. If you like to work on it, just follow the Bugzilla link to see more information.

To implement this feature, first you have to build LibreOffice from the sources. If you have not done that yet, please refer to this guide first:

Getting Started (Video Tutorial)


Tuesday
13 February, 2024


face

General Activities

  1. LibreOffice 24.2 was released on January, 31
  2. Olivier Hallot (TDF) fixed a duplicate Covariance command in Notebookbar UIs, updated menu item paths in Help pages and updated Help pages for conversion filters and style Spotlight
  3. Rafael Lima added a Color Scheme switcher to Basic IDE, added a “Delete Comment” command to the Navigator context menu, fixed drawing comment triangles in Calc at all zoom levels, made it so the visibility of UI components in the Basic IDE is remembered, made Basic IDE highlight the line where the cursor is positioned, made it possible to open the “Go to Line” dialog from the statusbar in Basic IDE, fixed Calc AutoFilter arrow color in dark mode, made it so line numbering and breakpoint in Basic IDE are on the left even in right-to-left UI and fixed a crash in Dialog Editor. He also improved the ScriptForge Help pages
  4. Stanislav Horacek updated menu paths in Help alongside other cleanups and fixes
  5. Ilmari Lauhakangas (TDF) removed unnecessary images from SVG icon themes, saving nearly 5 MB of space. He also changed the Help CSS to account for a quirk in Safari
  6. Stéphane Guillou (TDF) continued linking Sidebar decks to Help
  7. Alain Romedenne updated ScriptForge Help pages
  8. Dione Maddern did many fixes and updates to Draw dialog Help pages
  9. Gábor Kelemen (allotropia) added accessible descriptions to new Dublin Core metadata boxes, updated Help after removal of FTP protocol support and did code cleanups in the area of code simplification and includes
  10. Laurent Balland did cleanups in the metadata of Impress templates
  11. Miklós Vajna (Collabora) fixed the layout handling of empty paragraphs formatted as superscript in Writer, added support for HTML paste to Writer shape text or Calc cell text edit and continued polishing support for multi-page floating tables in Writer
  12. Jean-Pierre Ledure worked on the ScriptForge library
  13. Gabriel Masei (1&1), Paris Oplopoios, Szymon Kłos, Méven Car, Andras Timar, Attila Szűcs and Áron Budea (Collabora) worked on LOKit used by Collabora Online. Andras also fixed some FreeBSD build issues while Attila fixed hyperlink colouring in certain PPTX files and a textbox vertical alignment inversion issue when saving PPTX files
  14. Henry Castro (Collabora) made the status bar in Calc work as expected with language selection
  15. Eike Rathke (Red Hat) made it so the maximum number of hours that can be entered into a Calc cell with time formatting is now a 32-bit integer instead of 65535
  16. Tomaž Vajngerl (Collabora) continued refactoring the EditEngine text editing code
  17. Julien Nabet fixed an issue preventing some position parameters to go beyond 17 mm in Writer, fixed an issue that made ReportBuilder wizards show two different data sources, fixed several crashes and did code cleanups
  18. Andreas Heinisch made it so font, highlight and background colour in toolbar buttons is remembered between sessions, fixed canceling Text Import in Calc locking the document and made it so question mark can be used in autotext shortcuts
  19. László Németh continued polishing support for

Sunday
11 February, 2024


face


After a long slog since November when the previous version of coverity was EOLed and we had to start using 2022.6.0 with its new suggestions for std::move etc, LibreOffice is now finally back to a 0 warnings coverity state


Tuesday
06 February, 2024


face

This post describes some challenges around having multiple views of one opened document in LibreOffice core, when those views belong to LOK views, representing different users, with their own language, locale and other view settings.

This work is primarily for Collabora Online, but is useful for all clients of the LOK API.

Motivation

LOK views are meant to represent separate users, so we need to make sure that when a user sets their preferences and trigger an action, then the response to that action goes to the correct view, with the correct view settings.

This is different from the desktop LibreOffice use-case, where multiple windows are still meant to share the same user name, language, undo stack and so on.

Results so far

In this post, I would like to present 4 small improvements that recently happened to the LOK API to provide this wanted separation of views.

The first was an issue where two users were editing the same document, one busily typing and the other clicked on a link in Calc. What could happen sometimes is the link popup appeared for the user who typed, not for the user who clicked on the link:

Link popup is actually on the left, should be on the right, now fixed

This specific problem can be fixed by making sure that link click callbacks are invoked synchronously (while the clicking view is still active) and not later, when the current view may or may not be the correct one.

It turns out the same problem (async command dispatch) affects not only hyperlinks, but many other cases as well, where we want to stay async, for example, when one dialog would invoke another dialog, like the Calc conditional format -> add dialog:

Calc conditional format add dialog appearing on the left, should be on the right, now fixed

There you don't want to change async commands into sync commands, because that may mean spinning the main loop inside a dialog, resulting in nested main loops. This can be fixed by making sure that async commands to be dispatched (sfx2 hints in general) are processed in a way that the current view at dispatch & processing is the same, which is now the case.

The third problem was around wrong language & locale in the status bar:

Unexpected English strings in localized statubar UI, now fixed

This is not simply a problem of missing translation, the trouble was that the status bar update is also async and by the time the update happened, the locale of the view on the left was used, for a string that appears on the right.

The way to fix this is to perform the update of toolbars/statusbar/etc (in general: SfxBindings) in a way that the language at job schedule time and at UI string creation time is the same.

The last problem was quite similar, still about bad language on the UI, but this time on the sidebar:

Unexpected English strings in localized sidebar UI, now fixed


Sunday
04 February, 2024


face

In this blog post, I discuss gbuild for Java tests. The goal is to write a Makefile to compile and run a JUnit test for LibreOffice. You can also refer to part 1 and part 2 for a brif overiew on gbuild, the LibreOffice build system.

Macro Examples from gbuild for Java Tests

In the first post on gbuild, I have mentioned some macro examples including gb_Output_announce which was used to print nice messages like the ones including “[CXX]”. Now let’s explain some more macros related to Java tests.

Consider that you want to compile and run a JUnitTest. To do that, you need to write the test in a Java file, and create a Makefile to run that.

This is an example for running a test defined in Java file sw/qa/complex/indeterminateState/CheckIndeterminateState.java.

$(eval $(call gb_JunitTest_JunitTest,sw_complex))

$(eval $(call gb_JunitTest_add_sourcefiles,sw_complex,\
sw/qa/complex/indeterminateState/CheckIndeterminateState \
))

$(eval $(call gb_JunitTest_use_unoapi_jars,sw_complex))

$(eval $(call gb_JunitTest_add_classes,sw_complex,\
complex.indeterminateState.CheckIndeterminateState \
))

The make file for running this Java test consists of calling multiple macros. It starts with gb_JunitTest_JunitTest macro, which defines the test by its name, sw_complex. This macro is defined in solenv/gbuild/JunitTest.mk. If you grep for define in the same file, you will see this result:

$ grep -w define solenv/gbuild/JunitTest.mk
define gb_JunitTest_JunitTest
define gb_JunitTest_set_defs
define gb_JunitTest_add_classes
define gb_JunitTest_add_class
define gb_JunitTest_add_sourcefile
define gb_JunitTest_add_sourcefiles
define gb_JunitTest_use_jar
define gb_JunitTest_use_jars
define gb_JunitTest_use_jar_classset
define gb_JunitTest_add_classpath
define gb_JunitTest_use_system_jar
define gb_JunitTest_use_system_jars
define gb_JunitTest_use_external
define gb_JunitTest_use_externals
define gb_JunitTest_use_customtarget
define gb_JunitTest_use_customtargets
define gb_JunitTest_use_unoapi_jars
define gb_JunitTest_use_unoapi_test_class
define gb_JunitTest_set_unoapi_test_defaults
define gb_JunitTest_JunitTest

To stick to the macros used in the above example, I describe these macros:

gb_JunitTest_add_sourcefiles: This macro adds a Java source file to the test. It defines the code that adds the sw/qa/complex/indeterminateState/CheckIndeterminateState.java to the test. But please note that you should drop the .java extension:

$(eval $(call gb_JunitTest_add_sourcefiles,sw_complex,\
sw/qa/complex/indeterminateState/CheckIndeterminateState \
))

The other macro gb_JunitTest_use_unoapi_jars, adds the UNO API JAR files to be used with the test.

And in the end, you need to add the test class name using gb_JunitTest_add_classes macro. The class name is visible in the end.

The result can be quite complex, but it works. 🙂

java.exe -Xmx64M -classpath "$W/JavaClassSet/JunitTest/sw_complex;C:/cygwin64/home/user/lode/opt/share/java/junit.jar;$I/program;$W/Jar/OOoRunner.jar;$I/program/classes/libreoffice.jar;$W/Jar/test.jar" -Dorg.openoffice.test.arg.soffice="path:$I/program/soffice" -Dorg.openoffice.test.arg.env=PATH="$PATH" -Dorg.openoffice.test.arg.user=file:///$W/JunitTest/sw_complex/user org.junit.runner.JUnitCore complex.indeterminateState.CheckIndeterminateState

The above is the actual command that runs the test. Please note that if you forget the gb_JunitTest_add_classes macro to define the class name, the test may compile, but it will not run.

As an example, you can see the below patch. This patch fixes the problem of the JUnit test not running:

Final Words

Many macros are available in gbuild, making easier


Thursday
25 January, 2024


face

In the first blog post on LibreOffice build system, gbuild which uses GNU Make, I discussed some of the features of it. Here I discuss more about some gbuild tips and tricks that you may need.

Building a Single Module

In order to build a single module, you need to use its name. For example, to build only “odk”, which contains office development kit, you only have to type:

make odk

On the other hand, there are many other build targets associated with odk. By typing make odk, and then pressing tab, you will see this list, which shows possible targets:

odk odk.buildall odk.perfcheck odk.uicheck odk.all odk.check odk.screenshot odk.unitcheck odk.allbuild odk.checkall odk.showdeliverables odk.allcheck odk.clean odk.slowcheck odk.build odk.coverage odk.subsequentcheck

Each of the above is related to a specific task, in which many of them are common on different modules. Let’s discuss some of them:

make odk -> Builds odk module.

make odk.clean -> Cleans the odk module, removing the generated files.

make odk.check -> Runs test in odk module

make odk.uicheck -> It runs UI tests inside odk module

make odk.perfchek -> Runs performance/callgrind tests inside odk module

make odk.screenshot -> Creates screenshots inside odk module

To get a complete list and detailed description, run make help.

Handling Incomplete Builds

Sometimes because of OS crash or power outage, you may face problems when a build is stopped forcefully. In that case, you may see several zero byte object (*.o) files that exist, and prevent a successful build. In that case, you can find and remove them using this command:

$ rm `find -name *.o -size 0`

After that, you can retry your build without the above problem.

Customizing Build Configuration

The process of creating Makefile starts from configuring LibreOffice for build. This is done by invoking ./autogen.sh. The configuration parameters are read from autogen.input. The build configuration is done via configure.ac, which is an input for GNU autoconf.

There are various steps before the Makefiles are generated. For example, in order to make sure that a library is there when configuring the build, a very small C/C++ file is created, compiled and tested to ensure that the library is ready, and available to use with C/C++ code.

It is also possible to check for some specific version of library, and available functions. As an example, see this patch, which checks for specific version of ZXing library:

In the above example, multiple situations are handled:

1) When there is no ZXing library

2) When system ZXing library is used

And also, it is checked that specific version of ZXing is available:

1) When ZXing::ToSVG is not usable

2) When ZXing::ToSVG is usable

Then, the HAVE_ZXING_TOSVG symbolic constant is used in config_host/config_zxing.h.in, which can be used in C++ code.

Knowing More About gbuild

If you are interested in knowing more about


face

Firebird Project is happy to announce general availability of Firebird 5.0 — the latest major release of the Firebird relational database for Windows, Linux, MacOS and Android platforms.This release introduces improvements in areas of performance, multithreaded processing (including backup, restore, sweep), SQL queries profiling, with better scalability and numerous enhancements in SQL


Tuesday
16 January, 2024


face

LibreOffice 24.2 – with a new year.month versioning scheme – will be released as final at the beginning of February, 2024 ( Check the Release Plan ) being LibreOffice 24.2 Release Candidate 2 (RC2) the forth pre-release since the development of version 24.2 started in mid June, 2023. Since the previous release, LibreOffice 24.2 RC1, 113 commits have been submitted to the code repository and 61 issues got fixed. Check the release notes to find the new features included in this version of LibreOffice.

LibreOffice 24.2 RC2 can be downloaded for Linux, macOS and Windows, and it will replace the standard installation.

In case you find any problem in this pre-release, please report it in Bugzilla ( You just need a legit email account in order to create a new account ).

For help, you can contact the QA Team directly in the QA IRC channel or via Matrix.

LibreOffice is a volunteer-driven community project, so please help us to test – we appreciate it!

Happy testing!!

Download it now!


Friday
12 January, 2024


face

Using comments is a key feature in text processing. A typical workflow might be to review a document where notes are made by different colleagues. LibreOffice Writer currently shows these comments in the document margin, which is limited to the page height, ending up in the need to scroll long text (even while editing [1]) and eventually in paging-like interactions if the number of comments exceed the total size.…


face

General Activities

  1. LibreOffice 7.5.9 and 7.6.4 were announced on December 7
  2. Olivier Hallot (TDF) updated menu item paths in Help pages and updated and restructured dozens of help pages
  3. Rafael Lima fixed line count width in Writer file properties dialog, added a button leading to Download page in the dialog showing up if trying to access Help without offline files available and made it possible to enter edit mode for comments in Calc via Navigator. He also updated ScriptForge help and added a Help page about installing offline Help
  4. Stanislav Horacek did many fixes and cleanups in Help pages
  5. Ilmari Lauhakangas (TDF) made it so multi-selection is no longer possible in Start Center as it is not actionable. He also streamlined the navigation layout of Help
  6. Stéphane Guillou (TDF) linked Sidebar decks to Help and did other Help updates
  7. Alain Romedenne updated ScriptForge help pages
  8. Dione Maddern updated Help for Draw’s Consolidate Text functionality
  9. Sophia Schröder did many cleanups in Help
  10. Gábor Kelemen (allotropia) added support for XF86Forward / XF86Back key events for use in Impress slideshows and did code cleanups in the area of unused config keys and includes
  11. Laurent Balland did many fixes in Impress templates, collaborating with Jérôme Bouat
  12. Miklós Vajna (Collabora) worked on multi-page floating tables in Writer. He also updated pdfium and did fixes to automated tests
  13. Jean-Pierre Ledure worked on the ScriptForge library
  14. Michael Meeks (Collabora) fixed a deadlock
  15. Szymon Kłos, Áron Budea and Gökay Şatır (Collabora) worked on LOKit used by Collabora Online
  16. Nick Wingate (Collabora) added an option to define ranges when exporting Calc sheets to PDF
  17. Henry Castro (Collabora) made it so an error dialog pops up in Calc, if trying to insert a row after the maximum one
  18. Eike Rathke (Red Hat) fixed an issue with unwanted deletion of data ranges in Calc
  19. Tomaž Vajngerl (Collabora) streamlined the OOXML import of headers/footers in page styles, made handling of embedded SVGs in FODT files more robust and added support for writing SVG images into OOXML using the MS OOXML extension. He also did lots of refactoring in the EditEngine text editing code
  20. Julien Nabet fixed an issue with changing field options in Firebird databases, implemented more user management functionality for MySQL and MariaDB databases, made colour handling more robust in sparklines, fixed an issue with stepped line types in XY scatter charts and fixed StepTime being ignored with AnimatedImages in Basic Dialog (together with bug reporter Jurassic Pork). He also fixed crashes and many issues found by static analysers and did many code cleanups
  21. Andreas Heinisch made Mail Merge more robust with regards to database names
  22. László Németh continued polishing support for smart justify found in DOCX files and fixed an issue with soft hyphens not being displayed in text boxes and shapes
  23. Xisco Faulí (TDF) did many improvements and additions to automated tests and fixed regressions
  24. Michael Stahl (allotropia) revamped ODF encryption resulting in

Tuesday
09 January, 2024


face

LibreOffice 24.2 – with a new year.month versioning scheme – will be released as final at the beginning of February, 2024 ( Check the Release Plan ) being LibreOffice 24.2 Release Candidate 1 (RC1) the third pre-release since the development of version 24.2 started in mid June, 2023. Since the previous release, LibreOffice 24.2 Beta1, 158 commits have been submitted to the code repository and 59 issues got fixed. Check the release notes to find the new features included in this version of LibreOffice.

LibreOffice 24.2 RC1 can be downloaded for Linux, macOS and Windows, and it will replace the standard installation.

In case you find any problem in this pre-release, please report it in Bugzilla ( You just need a legit email account in order to create a new account ).

For help, you can contact the QA Team directly in the QA IRC channel or via Matrix.

LibreOffice is a volunteer-driven community project, so please help us to test – we appreciate it!

Happy testing!!

Download it now!


Wednesday
03 January, 2024


face

Now that year 2024 has come, I want to briefly discuss the year 2023 around the development blog, and the outlook for 2024 here.

My goal is to help people understand LibreOffice code better, and ultimately get involved in LibreOffice core development to make LibreOffice better for everyone. In 2023, I wrote 23 posts around LibreOffice development in the dev blog (3 of them are unpublished drafts).

At The Document Foundation (TDF), our aim is to improve LibreOffice, the leading free/open source office software that you and many other people around the world use. Our work is community-driven, and we need your help.

LibreOffice conference 2023

LibreOffice conference 2023

Outlook For the New Year

My focus for 2024 in this blog will be:

  1. Introducing new EasyHacks
  2. Discussing how to fix crashes
  3. Explaining LibreOffice architecture
  4. Describing user interface creation with VCL
  5. Explaining LibreOffice extensions

You can give feedback by writing a comment here, or sending an email to hossein AT libreoffice DOT org.

I provide mentoring support to those who want to start LibreOffice development. You are welcome to contact me if you need help to build LibreOffice and do some EasyHacks via the above email address.

I hope the best for you in the new year 2024.


face

This post is part of a series to describe how Writer now gets a feature to handle tables that are both floating and span over multiple pages.

This work is primarily for Collabora Online, but is useful on the desktop as well. See the 10th post for the previous part.

Motivation

Previous posts described the hardest part of multi-page floating tables: making sure that text can wrap around them and they can split across pages. In this part, we'll look at a case where that content is not just text, but the wrapping content itself is also a table.

Results so far

Regarding testing of the floating table feature in general, the core.git repository has 92 files now which are focusing on correct handling of floating tables (filenames matching floattable-|floating-table-). This doesn't count cases where the document model is built using C++ code in the memory and then we assert the result of some operation.

Here are some screenshots from the improvements this month:

Improved click handling near the first page of a floating table

The first screenshot shows a situation where the mouse cursor is near the right edge of the first page of a floating table. What used to happen is we found this position close to the invisible anchor of the floating table on that page, then corrected this position to be at the real anchor on the last page. In short, the user clicked on one page and we jumped to the last page. This is now fixed, we notice that part of the floating table is close to the click position and we correct the cursor to be at the closest position inside the table's content.

A floating table, wrapped by an inline table: old, new and reference rendering

The next screenshot shows a floating table where the content wrapping around the table happens to be an inline table. You can see how such wrapping didn't happen in the past, and the new rendering is close to the reference now.

How is this implemented?

If you would like to know a bit more about how this works, continue reading... :-)

As usual, the high-level problem was addressed by a series of small changes:

Want to start using this?

You can get a snapshot / demo of Collabora Office 23.05 and try it out yourself right now: try the unstable snapshot. Collabora intends to continue supporting and contributing to LibreOffice, the code is merged so we expect all of this work will be


Thursday
21 December, 2023


face

In the previous part of the series on C/C++ strings, I described the string literal, plus how and why to use them. Then I introduced the new custom string literals and their benefits:

Using the New Custom O[U]String Literals

In this post, I am going to discuss two EasyHacks dedicated to the use of the new O[U]String literals in the code.

For tdf#158067, the idea is to use _oustr and _ostr suffixes instead of defining O[U]StringLiteral variables, and using them later.

For example,

OUString foo = "abc";

Becomes:

static constexpr OUStringLiteral FOO_STR = "abc";
...
OUString foo(FOO_STR);

The first line is using a compile time constant, but it is not clean, easy and not always desirable. After the introduction of the new shortcuts _ustr and _ostr, there is a new way to to create string literals in shorter form, available with C++20 standard. As C++20 is now the baseline for LibreOffice code, the new way is usable in the LibreOffice code.

For tdf#158068, the goal is to avoid C string literals, and replace those literals with the new O(U)String literals with appropriate prefixes. The benefit of doing that is to avoid run-time initialization of O[U]Strings, and do it in the compile time.

OUString foo("abc");

should become:

OUString foo(u"abc"_ustr);

Don’t Change Every O[U]String literal!

There are tests for O[U]StringLiterals that should not be touched at the moment. Eventually, developers will change them alongside the O[U]StringLiteral data types themselves.


Monday
18 December, 2023


face

The new version of Firebird ODBC driver is in Beta stage now. Version 3.0.0 Beta is available for testing on Windows. It works only with Firebird 3+ , and requires fbclient.dll from Firebird 3 or above.https://github.com/FirebirdSQL/firebird-odbc-driver/wikiPlease download, test, and report any issues!Issues can be reported here: https://github.com/FirebirdSQL/firebird-odbc-driver/issuesOriginal


Thursday
14 December, 2023


face

In my previous blog post on creating LibreOffice extensions with Python, I have discussed how to write a Python code that works with LibreOffice API, and can be run and debugged in an IDE, and packed later in an extension. Now I discuss how to debug the Python code.

Here you can read the previous post:

Preparing the Debug Environment

First, you need the minimal extension, and the small Python script inside it. The complete extension as described in the previous post,  is available below, and the plan is to make it available among the other LibreOffice SDK examples:

https://gerrit.libreoffice.org/c/core/+/159938

For debugging, you can open the Python file main.py, and start editing it, adding the required functionalities.

To debug the Python program, the best way is to use an IDE with the LibreOffice internal Python as the interpreter. You only need to install LibreOffice, and LibreOffice SDK from libreoffice.org/download.

The LibreOffice internal Python interpreter resides in the program folder of the LibreOffice installation. The Python package for accessing UNO components is already installed.

In Linux, the default location of the interpreter is (for LibreOffice 7.6):

/opt/libreoffice7.6/program/python

In macOS, the default location is:

/Applications/LibreOffice.app/Contents/Resources/python

And on Windows, the default location is:

c:\Program Files\LibreOffice\program\python.exe

Configuring the Interpreter in an IDE

This is an example python configuration for PyCharm, a popular Python IDE.

Setting LibreOffice internal Python in PyCharm

Setting LibreOffice internal Python in PyCharm

With this configuration, you should be fine to start the debugging. By just clicking on the debug button, you can start running the script line by line, and use the debugging utilities in the IDE to check the value of the variables in order to be diagnose the possible problems.

As described in the previous part of the blog post, in the example Python code, the context is handled in different situations. Thus, you can use the same Python script and pack it as an extension.

Auto-Completion

Unfortunately, the autocomplete does not currently work for the methods that are available in the UNO components. This is because they are bridged dynamically, and thus autocomplete can not create the list of usable methods.

This can be improved with the use of Python auto-completion feature called REPL, and a utility package. Here I suggest using ptpython:

First, you need to install pip in LibreOffice internal python using PIP bootstrap, or ZazPip package. To do that, please refer to this question and answer on Ask LibreOffice:

Then you should be able to use Python interactive console with auto-completion. To use it, you have to run this small code:

from ptpython.repl import embed
embed(globals(), locals())

This method works both on Windows and Linux, but not on APSO console. It is important to mention that this is not ideal as it only works in interactive console, and


Wednesday
13 December, 2023


face

LibreOffice 24.2 – with a new year.month versioning scheme – will be released as final at the beginning of February, 2024 ( Check the Release Plan ) being LibreOffice 24.2 Beta1 the second pre-release since the development of version 24.2 started in mid June, 2023. Since the previous release, LibreOffice 24.2 Alpha1, 425 commits have been submitted to the code repository and 137 issues got fixed. Check the release notes to find the new features included in this version of LibreOffice.

LibreOffice 24.2 Beta1 can be downloaded for Linux, macOS and Windows, and it can be installed alongside the standard version.

In case you find any problem in this pre-release, please report it in Bugzilla ( You just need a legit email account in order to create a new account ).

For help, you can contact the QA Team directly in the QA IRC channel or via Matrix.

LibreOffice is a volunteer-driven community project, so please help us to test – we appreciate it!

Happy testing!!

Download it now!


Wednesday
06 December, 2023


face

General Activities

  1. LibreOffice 7.5.8 was released on November 2
  2. LibreOffice 7.6.3 was released on November 23
  3. Olivier Hallot (TDF) updated menu item paths in Help pages and updated and restructured dozens of help pages
  4. Rafael Lima updated ScriptForge help
  5. Stanislav Horacek updated menu item paths in Help pages alongside other corrections
  6. Ilmari Lauhakangas (TDF) updated Help pages after UI string changes
  7. Gábor Kelemen (allotropia) did code cleanups in the area of unused config keys and includes
  8. Laurent Balland extended ODF to allow lowercase for exponent characters and blank expontent digits and did many fixes in Impress templates
  9. Miklós Vajna (Collabora) worked on multi-page floating tables in Writer. He also did code cleanups and build fixes
  10. Jean-Pierre Ledure worked on the ScriptForge library
  11. Szymon Kłos, Michael Meeks and Marco Cecchetti (Collabora) worked on LOKit used by Collabora Online
  12. Henry Castro (Collabora) made Calc’s background colour autofiltering more robust and added an automated test for PPTX master slides
  13. Attila Szűcs (Collabora) improved FontWork text placement
  14. Skyler Grey (Collabora) continued polishing STYLEREF field support for DOCX compatibility
  15. Eike Rathke (Red Hat) made several improvements to date & time functions and calculations in Calc
  16. Tomaž Vajngerl (Collabora) wrote automated tests in preparation for OOXML header/footer import refactoring
  17. Julien Nabet simplified Hyperlink dialog after FTP support removal, fixed crashes and did many code cleanups
  18. Andreas Heinisch made Hyperlink and Edit Index dialogs remember their changed settings and fixed non-working Reset to Parent button in Paragraph Style dialog
  19. László Németh continued polishing change tracking of case cycling, fixed gtk popup listbox positions in Sidebar under X11, made it so lost linked graphics are shown in Accessibility Checker, fixed lost character background of non-breaking spaces and added support for smart justify found in DOCX files
  20. Xisco Faulí (TDF) did some automated test additions and cleanups
  21. Michael Stahl (allotropia) removed support for FTP, reduced the file size of exported tagged PDFs, made curl use OpenSSL on Linux after a version upgrade removed support for NSS, fixed an issue with disappearing paragraphs before tables in RTF documents, implemented support for \spltpgpar in RTF import (page breaks) and fixed Delete Undo/Redo of bookmark positions
  22. Mike Kaganski (Collabora) made command line arguments accept Windows \\?\ path prefixes, improved the Visual Studio IDE integration, improved the handling of macros in signed documents, fixed Excel’s Range.Find and Range.Replace wildcard recognition, added the ability to detect a broken ZIP package (document container), did some improvements to remote use of LanguageTool and made document repair more robust. He also made some clarifications in Help pages as well as many code cleanups and build fixes
  23. Caolán McNamara (Collabora) optimised the speed of calendar conversions in Calc and made font handling on Linux more robust. He also did code cleanups and optimisations and fixed issues found by code analysers
  24. Stephan Bergmann (allotropia) did many code cleanups, for example in the area of strings and adapted the code to compiler changes
  25. Noel Grandin

Monday
04 December, 2023


face

This post is part of a series to describe how Writer now gets a feature to handle tables that are both floating and span over multiple pages.

This work is primarily for Collabora Online, but is useful on the desktop as well. See the 9th post for the previous part.

Motivation

Previous posts described the hardest part of multi-page floating tables: reading them from documents, so we layout and render them. In this part, you can read about UI improvements when it comes to creating, updating and deleting them in Writer.

Results so far

Regarding testing of the floating table feature in general, the core.git repository has 89 files now which are focusing on correct handling of floating tables (filenames matching floattable-|floating-table-). This doesn't count cases where the document model is built using C++ code in the memory and then we assert the result of some operation.

Here are some screenshots from the improvements this month:

Improved insertion of floating tables

The first screenshot shows that the underlying LibreOffice Insert Frame dialog is now async (compatible with collaborative editing) and is now exposed in the Collabora Online notebookbar.

There were other improvements as well, so in case you select a whole table and insert a new frame, the result is close to what the DOCX import creates to floating tables. This includes a default frame width that matches the table width, and also disabling frame borders, since the table can already have one.

Unfloating a floating table

The next screenshot shows an inserted floating table, where the context menu allows updating the properties of an already inserted floating table, and also allows to delete ("unfloat") it.

Several of these changes are shared improvements between LibreOffice and Collabora Online, so everyone benefits. For example, inserting a frame when a whole table was selected also cleared the undo stack, which is now fixed. Or unfloating table was only possible if some part of the table was clipped, but now this is always possible to do.

How is this implemented?

If you would like to know a bit more about how this works, continue reading... :-)

As usual, the high-level problem was addressed by a series of small changes:


Thursday
30 November, 2023


face

LibreOffice 24.2 will be released as final at the beginning of February, 2024 ( Check the Release Plan ) being LibreOffice 24.2 Alpha1 the first pre-release since the development of version 24.2 started in mid June, 2023. Since then, 4271 commits have been submitted to the code repository and more than 787 bugs were set to FIXED in Bugzilla. Check the release notes to find the new features included in this version of LibreOffice.

LibreOffice 24.2 Alpha1 can be downloaded for Linux, macOS and Windows, and it can be installed alongside the standard version.

In case you find any problem in this pre-release, please report it in Bugzilla ( You just need a legit email account in order to create a new account ).

For help, you can contact the QA Team directly in the QA IRC channel or via Matrix.

LibreOffice is a volunteer-driven community project, so please help us to test – we appreciate it!

Happy testing!!

Download it now!


Saturday
25 November, 2023


face

Ever wondered how to create a LibreOffice extension? Here I discuss how to do that via Python programming language. It is possible to run and debug the resulting Python code in an IDE, and then package the content as an extension.

LibreOffice Extensions with Python

If you have used LibreOffice extensions, you know that many exciting things can be done with extensions. Extensions can open LibreOffice applications, create new documents, read and write text and images inside the documents, and convert them to all possible formats. They can have their own menus and toolbar buttons, and have nice looking GUIs to interact with the users.

To write an extension, the easiest way is to use LibreOffice BASIC language. You can refer to this tutorial for such an approach here:

But with Python, you will have access to a big set of packages, that is one of the many strengths of the Python programming language. You can do almost anything possible with a software with those packages. Furthermore, LibreOffice has its own Python interpreter! In this way, installing and using a Python extension would be much easier.

Handling Context in LibreOffice Extensions

First of all, you should know about context, and you should be able to have that variable to be able to use LibreOffice API.

There can be at least 3 different possibilities for running a Python program with LibreOffice:

  1. Running the Python program with APSO inside LibreOffice
  2. Running the Python program as an extension inside LibreOffice
  3. Running the Python program as a process outside LibreOffice

In each of these possibilities, the way to get the context and use them is different.

Structure of a LibreOffice Extension

Extensions are essentially zip files that have specific files known to LibreOffice inside them. This is the structure of a Python extension:

  • META-INF/ : required folder
    META-INF/manifest.xml: Specification of the script(s), menu/toolbar and language files
  • pkg-description/ : required folder
    pkg-description/pkg-description.en: Description of the extension in text, which can be also in languages other than English
  • registration/: required folder
    registration/license.txt: License of the extension
  • description.xml: Description of the extension in XML format, as displayed in the extension manager
  • main.py: The main script. Then name can be anything but it should
    be specified in the META-INF/manifest.xml

Contents of the Files

Most of the contents of the files are re-usable, so you can use the skeleton extension, and build your extension around that. But, the Python script is important and we will talk about it here.

From the above 3 possible situations for LibreOffice, in order to be able to use the code as extension, you should add these this 2 lines should be in the Python file

g_ImplementationHelper = unohelper.ImplementationHelper()
g_ImplementationHelper.addImplementation(MainJob,
"org.extension.sample.do",("com.sun.star.task.Job",), )

In addition, this import is also required:

from com.sun.star.task import XJobExecutor

Then, a Python class with this definition is needed:

class MainJob 

Wednesday
22 November, 2023


face

General Activities

  1. Olivier Hallot (TDF) continued adding Tabbed UI examples into help instructions and updated and restructured dozens of help pages
  2. Rafael Lima added support for hidden named ranges in Calc, fixed named ranges associated to sheets being lost upon XLSX export and made it so renaming a sheet updates ranges in solver models
  3. Bogdan Buzea made some UI string improvements
  4. Seth Chaiklin updated help after UI label change related to outline levels
  5. Stanislav Horacek improved the help for Firebird wizard
  6. Ilmari Lauhakangas (TDF) added a method to automated test for dealing with DPI variance, improved Search Commands result presentation, updated help after UI string changes and improved the accessibility of help navigation
  7. Alain Romedenne updated ScriptForge help
  8. Bartosz Kosiorek added handling for invalid records in Windows Metafile graphics
  9. Gábor Kelemen (allotropia) did code cleanups in the area of includes, created a script to find unused config groups/keys and improved some UI strings
  10. Laurent Balland did code cleanups
  11. Miklós Vajna (Collabora) worked on multi-page floating tables in Writer
  12. Jean-Pierre Ledure worked on the ScriptForge library
  13. Szymon Kłos (Collabora) worked on LOKit and jsdialog used by Collabora Online. He also worked on the simple conditional formatting dialog created by Paris Oplopoios
  14. Henry Castro (Collabora) worked on LOKit used by Collabora Online. He also improved the Python UI test system, fixed an issue with unused master slides not being imported from PPTX files and made handling of bidirectional text in Calc cells more robust
  15. Pranam Lashkari (Collabora) worked on LOKit and jsdialog used by Collabora Online
  16. Ashod Nakashian, Marco Cecchetti and Andras Timar (Collabora) worked on LOKit used by Collabora Online
  17. Pedro Silva worked on jsdialog used by Collabora Online
  18. Jaume Pujantell (Collabora) worked on Microsoft Office compatibility improvements in the area of content controls
  19. Attila Szűcs (Collabora) worked on LOKit used by Collabora Online. He also improved change tracking in Writer
  20. Skyler Grey (Collabora) worked on jsdialog used by Collabora Online and improved DOCX compatibility by adding full support for STYLEREF fields
  21. Eike Rathke (Red Hat) made date functions in Calc more robust and improved error propagation in Calc formulas
  22. Tomaž Vajngerl (Collabora) wrote some unit tests for Writer and did code cleanups
  23. Julien Nabet made it possible to use ProjectionMode and ShadeMode for extruded custom shapes via BASIC macros and did code cleanups
  24. Andreas Heinisch made the Slide/Page pane in Impress/Draw have the expected title when in Master view and made it possible to create new master slides in the Slide pane by pressing Enter
  25. László Németh improved change tracking of case cycling and made exported DOCX files compatible with Microsoft Office’s default paragraph justification algorithm
  26. Xisco Faulí (TDF) did a couple of dozen additions and changes to automated tests, fixed a Calc crash and added UNO commands for variable date/time fields
  27. Michael Stahl (allotropia) made many improvements and fixes to the export of accessible PDFs
  28. Mike Kaganski (Collabora) made exported HTML tables cleaner, fixed pasting sometimes losing wrapping

Sunday
19 November, 2023


face

(And do you have a vacancy for a back-scrubber?)

Thank you, Red Hat, for generously letting me work for so long on stuff that is near and dear to my heart. At the intersection of theory and practice, of compiler technology and the LibreOffice code base. But, to keep doing what I love, I need to move on.

So, thank you, allotropia, for having me. I’m excited.

And, above all, thank you, LibreOffice, family of friends. Lets make sure to keep this a happy family, one that Tolstoy would have nothing to write home about. With quarrels and arguments, for sure; feud even. But happy at heart. I wish to keep meeting you all for years to come, virtually, and for a feast at FOSDEM or LOCon. And booze.

To paraphrase Hamburger Tafel (donations needed, btw), “Wir haben LibreOffice noch lange nicht satt.”

Have fun, stay safe, peace,
sberg


Thursday
16 November, 2023


face

In the first part of the series on string types in LibreOffice, I discussed some of the string data types that are in use in various places of the LibreOffice code. I discussed various character and string data types briefly: OString, OUString, char/char*, sal_Unicode, sal_Unicode*, rtl_String, rtl_uString and also std::string. Now I want to explain string literals.

String Literals

In C/C++, a string literal is a sequence of characters in double quotations, and represent read-only textual data. For example:

const char *str = "abc";

Please note that it is different from a character literal, which is a single character in single quotation marks:

const char c = 'a';

The non read-only version of these data types does not have const in it.

The char* data type is widely used in C programming language, but it is not the data type of choice in LibreOffice. As described in my previous post, OString is used for for 8-byte text, and OUStringis used for Unicode text in LibreOffice. It is worth noting that it is possible to store UTF-8 encoded Unicode text in OString.

In the past, it was possible to convert the const char* literal to OString/OUString like this: (it will not compile now)

OString sText = "abc";
OUString sUniText = u"abc";

It was not an efficient way to define and use such strings. A read-only memory is used to store the plain string literals. But then, a new dynamic memory chunk is allocated on the heap to store the new O[U]String object, and through the constructor, that read-only memory is copied into that memory. Also, the new OUString needs reference counting. These are non-necessary expensive operations, and we should avoid them.

O[U]StringLiteral

In LibreOffice, OStringLiteral and OUStringLiteral are the data types used to represent string literals for ASCII and Unicode data, respectively.

As an example, you can see lines like this in LibreOffice .cxx files:

static constexpr OUStringLiteral sStart = u"ABC";
static constexpr OStringLiteral sEnd("DEF");

The constexpr ensures that the expression is evaluated at compiled time, and this can improve the performance of the program. Also, avoiding reference counting in O[U]String helps to make the operation cheaper.

Later, OString/OUString variables are constructed from the OUStringLiterals. Or, they are passed to functions that expect OString/OUString parameters. The difference is that when static constexpr literals are used, the memory used for storing data is not the dynamic memory, it is allocated once, and it is read-only, which increases the performance. This approach is only usable when you work with strings that will be only initialized once, and will not be manipulated later.

String Literals in Headers

If you are working with a .hxx C++ header file, you have to use inline keyword to avoid creating duplicate copies of the global variable. For example:

inline constexpr OUStringLiteral ABC(u"abc");

Later we will see that we can re-write the above with a suffix as:

inline constexpr OUString ABC = u"abc"_ustr;

Essentially


Tuesday
07 November, 2023


face

This post is part of a series to describe how Writer now gets a feature to handle tables that are both floating and span over multiple pages.

This work is primarily for Collabora Online, but is useful on the desktop as well. See the 8th post for the previous part.

Motivation

Multi-page floating tables always wrapped their anchor text only on the last page, to be compatible with Word's default behavior. There is a special flag in DOCX files to wrap on all pages, though. In this part, you can read about handling of this flag in Writer.

Results so far

Regarding testing of the floating table feature in general, the core.git repository has 84 files now which are focusing on correct handling of floating tables (filenames matching floattable-|floating-table-). This doesn't count cases where the document model is built using C++ code in the memory and then we assert the result of some operation.

Here are some screenshots from the fixes this month:

Old, new and reference rendering of a 3 nested, multi-page floating tables

The first screenshot shows a case where multi-page floating tables are nested. For this document, we not only have an inner and an out table, but we also have a middle one, giving us 3 nesting tables. Some of the inner table frames had a bad position, leading to overlapping text, now fixed.

Old, new and reference rendering of wrapping on all pages

The next screenshot shows the case where the magic allowTextAfterFloatingTableBreak flag is set. We used to wrap content of the anchor only on the last page, unconditionally. Now we either wrap on the last page (default) or on all pages (when this flag is present).

Old, new and reference rendering of overlapping floating tables.

The last screenshot shows a document full of floating tables. These used to be inline ones, and then they could not overlap by definition, but now extra effort was needed to position them in a way that no overlap happens between the tables. Now our render result matches Word.

How is this implemented?

If you would like to know a bit more about how this works, continue reading... :-)

As usual, the high-level problem was addressed by a series of small changes:


Wednesday
01 November, 2023


face

News via reddit :&nbsp;"We are pleased to announce a new release of Valgrind, version 3.22.0,available from https://valgrind.org/downloads/current.html.See the release notes below for details of changes.Our thanks to all those who contribute to Valgrind's development. Thisrelease represents a great deal of time, energy and effort on the partof many people.Happy and productive debugging and

<- Current blog entries