Bug 70081 - BASIC: after sheets.copybyname or sheets.remove basic-variable points to wrong sheet
Summary: BASIC: after sheets.copybyname or sheets.remove basic-variable points to wron...
Status: RESOLVED DUPLICATE of bug 70079
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.1.1.2 release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-03 15:10 UTC by uwe lengler
Modified: 2013-10-03 15:12 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description uwe lengler 2013-10-03 15:10:29 UTC
basic variable = sheets.getbyname(..)

After inserting a new sheet with sheets.copybyname before this sheet , the basic variable points to the wrong sheet, here sheetpositon -1. You get the same effect after removing a sheet, the variable points then to sheetpositon+1.

The problem is new in  this LO version. A retest in LO 4.0 is OK.

Here a code example :
REM  *****  BASIC  *****
global otabledoc as variant
Sub Main
oTableDoc=ThisComponent
oSheets = oTableDoc.sheets
if osheets.hasbyname("Tabellenew") then
  osheets.removebyname("Tabellenew")
endif

Sheet1 = oSheets.GetbyName("Tabelle1")
oSheets = oTableDoc.sheets
'msgbox osheets.dbg_methods

osheets.copybyname(sheet1.name,"Tabellenew",0) 'because 3.Parameter = 0 -->  insert the new sheet before the sheet1 Tabelle1
'if you insert the new sheet after the old sheet, everything is ok.

Sheet1.getCellByPosition(0,0).string=sheet1.name 'write to the sheet Tabellenew, not to the sheet Tabelle1

End Sub



This is a duplicate bug-report to

https://www.libreoffice.org/bugzilla/show_bug.cgi?id=70079

Because I didn't kown the best way to submit a bug.
              
Operating System: Windows 7
Version: 4.1.1.2 release
Comment 1 uwe lengler 2013-10-03 15:12:33 UTC

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