https://bugs.documentfoundation.org/show_bug.cgi?id=168066
Bug ID: 168066
Summary: Inserting hyperlink from API fails, when not using
cursor
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.getEnd(), oField, False)
end sub
This macro fails on the last line with 'insertTextContent' with:
> BASIC runtime error.
> An exception occurred
> Type: com.sun.star.lang.IllegalArgumentException
> Message: .
But uncommenting the line with createTextCursor (and commenting the line with
'getEnd') succeeds.
insertTextContent doesn't require that the passed range be cursor. So it must
succeed.
--
You are receiving this mail because:
You are the assignee for the bug.