Issue 113820

Summary: TEXT function not working as expected - com.sun.star.sheet.FunctionAccess is broken
Product: Calc Reporter: Oliver Brinzing <oliver.brinzing>
Component: programmingAssignee: oc
Status: CLOSED FIXED QA Contact: issues@sc <issues>
Severity: Trivial    
Priority: P2 CC: issues
Version: OOO330m3Keywords: regression
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Issue Depends on:    
Issue Blocks: 111112    
Attachments:
Description Flags
test_format
none
test cases, augmented from issue 108385 none

Description Oliver Brinzing 2010-08-11 18:26:02 UTC
steps to reproduce: 

run macro provided below

OO 1.1.5/3.2/3.2.1 will show "--04" 
OOO330m3 will show "4"

so i think this is a regression ...

REM  *****  BASIC  *****
OPTION EXPLICIT

Sub Main

	Dim oService as Object
	Dim mArgs(1)
	Dim res as Variant
	
	oService = createUNOService("com.sun.star.sheet.FunctionAccess")

	mArgs(0) = "4"
        mArgs(1) = "--0#"
	' example: convert the given value to a "xs:gMonth" ...
        res = oService.callFunction("TEXT", mArgs())
	
	MsgBox res
End Sub
Comment 1 Oliver Brinzing 2010-08-12 10:12:57 UTC
noticed: " mArgs(0) = 4 "will work, so there is a problem 
with text/number conversion ?

btw: attached "test_format.ods" will show, that =TEXT(xVal, Format) function
still accepts number/string values for xVal parameter ...
Comment 2 Oliver Brinzing 2010-08-12 10:13:42 UTC
Created attachment 71050 [details]
test_format
Comment 3 ooo 2010-08-12 11:52:27 UTC
There were changes in the TEXT function, see
http://eis.services.openoffice.org/EIS2/changesmails.EditFeature?Id=4698
Erroneously a text string passed as argument is treated differently from textual
cell content, i.e. =TEXT("4";"--0#") is different from =TEXT(B1;"--0#") with B1:'4
Comment 4 ooo 2010-08-18 15:43:10 UTC
Created attachment 71168 [details]
test cases, augmented from issue 108385
Comment 5 ooo 2010-08-18 15:54:41 UTC
In cws calc58:

changeset 64f1e0baf188
http://hg.services.openoffice.org/cws/calc58/changeset/64f1e0baf188
M sc/source/core/tool/interpr1.cxx

You can observe the progress and possible integration date of CWS calc58 at
http://tools.services.openoffice.org/EIS2/cws.ShowCWS?Path=OOO330%2Fcalc58
Comment 6 ooo 2010-08-23 11:33:06 UTC
Reassigning to QA for verification.
Comment 7 oc 2010-08-25 12:22:56 UTC
verified in internal build cws_calc58