Wednesday, April 26, 2006

Writerperfect and KWord - reusing of code with many benefits!

Writerperfect is the import filter for WordPerfectTM Documents inside 2.x. It uses a library, libwpd, to read WordPerfectTM Documents and converts libwpd's output to SAX messages in 1.0 Text File format (designed originally as an add-on for 1.1 and not needing any of the advanced features of OpenDocument format, the sxw output remained and works well in 2.x too).

Written principally by William Lachance (big thanks, Will), Writerperfect has an intelligent design that is not limiting it to a specific document handler. This allows us to use Writerperfect as a base of wpd2sxw command-line conversion tool, of the import filter integrated inside 2.x, of an import filter add-on for 1.1.x, and, soon, of a WordPerfectTM import filter for KWord, the word-processing component of KDE office suite, KOffice.

In fact, your servant and Ariya Hidayat of KDE fame have been working last weeks on an integration of Writerperfect with KWord. KOffice has a nice feature that allows different filters to be chained.

Since the version 1.4.0, as all major FOSS word processors, KWord is using, the libwpd library as a base of it's import filter for WordPerfectTM Documents. Since the use of libwpd was something new for KOffice, the existing import filter is a bit rudimentary. Reusing of Writerperfect's code allows the import filter to benefit almost instantly from all features converted by libwpd modulo those that KWord's sxw importer does not support. Along the way, as we already found bugs in the sxw importer, it benefits also from the change. And, last but not least, Writerperfect itself is likely to become more robust too.

Kendy, would you ever believe that your servant would be contributing to KDE? :-)