Ask Your Question
0

read odt files using c++

asked 2020-04-01 00:16:30 +0200

YuryR gravatar image

updated 2020-07-11 21:51:37 +0200

Alex Kemp gravatar image

Hello, All !

I have to read odt files and search there tables using Qt 5 and libreoffice sdk on C++. As I read documentation I can do it via classes XTextDocument and XTable, but when I read

osl::File osf( fileName );

I can receive only binary content that will be acceptable for sending by network, but not for text analysis, which way I can read data from odt file that fill XTextDocument and other similar classes ?

Thanks in advance, Yury.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-04-01 00:58:59 +0200

jmux gravatar image

What you're looking for is XComponentLoader::loadComponentFromURL. The SDK has the cpp example DocumentLoader, which you can use as a start.

edit flag offensive delete link more

Comments

Thanks a lot, but could you answer one's more question, is it possible to parse odt document using this example, when I try to obtain property value using _xPropSet->getPropertyValue("DefaultContext"), I have got a bug, bacause _xPropSet was null, _xPropSet =Reference< XPropertySet >( _xInterface, UNO_QUERY );

and it was null.

YuryR gravatar imageYuryR ( 2020-04-16 20:49:15 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-04-01 00:16:30 +0200

Seen: 71 times

Last updated: Apr 01