Bug 118904 - automatic backup during macro execution
Summary: automatic backup during macro execution
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
5.3.6.1 release
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-23 08:55 UTC by BRANDT
Modified: 2018-10-15 08:50 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
file for testing (83.05 KB, application/ods)
2018-09-02 12:22 UTC, BRANDT
Details
image before macro execution (63.45 KB, image/png)
2018-09-02 12:23 UTC, BRANDT
Details
image after macro execution (40.02 KB, image/png)
2018-09-02 12:24 UTC, BRANDT
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BRANDT 2018-07-23 08:55:32 UTC
Description:
Hi,

In CALC using macros (but i think it's for all component)
When i run macros which modify sheets and if an automatic backup is done during the execution of these macros i loose the position of rows and the result are the destruction of some real rows not concerned by the modification. Disabling the automatic backup avoid the destruction. The problem is when i install a new version the automatic backup is reset to 10mn and i have to not forget to disable it.

Many thanks for LibreOffice, it's a great product.
René.
rbr146@yahoo.fr

Steps to Reproduce:
1.set the automatic backup to 1 mn
2.run a macro which modify a sheet line by line during more than 1mn or several times to be sure the automatic backup runs during the execution of the macro
3. control if all is correct

Actual Results:
if automatic backup runs during the macro is processing the position in the sheet is lost and the result is not what attended

Expected Results:
if the problem occurs the wrong lines are destroyed


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: fr
Module: SpreadsheetDocument
[Information guessed from browser]
OS: Linux (All) CentOS 7 Build ID: 5.3.6.1-10.el7
OS is 64bit: yes
Comment 1 Xisco Faulí 2018-08-29 10:53:52 UTC
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. 
(Please note that the attachment will be public, remove any sensitive information before attaching it. 
See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)

I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
Comment 2 BRANDT 2018-08-30 04:56:47 UTC
Hi,

I will build you a macro to run a produce the bug because mine is too complicate to use and explain to obtain the bug.
I will come soon.
René
Comment 3 Xisco Faulí 2018-08-31 19:39:19 UTC
Please do, thanks!
Comment 4 BRANDT 2018-09-02 12:22:11 UTC
Created attachment 144608 [details]
file for testing
Comment 5 BRANDT 2018-09-02 12:23:10 UTC
Created attachment 144609 [details]
image before macro execution
Comment 6 BRANDT 2018-09-02 12:24:03 UTC
Created attachment 144610 [details]
image after macro execution
Comment 7 BRANDT 2018-09-02 12:40:36 UTC
TestBug was a too simplified version of mine. I will build another version more closer to mine.
Comment 8 BRANDT 2018-09-02 12:46:04 UTC
i just see that i loosed the message i entered with the attachments.

so the macro TESTBUG :
Sub TestBug
rem ----------------------------------------------------------------------
rem Macro used to test the automatic backup bug
rem ----------------------------------------------------------------------
dim answ1, answ2, answ3, answ4 as string
answ1 = inputbox("1st line")
answ2 = inputbox("Number of lines to insert ?")
answ3 = inputbox("Number of times for the loop ?")
answ4 = inputbox("number of lines to skip ?")
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

dim args0(0) as new com.sun.star.beans.PropertyValue
args0(0).Name = "Nr"
args0(0).Value = 1

dispatcher.executeDispatch(document, ".§		", "", 0, args0())

dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
rem access to first cell to get the start value
osheets = Thiscomponent.getSheets()
osheet = osheets.getByIndex(0)
ocell1 = osheet.getCellByPosition(0, 0)
Lcell  = ocell1.getValue()

nu1 = val(answ1) rem line to start
nu2 = val(answ2) rem number of lines to insert
nu3 = val(answ3) rem number of times we loop to insert lines
nu4 = val(answ4) rem how many lines we skip before next insert

for j = 1 to nu3

args1(0).Value = "$A$" & Cint(nu1)

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())

dispatcher.executeDispatch(document, ".uno:InsertRows", "", 0, Array())
for i = 1 to nu2 - 1
dispatcher.executeDispatch(document, ".uno:Repeat", "", 0, Array())
next i

nu1 = nu1 + nu2
ocell1 = osheet.getCellByPosition(0, nu1)
Lcell = Lcell + 1
ocell1.Value = Lcell

nu1 = nu1 + nu4 rem skip nu4 lines

next j
end sub
********************************
this macro ask four things :
1 - on which line we start
2 - how many lines we insert
3 - how many times we loop on the inserts
4 - how many lines we skip before next insert

I run it with start on line 2, insert 2 lines, loop 1500 times and skip 3 lines,
that gives image before and after the execution.

I tryed but can't reproduce the bug.
René.
Comment 9 BRANDT 2018-09-02 12:47:10 UTC
I will build testbug2 more closer that mine. Testbug was a very simplified version.
Comment 10 Xisco Faulí 2018-10-15 08:36:04 UTC
(In reply to BRANDT from comment #9)
> I will build testbug2 more closer that mine. Testbug was a very simplified
> version.

Any update ?
Comment 11 BRANDT 2018-10-15 08:41:11 UTC
Sorry to not answered before but i can't reproduce it, i tried many things but none reproduce the bug. So an update solved it.

Many thanks,
René.
Comment 12 Xisco Faulí 2018-10-15 08:50:02 UTC
(In reply to BRANDT from comment #11)
> Sorry to not answered before but i can't reproduce it, i tried many things
> but none reproduce the bug. So an update solved it.
> 
> Many thanks,
> René.

Closing as RESOLVED WORKSFORME then