https://bugs.documentfoundation.org/show_bug.cgi?id=167420
Bug ID: 167420
Summary: Different result of function
ThisComponent.Sheets.moveByName(name, index)
Product: LibreOffice
Version: 25.2.3.2 release
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: BASIC
Assignee: [email protected]
Reporter: [email protected]
Description:
I have macros writted in versions 7 and older.
In connection with ticket 167178 I discover different behaviour of function
ThisComponent.Sheets.moveByName(name, index)
in version 25.2.3.2 and 25.2.6.
I do't know if it is bug or new property...
Steps to Reproduce:
In table with sheets
Sheet0 Sheet1 Sheet3 Sheet4 lastsheet
run this code which insert new sheet a next move it to right order:
Sub Main
oLast = ThisComponent.Sheets.getByName("lastsheet")
ThisComponent.Sheets.insertNewByName("Sheet2", 0)
oSheet = ThisComponent.Sheets.getByName("Sheet2")
for i = oLast.RangeAddress.sheet - 1 to 1 step -1
j = strComp(ThisComponent.Sheets.getByIndex(i).getName(),"Sheet2")
if j = -1 then
ThisComponent.Sheets.moveByName("Sheet2", i + 1)
exit for
end if
next i
End Sub
Actual Results:
Order of sheets in versions 25.2. is
Sheet0 Sheet1 Sheet3 Sheet2 Sheet4 lastsheet
Expected Results:
Order of sheets in versions 7.5.0.3. and olders, is:
Sheet0 Sheet1 Sheet2 Sheet3 Sheet4 lastsheet
Reproducible: Always
User Profile Reset: No
Additional Info:
I only have official versions 25.2. and later for testing and version 7.5.0.3
in which I once wrote the code.
I can't find out exactly from which version the behavior of the moveByName()
function changed.
Thanks
--
You are receiving this mail because:
You are the assignee for the bug.