Modify

Opened 14 years ago

Closed 14 years ago

#2076 closed Bug (Fixed)

Object value can't be set True

Reported by: chrisg1941@… Owned by: trancexx
Milestone: 3.3.9.0 Component: AutoIt
Version: 3.3.8.0 Severity: None
Keywords: Cc:

Description

I have been trying to implement programming of Open Office through AutoIt. Open Office requires the passing of an object to its loadComponentFromURL function. This object consists of a Name and a Value, and is used to pass various information on the file, such as password (passes a string value) and Readonly (passes a boolean).

I have implemented a function to set up this up, based on several examples in these forums. However, I find that while this passes strings OK, it apparently cannot be used to set boolean values to true - whatever I try, it stays as false.

Here's a quick and dirty example which demonstrates this:

Dim $OpenPar

; This returns object with both fields correct
$OpenPar = MakePropertyValue("Password", "secret")

; This returns object with value False as requested
$OpenPar = MakePropertyValue("ReadOnly", False)

; This returns object with Vlue False, not True as reuqested
$OpenPar = MakePropertyValue("ReadOnly", True)

Exit

Func MakePropertyValue($cName, $uValue)
    $oSM = Objcreate("com.sun.star.ServiceManager")
    $oPropertyValue = $oSM.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
    $oPropertyValue.Name = $cName
    $oPropertyValue.Value = $uValue
    MsgBox(0,$oPropertyValue.Name,$oPropertyValue.Value)
    $setOOoProp = $oPropertyValue
    Return $setOOoProp
EndFunc

Attachments (0)

Change History (1)

comment:1 by trancexx, 14 years ago

Milestone: 3.3.9.0
Owner: set to trancexx
Resolution: Fixed
Status: newclosed

Fixed by revision [6571] in version: 3.3.9.0

Modify Ticket

Action
as closed The owner will remain trancexx.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.