Bug 144259 - Macro fails working properly after upgrading to 7.2
Summary: Macro fails working properly after upgrading to 7.2
Status: RESOLVED DUPLICATE of bug 144085
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.2.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected
Depends on:
Blocks:
 
Reported: 2021-09-02 07:30 UTC by CSLam
Modified: 2021-09-13 08:26 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample Worksheet (29.29 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-09-08 09:02 UTC, CSLam
Details

Note You need to log in before you can comment on or make changes to this bug.
Description CSLam 2021-09-02 07:30:08 UTC
Description:
A macro has been developed to ease duplicating a row at end of the worksheet, which is marked by a yellow line (full row in yellow) :-

Row X: End of Worksheet,
Row X+1: Yellow Line.

After upgrading to 7.2, a new row is correctly inserted between Row X and Row X+1.  However, instead of duplicating data to the new row, where it used to do in the past, LibreOffice is pasting data to Row X, leaving the newly added row blank :-

Row X: End of Worksheet, overwritten,
Row X+1: new row, blank
Row X+2: Yellow Line.

Steps to Reproduce:
1. I guess somebody can look into related macro environment, see if any changes have been brought into scene with 7.2 upgrade.
2.
3.

Actual Results:
n/a

Expected Results:
n/a


Reproducible: Always


User Profile Reset: No



Additional Info:
It is something serious, because it is hitting all files created prior to version 7.2.
Comment 1 CSLam 2021-09-02 07:51:49 UTC Comment hidden (obsolete)
Comment 2 Timur 2021-09-02 10:01:20 UTC
Not correct and clear bug report. 
You need to write reproducible steps, what's Experienced and Expected.
Here you also need to attach sample ODS with some data and macro, with steps that are exactly described for those data.
Comment 3 CSLam 2021-09-03 03:34:41 UTC
Sorry that it is felt insufficient data has been provided.

What's Experienced and Expected:
I believe such has been described.

It is true that no reproducible steps have been provided, and in this situation only a sample file will illustrate the point.

The file is not provided because, as I see the situation:
macro behavior only changes when transiting from ver 7.1.5.2 ver 7.2.0.4,
and this is clear enough a general issue with ver 7.2.0.4 - same macro working in older versions but not the new one, implying a very high possibility of something happening with the new version application.

I therefore think that the first step is to verify if indeed there are changes introduced ending in affecting macro behaviour, whether intentional or unintentional.  For example in a previous version change, the use of "#" in hyperlink is amended (or rectified), thus once said everybody knows why the new behaviour of hyperlinks in the then new version LibreOffice (ENDCODEURL needed as a fix).


If at this point the situation cannot be followed up, just let it be, and be aware of a potential issue with macros, as chance is there that other issues will surface, affecting some other users.
Comment 4 QA Administrators 2021-09-03 04:04:22 UTC Comment hidden (obsolete)
Comment 5 Xisco Faulí 2021-09-03 08:32:42 UTC Comment hidden (obsolete)
Comment 6 CSLam 2021-09-08 09:02:42 UTC
Created attachment 174878 [details]
Sample Worksheet

The attachment is a sample file, which is still working fine prior to LibreOffice 7.2.  It begins behaving out of order using the version 7.2 system.

Note
1. The three buttons on the top left are respectively for sorting, add a new row, and duplicate a row (duplicating the row where the cursor is, when it is below the second and above the last row, ie. in the main data area).
2. The second row is for defining the sort order; simply using 1, 2, 3 to define the sequence, using -1, -2, -3 to take descending order.

PS
The buttons were previously genuine buttons, but on a LibreOffice upgrade earlier on, the buttons failed (causing the macros to work incorrectly), while the macros remained working absolutely correctly by themselves, therefore the switch to using shapes instead.  This was a pretty long time ago.
Comment 7 Timur 2021-09-08 12:38:10 UTC
Linux 7.2 commit 7eec0829d44ff995d0f7d240a27819fec29624bf
Date:   Fri Apr 30 21:50:27 2021 +0200
    source 61386aa03cd166473a58dbb4be0dd5e0ce82195c
    pre deac5c84732c3491a0ef5bf7f8c1552e6def4fc0

Not sure if this old OO macro is correct so not confirming as a regression.
Comment 8 CSLam 2021-09-09 02:58:40 UTC
I wish to reiterate that the macro though old has been working fine up to version 7.1; if the said macro is not correct, it should not have been running in the first place.  As said, it only turns bad from version 7.2, implying something done, whether intentionally or unintentionally in the new platform.  If there is the change and nobody knows about it, then an unintentional change, it can potentially cause trouble sooner or later.  In case this is something intentional, backward compatibility has obviously been missed.

The present situation is creating an version barrier, implying that people wishing to maintain the present workability of the stuffs will have to stay on version 7.1, and cannot go any further.  This may be of some thoughts to the developer.
Comment 9 Ming Hua 2021-09-09 03:20:52 UTC Comment hidden (obsolete)
Comment 10 Ming Hua 2021-09-09 03:23:17 UTC
(In reply to Ming Hua from comment #9)
> This is
> https://git.libreoffice.org/core/+/61386aa03cd166473a58dbb4be0dd5e0ce82195c%5E!
Bugzilla doesn't handle URLs with exclamation marks well, so use this instead:
https://git.libreoffice.org/core/+/61386aa03cd166473a58dbb4be0dd5e0ce82195c
Comment 11 Timur 2021-09-09 06:44:19 UTC
Change was in bug 79049 as a speedup. It caused this bug and bug 144085.
Question is what is more important and if this macro can be created differently.
Comment 12 Mike Kaganski 2021-09-09 06:53:06 UTC
(In reply to Timur from comment #11)
> Question is what is more important and if this macro can be created
> differently.

Heh, no. In this specific case, there is no questions. This change broke a *published API*.

Specifically, XUsedAreaCursor Interface is documented [1] to operate on "used area of the entire sheet", which is "the smallest cell range that contains all cells of the spreadsheet with any contents (values, text, formulas) or *visible formatting (borders and background color)*". Breaking published API is no-go :-)

[1] https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1sheet_1_1XUsedAreaCursor.html
Comment 13 Mike Kaganski 2021-09-09 07:09:13 UTC Comment hidden (obsolete)
Comment 14 CSLam 2021-09-09 08:58:29 UTC Comment hidden (obsolete)
Comment 15 Timur 2021-09-09 09:01:22 UTC
Hi Noel. Please see this as a result of you commit.
Comment 17 Xisco Faulí 2021-09-13 08:26:34 UTC
Closing as duplicated of bug 144085

*** This bug has been marked as a duplicate of bug 144085 ***