Bug 74536 - Macros: Error Message by Executing Macro after File Editing
Summary: Macros: Error Message by Executing Macro after File Editing
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-04 20:01 UTC by programmer
Modified: 2015-02-19 13:46 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot_with_ErrorMessage (338.60 KB, image/jpeg)
2014-02-04 20:01 UTC, programmer
Details
An ods file demonstrating the error (12.77 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-02-09 01:45 UTC, reporter_of_bugs
Details
test document with screen shot from error (9.11 KB, application/vnd.oasis.opendocument.text)
2014-07-18 10:00 UTC, domingo.sacristan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description programmer 2014-02-04 20:01:50 UTC
Created attachment 93413 [details]
Screenshot_with_ErrorMessage

Problem description: 

Steps to reproduce:
1. Open an ODS-File within a Macro-Module and a Command Button
   for Executing the Macro
2. Disable "Editing File"
3. Enable "Editing File"
4. Disable the Design Mode in the "Form Controls" Toolbox

Current behavior:
You get the Error-Message:
"com.sun.star.uno.RuntimeException C:/cygwin/home/buildslave/
source/libocore/package/source/xstor/xstorage.cxx:4923:"

The opened File is now also missed in the "Macro Selector".
But it is available in "LibreOffice Basic".

Expected behavior:
The Macro shuold start.
              
Operating System: Windows 7
Version: 4.2.0.4 release
Comment 1 reporter_of_bugs 2014-02-09 01:45:53 UTC
Created attachment 93688 [details]
An ods file demonstrating the error
Comment 2 reporter_of_bugs 2014-02-09 01:50:10 UTC
Comment on attachment 93688 [details]
An ods file demonstrating the error

I can confirm the same error and missing document entry in 'Macro Selector' dialog (Tools>Macro>Run Macro...) happens in ods & odt
when the file is set to read-only. If the file is left in edit mode the button works as expected.
 
Lubuntu 13.10 x86_64
LibreOffice Version: 4.2.0.4
Build ID: 05dceb5d363845f2cf968344d7adab8dcfb2ba71
Macro Security is set to Medium
uname -a:Linux a1201T 3.11.0-15-lowlatency #8-Ubuntu SMP PREEMPT Sun Dec 15 21:38:06 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

The only difference being the error details reflecting the OS: 

com.sun.star.uno.RuntimeException/home/cloph/source/libo-core/package/source/xstor/xstorage.cxx:4923:
Comment 3 Chris Sherlock 2014-02-09 12:51:43 UTC
Not happening for me... do you have a debug build?
Comment 4 Chris Sherlock 2014-02-09 13:05:40 UTC
I must be missing something. Can you literally give me a step-by-step of what you are doing?
Comment 5 reporter_of_bugs 2014-02-09 21:37:17 UTC
(In reply to comment #4)
> I must be missing something. Can you literally give me a step-by-step of
> what you are doing?
Sure:
Open new spreadsheet or writer doc
Create new macro: Tools>Macros>Organise Macros>LibreOffice Basic...
In the 'Macro from' window select 'Untitled 1' and press 'New' then 'OK'
In the Basic IDE, enter:
Sub printHW
 print "Hello World"
End Sub
Switch back to the spreadsheet or writer doc & save it
Draw a Push Button:View>Toolbars>Form Controls (if not already visible) & select the Push Button & draw one on the spreadsheet or writer doc.
Right mouse click on the Push Button and choose 'Control...'
On the 'Events' tab assign printHW to 'Execute action' & close the 'Properties:Push Button' window
Save the spreadsheet or writer doc & close LibreOffice entirely
Open the od(s|t) (note it's editable) and press the button and the text box is displayed as expected. Now disable editing, press the Push button, and the error message is displayed. Close that.
Enable editing and Form Controls toolbar will appear. Press the 'Design Mode On/Off' button to off and press the Push button and the error message appears.

Now if you close the od(s|t) but *not* LO, then re-open it from the start centre, disable editing and then press the button you get the error message immediately rather than having it work first time.
Comment 6 reporter_of_bugs 2014-02-09 23:09:10 UTC
I've just checked this again on my Ubuntu 13.10 x86_64 desktop
uname -a: Linux a10-5800k 3.11.0-15-lowlatency #8-Ubuntu SMP PREEMPT Sun Dec 15 21:38:06 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

with

Version: 4.2.0.4
Build ID: 05dceb5d363845f2cf968344d7adab8dcfb2ba71 

and

Version: 4.1.4.2
Build ID: 0a0440ccc0227ad9829de5f46be37cfb6edcf72
 
and it's behaving the same way. I even created 2 new ods', one in each version, to test the same macro.
Comment 7 domingo.sacristan 2014-07-18 10:00:05 UTC
Created attachment 103027 [details]
test document with screen shot from error
Comment 8 domingo.sacristan 2014-07-18 10:07:17 UTC
Testplatform W7 with Libreoffice 4.2.5

Problem description:
printing document in read-only modus when print event has assigned action

Steps to reproduce:

1. create new macro in standard-module1-main (the procedure cann be as well empty)
2. Below Tools - customize - save in Libreoffice connect “print document” to procedure “main”
3. open and save a new text document
4 change document editing status to readonly status over push button “edit file”
5 . print document

see error message in document "test document with screen shot ..."
Comment 9 Buovjaga 2014-11-04 09:17:13 UTC
No error here.

Win 7 64-bit Version: 4.4.0.0.alpha1+
Build ID: ad6d94009cf8ea526eb70bf1a07e5c6a21320f83
TinderBox: Win-x86@51-TDF, Branch:MASTER, Time: 2014-11-04_00:06:27
Comment 10 raal 2014-11-06 18:04:41 UTC
I can confirm with steps from comment 8
Version: 4.4.0.0.alpha1+
Build ID: 04ea7b24ec1b5a027efa0b850f2bc3ac7116c52e
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-10-31_23:27:49

Error message: com.sun.star.uno.RuntimeExceptionScriptProtocolHandler::createScriptProvider(),  

No error when doing steps from comment 1
Comment 11 Buovjaga 2015-02-19 13:46:09 UTC
I created a new bug for comment 8, bug 89470.
Closing this as WFM.