Bug 45987 - FORMCONTROLS: Error message when deleting pages
Summary: FORMCONTROLS: Error message when deleting pages
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.0 RC2
Hardware: Other All
: medium normal
Assignee: Markus Mohrhard
URL:
Whiteboard: BSA target:3.6.0 target:3.5.4
Keywords: regression
: 49913 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-13 03:25 UTC by dany franck
Modified: 2013-11-10 11:32 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Document with macros deleting sheets (13.65 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-05-05 05:46 UTC, Philippe GALLEY
Details
Document with macros deleting sheets 2 (14.99 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-05-14 14:20 UTC, Philippe GALLEY
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dany franck 2012-02-13 03:25:10 UTC
Problem description: 

Error message when deleting à page via DCOM

Steps to reproduce:

this code in delphi
 
if I > iNbWorkSheet then begin
while I > iNbWorkSheet do begin
mxDocument.Sheets.removeByName('Feuille'+IntToStr(I));
Dec(I);
end;

gives the following error message
com.sun.star.uno.RuntimeException: [msci_uno bridge error] UNO type of C++ exception unknown: "std.out_of_range",RTTI-name=".?AVout_of_range@str@@"!

with 3.5RC3

No problem with 3.4 serie



              
Browser: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20100101 Firefox/11.0
Comment 1 Francesco Muzul 2012-03-17 15:14:21 UTC
' this VbScript code raises the exception
' when used with OpenOffice it works well

Dim rSheets
Set rSheets = objDocument.getSheets

if rSheets.getCount() >= 3 then rSheets.removeByName(rSheets.getByIndex(2).Name)
Comment 2 Philippe GALLEY 2012-05-03 10:31:56 UTC
An error occurs when deleting sheets using a LibreOffice Basic macro.
No problem when using LibreOffice V 3.3.4 or OpenOffice 3.3.0

Os: Windows VISTA
LibreOffice version 3.5.3

Steps to reproduce:

Add the following macro in a new spreadsheet document:

Sub TestRemove
Dim StrNameOfSheet as String
Dim LgNumberOfSheets as Long
LgNumberOfSheets = ThisComponent.sheets.count
If LgNumberOfSheets >= 2 then
'Deleting sheets
 For j =  LgNumberOfSheets - 1 To 1 Step -1
   StrNameOfSheet =  ThisComponent.sheets.ElementNames(j)
   ThisComponent.sheets.RemoveByName(StrNameOfSheet)
 Next j
Endif
end sub

Execute the macro.

The following exception occurs:
Type: com.sun.star.uno.RuntimeException
Message : [msci_uno bridge error] UNO type of C++ exception unknown:
“std.out_of_of_range”, RTTI-name=”.?AVout_of_range@std@@”!.

The following procedure will avoid the exception:
Before running the macro, add manually a new sheet.
Comment 3 Philippe GALLEY 2012-05-05 05:46:22 UTC
Created attachment 61076 [details]
Document with macros deleting sheets

The attached document contains 2 macros

First macro reproduces the bug while removing sheets.
second macro gives a solution to avoid the bug.
Comment 4 Philippe GALLEY 2012-05-14 14:20:41 UTC
Created attachment 61657 [details]
Document with macros deleting sheets 2

Attached document modified to explain more precisely the bug.

To reproduce the bug, the default number of sheets in a new spreadsheet document must be set out to 3 or more.
Tools>Options>LibreOffice Calc>Default>3 (approximately translated from french)
Comment 5 Jean-Baptiste Faure 2012-05-15 00:12:58 UTC
Please, do not modify version number: it shows the first version in which the bug has been found.

Works in 3.4 serie, so regression.

Best regards. JBF
Comment 6 sasha.libreoffice 2012-05-17 07:33:09 UTC
Bug described in comment 2 reproduced in 3.5.3 on Fedora 64 bit
in 3.3.4 it works correctly, therefore regression
Comment 7 sasha.libreoffice 2012-05-17 07:34:16 UTC
@ Noel
Greetings
What do You think about this bug?
Comment 8 Noel Power 2012-05-17 14:02:50 UTC
confirmed, some api problem here with calc
Comment 9 Not Assigned 2012-05-17 14:10:20 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

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

fix bad stl access fdo#45987
Comment 10 sasha.libreoffice 2012-05-17 22:45:40 UTC
Thanks for fixing this bug
Comment 11 Markus Mohrhard 2012-05-18 09:09:14 UTC
I'll take this one. It needs another fix.
Comment 12 Not Assigned 2012-05-18 10:42:25 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=90d0efb524b2cdd8d65808d18713bfd6b1d117ea

Revert 4 commits related to fdo#45987
Comment 13 Not Assigned 2012-05-18 10:42:52 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=13bb6dcddcd3e19cd97fdb28e842c778e6e093b3

ensure that number of tabs is correctly set in ScViewData, fdo#45987
Comment 14 Not Assigned 2012-05-18 11:39:20 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=aab5d1e0caed5f65562d5eb4ac78c8467fb7c979&g=libreoffice-3-5

ensure that number of tabs is correctly set in ScViewData, fdo#45987


It will be available in LibreOffice 3.5.5.
Comment 15 Not Assigned 2012-05-21 07:27:33 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-3-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6c24c4f0becb40ac0450ccdb49c9af4ebcbd581b&g=libreoffice-3-5-4

ensure that number of tabs is correctly set in ScViewData, fdo#45987


It will be available already in LibreOffice 3.5.4.
Comment 16 Philippe GALLEY 2012-05-24 14:27:01 UTC
Thanks for the bug fix. (tested on 3.5.4RC2)
Comment 17 Markus Mohrhard 2012-06-24 19:19:51 UTC
*** Bug 49913 has been marked as a duplicate of this bug. ***