[Libreoffice] [GSoc] Progress report - Visio import filter

Fridrich Strba fridrich.strba at graduateinstitute.ch
Tue May 17 06:59:22 PDT 2011


Eilidh,

I created a git repository
http://cgit.freedesktop.org/libreoffice/contrib/libvisio/

It has a skeleton of a library whose api is taking basically this class:

namespace libvisio
{
class VisioDocument
{
public:
static bool isSupported(WPXInputStream* input);
static bool parse(WPXInputStream* input,
libwpg::WPGPaintInterface* painter);
static bool generateSVG(WPXInputStream* input,
WPXString& output);
};
}

The isSupported function should take the input and judge whether it is a
Visio document that the library can handle. If so, it should return
true, otherwise false. This function is currently not doing anything and
returning false always.

The parse function takes the input and parses the document. As output it
calls the functions of painter. If the parse was successful, it should
return true, otherwise false. The function is currently not doing
anything and returning always false.

The generateSVG is a convenience function that is actually already
implemented by using the parse function itself and using the
VSDSVGGenerator class that is now part of the library. So, that one is
not even necessary to touch and the vsd2svg tool that lives in
src/conv/svg will use it to generate svg on stdout.

Another tool vsd2raw will only output the names of the callbacks and
their parameters, which is useful for debugging purposes, because it is
the most simple implementation of the libwpg::WPGPaintInterface.

Now, I also "implemented" inside LibreOffice master Visio import filter
that is able to use external libvisio.

So, it is enough to do following:

1) build your libvisio and install it (you might need to build also
system libwpd and libwpg if you are not running something sane like
openSUSE 11.4)
2) build LibreOffice master (if you manage) using --with-system-libwpd
--with-system-libwpg --with-system-libvisio
3) After the build finished, make dev-install the LibreOffice you just
built and copy the libvisioimport*.so somewhere to basis3.4/program
directory besides the libraries like libmsworks*.so or libwpgimport*.so.
If those libraries are links, you can link the libvisioimport*.so in teh
same way, but should not be something you will really need to touch at
this stage.
4) You can normally develop libvisio and keep installing it to the same
prefix and it should be used immediately by your version of LibreOffice.
5) As a quick hack you can view the documents that you partially convert
using the vsd2svg and any svg viewer as rsvg-view or even Firefox.

I hope this gets you started pretty fast. Please, keep present on irc as
much as you can :)

F.





More information about the LibreOffice mailing list