Graphical Diff for ODF documents using OpenOffice.org
At work we use Subversion for just about all our software project data: source code, design documents, reports. Design documents are usually in MS Word, Excel and Visio. TortoiseSVN is great at using MS Word's "track changes" feature to do a graphical diff of two versions of a document.
At home, I use Linux and Subversion, and also store my ODF (OpenOffice.org) documents in Subversion. So I've been interested in getting a graphical diff feature working for these documents too, which can be started from the command line, and ideally integrated with Subversion.
I wanted to make some improvements to the script:
- in the original post, the straight quotes are converted to curly quotes by the blog software, which must be reversed to get it running in Python
- filenames weren't being passed as command line parameters
- it didn't work properly on Gnome in Ubuntu, due to some invalid assumptions about whether the just-opened document has the focus in the window manager when it is opened
- it required the user to first manually start OpenOffice.org with the special parameters needed for the scripting to work
I have been running this on Ubuntu Linux 9.04 (Jaunty). I have not had success running it on Windows.
This script integrates nicely into Mercurial workflow using the extdiff extension. I've got it set up so I can just type hg oodiff file.odt to see how an ODF file within my Mercurial working copy has changed.
Download from Mercurial repository: