You are not logged in.

bangle

Unregistered

1

Thursday, November 25th 2004, 7:46am

In Qt, how to read data in table of an office document (Writer document) ?

Hi all,
I stuck in trouble now. I want to export data from a Writer document to a Calc document. But the data in Writer document is put in table. How can we read them ?
Thanks

djanubis

Beginner

Posts: 29

Location: Moulins France

Occupation: Software ingeneering

  • Send private message

2

Thursday, November 25th 2004, 12:02pm

RE: In Qt, how to read data in table of an office document (Writer document) ?

I suppose you talk about oowriter and oocalc.
Documents are stored in a compresded (zip). When you unzip an sxw document, content is in content.xml file.
You'll have to use a QDomDocument to get the document structure. Somewhere you'll find your table.
Examine the content.xml from a sample oocalc file. You'll find <table:table-cell> items. Now you can use Qt XML Dom classes to copy from one to the other :)
Never patch not working code. Rewrite it !
Never patch badly designed classes. Recreate them cleanly.
(Excerpts from Computing Bible)

Home of the Lab project

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

3

Thursday, November 25th 2004, 2:58pm

You could also check if the code from the OpenOffice filters from KOffice can make life easier for your (depending on licence compatability between the KOffice filter code and your code of course)

Cheers,
_
Qt/KDE Developer
Debian User