Monday, July 29, 2019

A better LibreOffice than LibreOffice

Turning LibreOffice users into happy LibreOffice users.

After readings and advises from other IT directors, one of my customers and strong supporter of LibreOffice, noticed that just switching programs and teaching user to avoid pitfalls in interoperability is not enough for a smooth migration, and something more than following the migration best practices has to be done for a successful switch. He then asked me to deliver a better LibreOffice than LibreOffice.

Challenge accepted. Together we started to investigate the needs of his organization, a civil company with strong military ties and with significant part of the workforce serving the military. We discovered a set of employees with repetitive tasks, usually performed by reusing old documents and updating them. The straightforward solution was to define a set of document templates and deploy it in the user computers.

But that was not enough. LibreOffice templates are accessed by a bunch of clicks with dialogs navigation, a sequence that needs to be memorized. Besides, templates dialog covers all kind of documents types and more clicks to narrow the selection. There had to be some easier way to get a brand new document from a corporate controlled template. Also, my customer also wanted to let a fingerprint in the solution and he wanted the solution to bear the company logo when user access it, including the high ranked military.

The solution was to create an extension that added a new menu to LibreOffice, specially crafted to address the needs of the workforce and help them do their job as quickly as possible.

So we packed the templates, a Basic macro needed for their document handling in an extension. The Basic macro was used to create a simplified template dialog, allowing a 2-click selection and other internal document handling macros. All new features are accessed from the top menu and a specific toolbar, with icons representing the company brand.

Thanks to the extension mechanism, the “better LibreOffice than LibreOffice” became a reality. The extension used all nice features of versioning, updating, as well as easy of deployment and maintenance. A few days after the news were spread, other departments such as engineering, legal, contracts, human resources and others asked to include their templates into the solution, turning more and more users happy to use LibreOffice.

Happy extensioning!

Monday, April 29, 2019

New Help: Copy BASIC and PYTHON code to Clipboard on a Click

The next release for LibreOffice will have a small but handy improvement for every macro developer, either experienced or beginner.

Hover the mouse on BASIC and Python code in the new Help pages and a tip shows that when you click your mouse, the code exerpt is copied in the system clipboard. You can paste in the BASIC IDE (Integrated Development environment) or any other text application in your system.

With this little feature, you save time of typing the exerpt to test in your IDE or document. Another alternative was to use a collateral file, however, collateral files with embedded macros is likely to trigger security warnings in most LibreOffice installations. Just copying the fragment is easier.

Happy Basic macro programming!
Happy Python macro programming!

Monday, January 14, 2019

Report on the New LIbreOffice Help Pages Online Editor

The Online Help Editor is getting a shape

I have improved and fixed a bit the XHP editor, and changed the page address:

 The editor is still work in progress, but starts to become interesting for creating and editing Help pages.

What's new

  • Mike Saunders implementation of the autocompletion of XHP tags for Codemirror editor.
  • The left and right panes are now fixed in browser screen and scrollable,
  • The right pane uses 99% of the current Help transformation rendering, plus
  • some visual debug information left intentionally to help Author in adjusting <embed>s, <image>s and <link>s . 
  • You can now open a Help page directly from the interface. 
    • The help page is normally source/text/AAA/BBB/myHelpPage.xhp  
    • Type /AAA/BBB/myHelpPage.xhp in the text box and click Open File to load in the editor. 
    • Press Render page to see it on the right. 
  • A set of buttons with XHP snippets to shorten editing workload: 
    • For <paragraph>s, <note>s, <heading>s, <emph>s, <menuitem>s, etc... select the raw text or contents and click the corresponding button. The raw text will be wrapped with the opening and closing tag. For paragraph-like contents, an unique id will be created automatically, a feture required for translations. 
    • Other snippets builds fragments of XHP tags, such as <table>s, <tablerow>, <list>s, <section>s, and more.
    • Just play with and do not forget to render the page on the right. 


  • The editor works with Firefox only. Issues with Chrome and Edge. Other browsers not yet tested.
  • Saving files not implemented. However you can copy the editor contents and finish the patch in you preferred editor
  • More XHP checking are under development, specially id's unicity and DTD checking
  • If you get a blank page on the right, this is because you hit a bug in the browser transformation. Unfortunately debugging the browser transformation is very hard, support is almost none.

Invitation for developers and testers

  • You are invited to test the editor, report bugs and suggest improvements.  
  • The user interface is simple HTML and Javascript. If you have skills in these technologies you are a potential developer for the editor, but we know that PHP will be the right tech choice in near future.  
  • The source code is in the dev-tool repository. 
    • To clone the dev-tool repository : 
    •  git clone dev-tools 
    • The editor is in dev-tools/help3/html/ 
  • If you have a web server working in your computer (Apache, Nginx, etc...) you can run the editor locally: create a link between the web server root and the editor. For example, under Debian-like Linux: 
    • sudo cd /var/www/html 
    • sudo ln -s help-editor /dev-tools/help3/html 
    • and point your browser to http://localhost/help-editor 

Seeking Help and discussion on the editor

Please use the documentation list, the developer list and our IRC channels to get in touch with the development of the editor. 


The Javascript editor used is CodeMirror and was carefully selected by Mike Saunders who also set the initial confguration for working with XML and our XML dialect XHP, as well as configured the autocompletion features.

The XHP snippets were originally designed for the KDE Kate editor and ported to the online editor.

Thursday, October 25, 2018

Proposed XHP Extensions

After significant amount of time spent writing and fixing LibreOffice Help pages (XHP), I came to conclusion that the LibreOffice Help XML (XHP) is a powerful markup but a bit too hard to master for newcomers and easy to have errors and mistakes slipped in files. Some of its complexity are not absolutely required so I wrote a wiki page suggesting the implementation of XHP extensions, aiming to make life simpler for adding and reading XHP contents textually (markup).

Please note that in any case the current markup is affected, so it will preserve the legacy contents as well as the current translations. For example, the new markup for 'tip' paragraph should be

<tip id="123456" localize="true" xml-lang="en-US"></tip>

So it can replace

<paragraph id="123456" localize="true" role="tip" xml-lang="en-US"></paragraph>

Yes, it is a trivial change but I hope it will make reading easier for all.

Handling of the XHP extensions will be in the XSLT transformation and it will be patched accordingly, as well as the DTD, wiki documentation on XHP, and string extractors for Pootle.

The wiki page is

And comments are welcome, do's and dont's, thumbs up or thumbs down.

Happy help writing.

Monday, September 10, 2018

Hovering icons in Help pages

Last week I implemented a feature in our help pages using a modern CSS (Cascade Style Sheets) technique when hovering the mouse pointer on icons displayed in the page: the hovered icon is enlarged twice its size.

Almost every icon in the help pages are sized 0.22 in x 0.22in (~0,5cm x 0,5cm) which is sometimes a bit too small, especially with minimalistic designed icons such as the Colibre icon family. Enlarging the icons helps user to visualize and since it was implemented in CSS, there was no need to change the icons dimensions in the source help pages.

To see it working, please check this page and hover the mouse on icons.

Normal size

Enlarged on hover

Comments and suggestions are welcome.

Happy icon hovering!

Wednesday, August 22, 2018

Compress Images

I just submitted a patch for LibreOffice Help to document the Compress Image feature.

The Compress Image feature is active when an image is selected and you want to change the data size of the image, at the expense of a optional and controllable loss of quality set in a dialog box.

The Compress Image dialog

Compressing is useful if you insert a high resolution image in a document. For example a 4000x4000 pixel image in bitmap format (BMP) is approximately of  48MB size, which can turn you document edition hard in constrained-resources computers. By compressing the image with the right format and quality index you can reduce the size of the picture with no loss of visual quality and have the document file much lighter to edit.


Tuesday, August 7, 2018

When nothing else works...

Few things in life makes me unhappy than a unoptimal or broken system. When my machine does not work at its best I start to suffer itches and bad mood.

Like many other nerds, I can't avoid to update my laptop operating system with the latest developments. No exceptions with Kubuntu 18.04, where I innocently thought it will fix some nasty bugs of 17.10 I was enduring, notably, a very slow desktop login. I took the radical approach, let's format the root partition and install from scratch.

All backups done, machine reinstalled and bingo! now I can't get a second user session, without disconnecting the first. To put in perspective, what is an operating system, especially linux, that can't get more than one user session active at the time?

As usual, Google here, Google there, countless web pages of irrelevant content... and nothing. Greping the syslog, and the culprit was sddm, the login service of Kubuntu. On Github, a report on the issue, but no further indication that the bug will be fixed someday.

Then a hint on the bug report, and it was related to the dual hybrid graphics architecture of the laptop. In my case, I have an Intel and a Radeon dual graphic laptop. The suggestion was to disable the Radeon chip and work only with the Intel, which is no big deal for me. I was happy to finally fix it.

Too easy huh? Not at all. The laptop began to warm too much, even with no CPU load. It was uncomfortable even to rest the hand on the keyboard.

Another set of Google searches and a page in Ubuntu on hybrid graphics. Joining the two solutions, I enabled back the radeon driver, and enabled the switch to let the kernel manage the second graphic chip, so sddm know about it, even if I don't use it.

Second session working, and laptop in normal temperature.