Bug 78522 - Macros: [REGRESSION] InsertByIndex works bad
Summary: Macros: [REGRESSION] InsertByIndex works bad
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version: 4.2.3.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard: BSA PossibleRegression
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-10 08:41 UTC by Teo91
Modified: 2014-05-29 08:58 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
InsertByIndex comparison LO 4.1 - 4.2, before and after (193.84 KB, image/jpeg)
2014-05-10 08:41 UTC, Teo91
Details
Test file .ods for InsertByIndex bug (11.21 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-05-10 08:42 UTC, Teo91
Details

Description Teo91 2014-05-10 08:41:41 UTC
Created attachment 98809 [details]
InsertByIndex comparison LO 4.1 - 4.2, before and after

Problem description:

Something works bad with "InsertByIndex", you can see the range is altered when the number of row to insert is equal or greater than 2.

Look at the image for a comparison between LO 4.1.x and LO 4.2

Here is the macro code where the issue is located:

sub bug
oSheet = ThisComponent.currentController.activeSheet
oCell=thisComponent.getCurrentSelection()
lrow=oCell.RangeAddress.StartRow
oSheet.getRows.insertByIndex(lrow, 2)
end sub

Try the attached .ods test file:

- there is the formula =SUM(A9:C9) 
- use InsertByIndex macro instruction to insert rows above existing ones and you will get an alteration of the range used by =SUM()
- same issue happens using =PRODUCT() and generally operations working on cells range.

Current behavior:

Range is changed when when the number of row to insert is equal or greater than 2.

Expected behavior:

InsertByIndex should work well with no range alteration, like in LO 4.1.x

              
Operating System: All
Version: 4.2.3.3 release
Last worked in: 4.1.6.2 release
Comment 1 Teo91 2014-05-10 08:42:41 UTC
Created attachment 98810 [details]
Test file .ods for InsertByIndex bug
Comment 2 Julien Nabet 2014-05-10 17:25:17 UTC
On pc Debian x86-64 with master sources updated today or with 4.2 updated yesterday, I don't reproduce this.
2 rows are inserted above the current row.
Comment 3 Teo91 2014-05-29 08:58:52 UTC
I tried LO 4.2.5 pre-release and this issue is no more.
Whatever was my bug, it's gone.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.