https://bugs.documentfoundation.org/show_bug.cgi?id=168073
Bug ID: 168073
Summary: Calc: Inserting hyperlink from API fails, when using
SheetCell as the range
Product: LibreOffice
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Calc
Assignee: [email protected]
Reporter: [email protected]
Consider this Basic macro:
sub addHyperlinkA1
doc = StarDesktop.loadComponentFromURL("private:factory/scalc", "_blank", 0,
Array())
oCell = doc.Sheets(0).getCellByPosition(0,0)
oField = doc.createInstance("com.sun.star.text.TextField.URL")
oField.URL = "http://www.example.org/"
oField.Representation = "hyperlink"
'oCell.insertTextContent(oCell.createTextCursor(), oField, False)
oCell.insertTextContent(oCell, oField, False)
end sub
This macro fails on the last line with 'insertTextContent' with:
> BASIC runtime error.
> An exception occurred
> Type: com.sun.star.beans.UnknownPropertyException
> Message: Selection.
But uncommenting the line with createTextCursor (and commenting the line with
bare 'oCell') succeeds.
oCell implements XTextRange interface itself, so it must succeed.
--
You are receiving this mail because:
You are the assignee for the bug.