Download it now!
Bug 61015 - Macros: HelloWorld example don't work
Summary: Macros: HelloWorld example don't work
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
3.6.5.2 release
Hardware: Other All
: lowest enhancement
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-17 18:20 UTC by Julien Nabet
Modified: 2016-06-21 08:31 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Nabet 2013-02-17 18:20:35 UTC
Problem description:
Running any Hello World macros (except Python one since fdo#60670) don't work when launched from other application than Writer. 

Steps to reproduce:
1. Open Calc
2. Menu Tools/Macros/Run Macro
3. Select in left panel LibreOfficeMacros/HelloWorld
4. Select in right panel any macro except Python one

Current behavior:
Error message (depending on the macro)
eg for js macro:
A Scripting Framework error occurred while running the JavaScript script helloworld.js.

Message: Cannot read property "getText" from null
java stack trace:
com.sun.star.script.provider.ScriptFrameworkErrorException: Cannot read property "getText" from null
    at com.sun.star.script.framework.provider.javascript.ScriptImpl.invoke(ScriptProviderForJavaScript.java:310)

Expected behavior:
"Hello world" displayed in a Writer file (like with Python macro)

Again, every macro work if launched from Writer
              
Operating System: Debian
Version: 3.6.5.2 release
Comment 1 Julien Nabet 2013-02-17 18:25:46 UTC
confirmed with LO 3.6.5.2 on Windows.

Noel: one for you?
Comment 2 Noel Power 2013-02-18 09:40:27 UTC
(In reply to comment #0)
> Problem description:
> Running any Hello World macros (except Python one since fdo#60670) don't
> work when launched from other application than Writer. 

that's because all the variants of the helloworld examples try to write something into a text document, if you run this from calc ( or other 'application' ) it will fail
Comment 3 Julien Nabet 2013-02-18 09:42:32 UTC
Noel: I know this (see https://bugs.freedesktop.org/show_bug.cgi?id=60670#c5) but would it be possible to put in place the same kind of patch as fdo#60670?
Or at least, put an error message explicit, telling that macros HelloWorld must be launched from Writer?
Comment 4 Noel Power 2013-02-18 10:02:08 UTC
(In reply to comment #3)
> Noel: I know this (see
> https://bugs.freedesktop.org/show_bug.cgi?id=60670#c5) but would it be
> possible to put in place the same kind of patch as fdo#60670?
ah, ok didn't read that python had being changed to open a new text document in case none exists. That change has created some inconsistency, probably the other ones should have been changed at the same time.
So, still imho this is not a bug, the helloworld examples are just that... examples. Would be nice though if someone updated the other 'Helloworld' variants as above
Comment 5 Noel Power 2013-02-18 10:02:52 UTC
oops meant to update as an enchancement
Comment 6 Noel Power 2013-02-18 10:03:32 UTC
really make it an enhancement
Comment 7 Joel Madero 2014-11-06 21:13:53 UTC
Setting to NEW as it seems like Noel confirmed it as an enhancement.
Comment 8 Julien Nabet 2015-12-27 20:02:41 UTC
Not a priority, let's close this one instead of letting it rot.
Comment 9 Hussam Al-Tayeb 2016-06-21 08:31:38 UTC
(In reply to Julien Nabet from comment #8)
> Not a priority, let's close this one instead of letting it rot.

Would it be possible to simply not ship the the macro instead of leaving it there?
People will otherwise just assume their installations are broken.