Created attachment 53318 [details] test document to reproduce a bug Problem description: When I open document using PyUNO: document.Text.getString() returns empty string when in document there is only one table with some text inside. See attached document and code below to reproduce the bug. Interesting moment: if I type any text before table 'getString()' will return text from table correctly. Steps to reproduce: 1. Start libreoffice in terminal without gui using following command: libreoffice --accept=socket,host=localhost,port=2002;urp;StarOffice.ServiceManager --norestore --nofirststartwizard --nologo --headless 2. In second terminal I starts python code to open some file, get plain text Expected behavior: Return all text from table in document. Minimum python code to reproduce problem: -------------------------------------------------------------------------- import uno local = uno.getComponentContext() resolver = local.ServiceManager.createInstanceWithContext( "com.sun.star.bridge.UnoUrlResolver", local) context = resolver.resolve( 'uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext') desktop = context.ServiceManager.createInstanceWithContext( "com.sun.star.frame.Desktop", context) doc = desktop.loadComponentFromURL('table_text.docx', "_blank", 0, ()) plain_text = doc.Text.getString() doc.dispose() doc.close(False) del doc ------------------------------------------------------------- plain_text is equal to u'' but there is text in a table. Platform (if different from the browser): Mac OS X 10.6, Ubuntu 10.10, LibreOffice 3.4.3, python-uno + python 2.7.1 Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.106 Safari/535.2
(In reply to comment #0) > doc = desktop.loadComponentFromURL('table_text.docx', "_blank", 0, ()) __main__.IllegalArgumentException: URL seems to be an unsupported one.
The bug is in the report: The document does not have a single line of text, thus the return value of doc.Text.getString() is correct. Instead, doc.TextTables.Tabelle1.getDataArray() will reveal the content of the table. Note: file:///PATH/TO/DIRECTORY/table_text.docx is the correct URI to open file.