Monday, October 09, 2006

Cleaning up my mess

When I was a child, my mother would really try to teach me to clean up my mess before I leave a place. Not saying that she managed to train me to do it always, but I try to do the things right and, surprisingly, sometimes I even manage. So, here are the things that I really did not want to leave unfinished:

WordPerfect Graphics Import filter

That is the Google Summer of Code project that I mentored. Our contract with Ariya was that he does the hard part of implementing the library that actually reads the WPG files and converts them and that I will get all the glory by wrapping it into an import filter for

The glory was quite costly though. Quite a hacking during the OOoCon2006 in Lyon to extract from the command-line wpg2odg the converter itself and make it produce SAX messages instead of directly writing an XML in odg format.

For those that followed my presentation in Lyon, and thus they know that there was still a little hick in the filter at that time, this is the explanation: If you have an XML based filter in OOo that produces SAX messages in OpenDocument format, the service that should receive the messages should be<Application>.XMLOasisImporter, where Application can be Writer, Draw,... If you try to push those messages into<Application>.XMLImporter, designed to receive SAX messages in 1.x file-format, it will not shout loudly, but the resulting document will be empty. I know, I should have been aware of it, but as a TrainedMonkeyTM, I am designed to have some error rate in my functioning :-)

For those that want to try it, you can fetch modules libwpg and wpg2odg from the libwpg CVS repository. Build the libwpg and install it, then configure your SDK and build the package inside the SDK shell using the Your package will be found in LINUX.out/bin directory (yeah, I tested it on GNU/Linux, but it should be trivial to make it work on win32 and/or Solaris too). You can just install it using the Package manager and here you go with a WPG Import and a proper type-detection as a bonus.

Inspired by kendy's post about the svg import filter that he writes, I think that eventually rewriting the importer to use the UNO Drawing API would be not a bad idea. So if someone has some idle cycles and wants to change the horse that is winning, feel free to do it :-)

libwpd 0.8.7

A big thanks to William that was so nice and did the legwork for the 0.8.7 release of libwpd. He named the release "Big Apple". Thank God, we did not release it on 10/9 and not on 9/11. Given the latent paranoia everywhere, we might have a problem and my wife could eventually discover what is on my hard-disk :-)

The big feature is that now libwpd supports all existing WordPerfect file-formats. To a certain extent, naturally. The set of converted features is bigger for those file-formats where we own the underlying implementations. Because writing file-filter only using the documentation is harder that writing it not having the docs, but having the implementation. See the difference in feature-set between the WordPerfect 4.x file-format (we do not have WP 4.2, but we have the documentation) and the WordPerfect for Mac 1.x file-format (we do not have the documentation, but we have a working copy of the application).


Last week I had a quick glance at Writely, the Google web-based text editor, that allows collaborative editing. As a filter writer and libwpd developer, I am a bit puzzled that the document upload allows only .doc, .sxw and .odt files. Given that there is a nice library for reading WordPerfectTM documents and that this library is licensed under LGPL, it should not be really difficult to add .wpd files to supported documents. If you are interested, guys, I know someone who would be able to do it :-)