Basic: after sheets.copybyname or sheets.remove basic-variable points to wrong sheet

Bug #1379341 reported by MMS-Prodeia
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LibreOffice
Fix Released
Medium
libreoffice (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

This one is an upstream bug at libreoffice, so updating to a newer version of libre office should fix it!

As 14.04 is a LTS, it should get fixed.

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

Revision history for this message
In , Uwelengler (uwelengler) wrote :

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.

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

Revision history for this message
In , Uwelengler (uwelengler) wrote :

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.

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

Revision history for this message
In , Uwelengler (uwelengler) wrote :

*** Bug 70081 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Uwelengler (uwelengler) wrote :

*** Bug 70081 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Eugeny Shkrigunov (eshkrig) wrote :

*** Bug 70754 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Eugeny Shkrigunov (eshkrig) wrote :

*** Bug 70754 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Eugeny Shkrigunov (eshkrig) wrote :

Created attachment 88172
bug example

Revision history for this message
In , Eugeny Shkrigunov (eshkrig) wrote :

Created attachment 88172
bug example

Revision history for this message
In , Eugeny Shkrigunov (eshkrig) wrote :

Also getByIndex (see bug example).
Seems that affected all documents that assign variable = ThisComponent.Sheets. ...
Please, fix this bug in 4.1.3.

Revision history for this message
In , Eugeny Shkrigunov (eshkrig) wrote :

Also getByIndex (see bug example).
Seems that affected all documents that assign variable = ThisComponent.Sheets. ...
Please, fix this bug in 4.1.3.

Revision history for this message
In , Eugeny Shkrigunov (eshkrig) wrote :

Created attachment 88289
fix

A Sheet.RangeAddress does not get updated on copy or move.

Revision history for this message
In , Eugeny Shkrigunov (eshkrig) wrote :

Created attachment 88289
fix

A Sheet.RangeAddress does not get updated on copy or move.

Revision history for this message
In , Eugeny Shkrigunov (eshkrig) wrote :

Include the fix in next release, please.

Revision history for this message
In , Eugeny Shkrigunov (eshkrig) wrote :

Include the fix in next release, please.

Revision history for this message
In , Mstahl (mstahl) wrote :

there's some patch attached here - could some Calc developer please take a look?

Eugenij, it's best to send patches to gerrit - in bugzilla they are usually only found by accident, months later....

https://wiki.documentfoundation.org/Development/gerrit

Revision history for this message
In , Michael-stahl (michael-stahl) wrote :

there's some patch attached here - could some Calc developer please take a look?

Eugenij, it's best to send patches to gerrit - in bugzilla they are usually only found by accident, months later....

https://wiki.documentfoundation.org/Development/gerrit

Revision history for this message
In , Eugeny Shkrigunov (eshkrig) wrote :

(In reply to comment #7)
> there's some patch attached here - could some Calc developer please take a
> look?
>
> Eugenij, it's best to send patches to gerrit - in bugzilla they are usually
> only found by accident, months later....
>
> https://wiki.documentfoundation.org/Development/gerrit

Michael, thanks for the tip. I looked at the link. Sorry, I have no experience with git.

Revision history for this message
In , Eugeny Shkrigunov (eshkrig) wrote :

(In reply to comment #7)
> there's some patch attached here - could some Calc developer please take a
> look?
>
> Eugenij, it's best to send patches to gerrit - in bugzilla they are usually
> only found by accident, months later....
>
> https://wiki.documentfoundation.org/Development/gerrit

Michael, thanks for the tip. I looked at the link. Sorry, I have no experience with git.

Revision history for this message
In , Libreoffice-commits (libreoffice-commits) wrote :

Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8eec79e595eb651cd41e2f6a1918af67c4d43cf7

Revert "fix Worksheet.Cells by now allowing TableSheet..." fdo#70079

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.

Revision history for this message
In , Libreoffice-commits (libreoffice-commits) wrote :

Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8eec79e595eb651cd41e2f6a1918af67c4d43cf7

Revert "fix Worksheet.Cells by now allowing TableSheet..." fdo#70079

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.

Revision history for this message
In , Nopower (nopower) wrote :

*** Bug 74118 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Nopower (nopower) wrote :

*** Bug 74118 has been marked as a duplicate of this bug. ***

Revision history for this message
In , MMS-Prodeia (mms-prodeia) wrote :

Just wanted to let you know that this bug is still present in version 4.2.6.3!

It gave me a headache as my macro wasn't working anymore until I found this bug here!

As it is quite old, I thought it should have been fixed already!?

Revision history for this message
In , MMS-Prodeia (mms-prodeia) wrote :

Just wanted to let you know that this bug is still present in version 4.2.6.3!

It gave me a headache as my macro wasn't working anymore until I found this bug here!

As it is quite old, I thought it should have been fixed already!?

Changed in df-libreoffice:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Qa-admin-q (qa-admin-q) wrote :

** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

   Test to see if the bug is still present on a currently supported version of LibreOffice (5.0.1 or preferably 5.0.2.2 or later)
   https://www.libreoffice.org/download/

   If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior

 If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System

Please DO NOT

   Update the version field
   Reply via email (please reply directly on the bug tracker)
   Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case)

If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:

1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3)

http://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3
. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to "inherited from OOo";
4b. If the bug was not present in 3.3 - add "regression" to keyword

Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa

Thank you for your help!

-- The LibreOffice QA Team This NEW Message was generated on: 2015-10-14

Revision history for this message
In , Eugeny Shkrigunov (eshkrig) wrote :

LibreOffice-4.4.5.2 is fine.

Revision history for this message
In , Xiscofauli (xiscofauli) wrote :

Hello,
Is this bug fixed?
If so, could you please close it as RESOLVED FIXED?

Revision history for this message
In , Uwelengler (uwelengler) wrote :

tested with version Version: 5.1.4.2

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This release of Ubuntu is no longer receiving maintenance updates. If this is still an issue on a maintained version of Ubuntu please let us know.

Changed in libreoffice (Ubuntu):
status: New → Incomplete
Changed in df-libreoffice:
importance: Medium → Unknown
status: Confirmed → Unknown
Changed in df-libreoffice:
importance: Unknown → Medium
status: Unknown → Fix Released
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Synchronising bug status with upstream.

Changed in libreoffice (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.