https://bugs.freedesktop.org/show_bug.cgi?id=42736
Bug #: 42736
Summary: undefined: PyUno document.Text.getString() returns
empty text but there is text in document
Classification: Unclassified
Product: LibreOffice
Version: LibO 3.4.3 release
Platform: Other
OS/Version: All
Status: UNCONFIRMED
Status Whiteboard: BSA
Severity: normal
Priority: medium
Component: Libreoffice
AssignedTo: [email protected]
ReportedBy: [email protected]
Created attachment 53318
--> https://bugs.freedesktop.org/attachment.cgi?id=53318
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
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs