This MAY be a bug but I thought best to see if any OOForum experts had something to say on the topic before getting involved with Bugzilla, etc.
Preamble
Code: Select all
function insertText(newText as string, boldWeight as boolean, italicSlant as boolean)
oVC = thisComponent.getCurrentController.getViewCursor
Code: Select all
oVC.charWeight = iif(boldWeight, com.sun.star.awt.FontWeight.BOLD, com.sun.star.awt.FontWeight.NORMAL)
Code: Select all
oVC.charPosture = iif(italicSlant, com.sun.star.awt.FontSlant.ITALIC, com.sun.star.awt.FontSlant.NONE)
However.Inadmissible value or data type.
Data type mismatch.
I CAN do this
Code: Select all
if italicSlant then
oVC.charPosture = com.sun.star.awt.FontSlant.ITALIC
else
oVC.charPosture = com.sun.star.awt.FontSlant.NONE
end if
Postamble
Code: Select all
oText = oVC.text
oText.insertString(oVC, newText, False)
end function
My question is: why does the If..else..end if statement work when the iif(..,..,..) doesn't.
Thanks in advance
David
PS. My external limits for the mo, from outside circumstances, are that I keep to AOO Basic, and can't use MRI because it somehow got broken and fixing that is going to mean an upgrade which I don't currently have time for.