czwartek, 4 maja 2017

AutoText import from .dotx and .dotm files

In the LibreOffice Writer user can prepare some pieces of documents which can be reused later. That feature is called AutoText and is accessible using menubar (Tools - AutoText). In the AutoText dialog it is possible to manage existing entries and also import new ones from files.
So far only *.dot and *.doc file formats were supported for importing AutoText. Here was my first task at Collabora: to add .dotx and .dotm format support.

One template document can contain multiple AutoText entires. Each entry has own name and can consist of formatted text, text with graphics, tables or fields. To import new templates user need to open AutoText dialog (Tools - AutoText), select according category and from the "AutoText" menubutton choose "Import". File explorer will appear. In the file format listbox new entries were introduced: "Microsoft Word 2007-2013 XML" and "Microsoft Word 2007-2013 XML Template" for *.docx and *.dotx or *.dotm.

AutoText has own long name and shortcut. It is possible to insert AutoText after typing shortcut name into document and pressing F3.

Following GIF shows *.dotx import with complex content (table, shape, formatted text and fields):