[Libreoffice] Testing writerfilter import

Miklos Vajna vmiklos at frugalware.org
Thu May 19 03:26:59 PDT 2011


Hi,

Preparing for the GSoC project, I wanted to decide what is an easy way
to test an import filter. Given that the new RTF filter will be in
writerfilter, testing docx import is a good example, I guess.

So opening a docx document and checking the visual result is one way,
though in case it goes wrong, I don't think it's helpful. One method is
to export to odt, AFAIK that's lossless. So here is what I tried (build
from master, I pulled and did an incremental build today):

- exporting to RTF (just to see the docx import part is fine):

$ ./soffice.bin --headless --convert-to rtf --outdir ../../../lo-test-files/writer ../../../lo-test-files/writer/hello.docx
convert /home/vmiklos/git/libreoffice/lo-test-files/writer/hello.docx -> /home/vmiklos/git/libreoffice/lo-test-files/writer/hello.rtf using Rich Text Format

  That sounds OK.

- exporting to ODT:

$ ./soffice.bin --headless --convert-to odt --outdir ../../../lo-test-files/writer ../../../lo-test-files/writer/hello.docx
convert /home/vmiklos/git/libreoffice/lo-test-files/writer/hello.docx -> /home/vmiklos/git/libreoffice/lo-test-files/writer/hello.odt using OpenDocument Text Flat XML
Error: Please reverify input parameters...

  That does not seem to work.

- export to "foo" (non-existing format):

$ ./soffice.bin --headless --convert-to foo --outdir ../../../lo-test-files/writer ../../../lo-test-files/writer/hello.docx
convert /home/vmiklos/git/libreoffice/lo-test-files/writer/hello.docx -> /home/vmiklos/git/libreoffice/lo-test-files/writer/hello.foo using

  and in case I rename that .foo to .odt when I have the result in .odt.

Now I can live with this workaround, but I wanted to ask if this is the
best way to test import result, or you have something better. :)

(I already heard of the xml dumper for the rendered layout, is there
something similar for the internal document model?)

Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110519/16ab1068/attachment.pgp>


More information about the LibreOffice mailing list