Bug 60065 - BASIC: Can't set an object to NamedValue structure
Summary: BASIC: Can't set an object to NamedValue structure
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.0.0.2 rc
Hardware: Other Windows (All)
: high critical
Assignee: Noel Power
URL:
Whiteboard: BSA target:4.1.0 target:4.0.1
Keywords: regression
: 60371 (view as bug list)
Depends on:
Blocks: mab4.0
  Show dependency treegraph
 
Reported: 2013-01-30 10:28 UTC by pierre-yves samyn
Modified: 2013-02-09 06:13 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Spreadsheet "NameValueBug" containing the code (8.56 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-01-30 10:28 UTC, pierre-yves samyn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pierre-yves samyn 2013-01-30 10:28:07 UTC
Created attachment 73916 [details]
Spreadsheet "NameValueBug" containing the code

Hello

Platform: Windows XP Pro 
Version 4.0.0.2 (Build ID: 5991f37846fc3763493029c4958b57282c2597e)

Steps to reproduce:
1. Open the attached spreadsheet "NameValueBug.ods"
2. Tools> Macros> Run> NameValueBug> Standard> Module1> TestNameValue

Expected result: Value set to CellAddress
Actual result: Basic runtime error, Object variable not set 

This is a regression (was ok in 3.6)

It is boring because this type of coding is required to programmatically set lists box sources (setListEntrySource), or linked cells to controls (setValueBinding), and so on.

Note: The following is the code contained in the attached spreadsheet. It is reduced to what is necessary to highlight the bug.

option explicit

sub TestNamedValue

dim oSheet as object
dim oCell as object
dim oNamedValue as new com.sun.star.beans.NamedValue 

oSheet = thiscomponent.sheets.getByIndex(0)
oCell = oSheet.getCellRangeByName("A1")

oNamedValue.Name  = "BoundCell" 
oNamedValue.Value = oCell.CellAddress

end sub

Regards
Pierre-Yves
Operating System: Windows XP
Version: 4.0.0.2 rc
Last worked in: 3.6.4.3 release
Comment 1 Michel Rudelle 2013-01-30 15:32:51 UTC
I reproduce:
Version 4.0.0.2 .0.2 (Build ID: 5991f37846fc3763493029c4958b57282c2597e)
and
Version 4.0.1.0+ (Build ID: 0dadaa4521629aab3e1c16413541efb9b62d095)
Vista
Comment 2 Pierre C 2013-02-01 19:55:32 UTC
Maybe the same bug :

PysRef = PysObj.ValueBinding.BoundCell
PysRef.Sheet = PysFeuille.rangeAddress.sheet
PysNamedValue.Name  = "BoundCell" 

the third line return an error 

"erreur d'éxécution basic. Varaible d'objet non définie."

something like : "Basic exec error. Object var undefined"

This is a very very annoying, as marco doesn't work and there is no workaround as far as I know.
Comment 3 pierre-yves samyn 2013-02-03 09:26:15 UTC
Hello

Reproduced with Windows 7 64bits & Version 
4.0.0.3 (Build ID: 7545bee9c2a0782548772a21bc84a9dcc583b89)

Regards
Pierre-Yves
Comment 4 Lionel Elie Mamane 2013-02-03 09:40:51 UTC
Adding our Basic experts in CC.
Comment 5 Noel Power 2013-02-05 10:11:49 UTC
yup, this is bad ( and easily reproduced )
Comment 6 Not Assigned 2013-02-05 10:41:00 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6d0f1f66392515a0789f15c90a430b7047ca1f04

fix for fdo#60065



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.
Comment 7 Petr Mladek 2013-02-07 09:35:20 UTC
*** Bug 60371 has been marked as a duplicate of this bug. ***
Comment 8 Not Assigned 2013-02-07 09:37:08 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6644caf9048495ddb6174d7ec30daa7e20e2828e&h=libreoffice-4-0

fix for fdo#60065


It will be available in LibreOffice 4.0.1.

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.
Comment 9 Michael Meeks 2013-02-07 11:21:36 UTC
So fixed then ... thanks Noel :-)
Comment 10 pierre-yves samyn 2013-02-09 06:13:53 UTC
Hello

WORKSFORME with Version 4.1.0.0.alpha0+ (Build ID: 8e658ca263808d3466c62b2acfc82d61901fa57)
TinderBox: Win-x86@6, Branch:master, Time: 2013-02-08_22:04:23

Thank you very much :)

Regards
Pierre-Yves