I have tried to run the python sample from: Tools -> Macros -> Run Macros -> LibreOffice Macros -> HelloWorld -> HelloWorldPython. It fails with the following error: com.sun.star.uno.RuntimeExceptionError during invoking function HelloWorldPython in module file:///opt/libreoffice4.0/share/Scripts/python/HelloWorld.py (<class 'AttributeError'>: Text /opt/libreoffice4.0/share/Scripts/python/HelloWorld.py:26 in function HelloWorldPython() [text = model.Text] /opt/libreoffice4.0/program/pythonscript.py:830 in function invoke() [ret = self.func( *args )] )
On pc Debian x86-64 with master sources updated today, I reproduced this problem. Xisco: one for you?
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=270967f340670189e42939d9432e28e8259feefc fdo#60670: Create a new document in case there's none The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Xisco Fauli committed a patch related to this issue. It has been pushed to "libreoffice-4-0": http://cgit.freedesktop.org/libreoffice/core/commit/?id=70b6d7510d6910e046342114a79321ae8654764a&h=libreoffice-4-0 fdo#60670: Create a new document in case there's none It will be available in LibreOffice 4.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Xisco: Verified on master, good and very quick work!
Joao: I made other tests. In fact, it works if you run macros from Writer. With the Xisco's fix, Python version works in any case.
I have tried the latest daily and it fixed the issue for me. Thanks for the quick fix.