You are not logged in.

Dear visitor, welcome to If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.




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 ?



Posts: 29

Location: Moulins France

Occupation: Software ingeneering

  • Send private message


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



Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message


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)

Qt/KDE Developer
Debian User