Issue 43544 - getURL() return empty String while loading
Summary: getURL() return empty String while loading
Status: CONFIRMED
Alias: None
Product: General
Classification: Code
Component: scripting (show other issues)
Version: 680m79
Hardware: All All
: P3 Trivial with 2 votes (vote)
Target Milestone: AOO Later
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2005-02-25 15:05 UTC by luiz_augusto
Modified: 2017-05-20 11:31 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Sample file that has a macro that returns document URL. (6.93 KB, application/vnd.sun.xml.calc)
2005-02-25 15:08 UTC, luiz_augusto
no flags Details
For those who dont realize the real problem another sample. (7.12 KB, application/vnd.sun.xml.calc)
2005-05-03 18:57 UTC, luiz_augusto
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description luiz_augusto 2005-02-25 15:05:21 UTC
OpenOffice first loads and runs macros instead of load the document itself. This 
leads to many problems if a macro wants to access any type of information in the 
document.
Comment 1 luiz_augusto 2005-02-25 15:08:16 UTC
Created attachment 23037 [details]
Sample file that has a macro that returns document URL.
Comment 2 luiz_augusto 2005-02-25 15:18:05 UTC
Running the attached file will return a NULL string to the very first cell in 
the sheet1, but just editing this cell or running again the macro will return 
the correct URL string.
Comment 3 noel.power 2005-02-28 12:02:21 UTC
np->ab reassign
Comment 4 flibby05 2005-03-10 19:31:21 UTC
confirm with m81
Comment 5 ab 2005-03-24 11:04:34 UTC
If I remember correctly, you've told me about a simlilar problem lately.
This problem cannot be solved within Basic anyway.
Comment 6 Mathias_Bauer 2005-03-24 16:28:45 UTC
But that's what the document wants: it obviously contains a macro call in the
spreadsheet table, and Calc evaluates such macros while it loads the document.
So this alone isn't a problem. If your macro does not work correctly (or what
else should cause the empty cell?) it's something else.

I assume that this is something a Calc expert should investigate.
Comment 7 niklas.nebel 2005-05-03 14:59:26 UTC
The macro calls getURL (implemented in SfxBaseModel). I can't say if that is
supposed to return a value during loading.
Comment 8 Mathias_Bauer 2005-05-03 15:36:20 UTC
OK, so the question remains: should getURL() return something before loading has
finished?! And should it be different to getLocation()?
Comment 9 Mathias_Bauer 2005-05-03 15:37:45 UTC
I changed the title because it is misleading. It's absolutely correct to execute
the macro before the loading has finished, only the behavior of a particular
function must be clarified
Comment 10 luiz_augusto 2005-05-03 15:51:21 UTC
In my opinion getURL is not supposed to return a value during loading time, but 
the real problem is that the cells calculation starts before the loading is 
finished.
Comment 11 luiz_augusto 2005-05-03 15:52:27 UTC
Not only getURL() wont work, others API calls wont too.
Comment 12 luiz_augusto 2005-05-03 18:57:04 UTC
Created attachment 25758 [details]
For those who dont realize the real problem another sample.
Comment 13 luiz_augusto 2005-05-03 19:17:38 UTC
I can provide many others samples that this problem occurs and the only way that 
i could make it work is disabling macros and then reload the document.
Comment 14 cfries 2008-10-24 21:12:11 UTC
I found a strange workaround for this issue!

Porting Obba (see http://www.obba.info) I came across this issue, because Obba provides a function to 
load an external library. In order to function with sheet-relative paths, this function (e.g. obAddJar) 
needs to use getURL. The function has a second argument being a boolean "isPathRelative". If you write 
"obAddJar("lib";TRUE())" the path not expanded. However if you write 
"obAddJar("lib";IF(TODAY();TRUE();TRUE()), then the function is evaluated at a later time and getURL is 
valid.

Furthermore, try this on a sheet featuring a macro and set a breakpoint in your Java code. If you use the 
call without TODAY(), then your code will be called before the macro dialog appears. If you use the call 
with the TODAY() workaround, then the code will be called after the macro dialog appeared.

You can check this behavior by downloading the Obba plugin from http://www.obba.info an use the 
Demo "Normal Distribution.odt".

Regards
Christian

Comment 15 Marcus 2017-05-20 11:31:40 UTC
Reset assigne to the default "issues@openoffice.apache.org".