Consider this Basic code: sub testCellXText doc = StarDesktop.loadComponentFromURL("private:factory/scalc", "_blank", 0, Array()) oCell = doc.Sheets(0).getCellByPosition(0,0) oCell.getStart() oCell.String = "b" oCell.insertString(oCell.createTextCursor(), "c", false) oCell.insertString(oCell.getStart(), "a", false) oCell.insertString(oCell.getEnd(), "d", false) oCell.insertString(oCell, "e", false) oCell.insertString(oCell.createTextCursor(), " 1: ", false) oField = doc.createInstance("com.sun.star.text.TextField.URL") oField.URL = "http://www.example.org/" oField.Representation = "h1" oCell.insertTextContent(oCell.createTextCursor(), oField, false) oCell.insertString(oCell.getEnd(), " 2: ", false) oField = doc.createInstance("com.sun.star.text.TextField.URL") oField.URL = "http://www.example.org/" oField.Representation = "h2" oCell.insertTextContent(oCell.createTextCursor(), oField, false) oCell.insertString(oCell, " 3: ", false) oField = doc.createInstance("com.sun.star.text.TextField.URL") oField.URL = "http://www.example.org/" oField.Representation = "h3" oCell.insertTextContent(oCell.createTextCursor(), oField, false) end sub The expected result of the code is "abcde 1: h1 2: h2 3: h3" (with h1, h2, h3 hyperlinks). In 25.8.0.4, it produces "abcd 1: h1 2: h3h2"; the problems are silently failing call inserting "e" and " 3: ", and out-of-order insertion of "h3". Silently failing insertion is related to bug 168073. However, after commits a8ce5af575ea5e05eb7c349d50b4eb08cab983ff and 02c9a71ea5344178b2849d153d0b1d83a681e334, there still is the out-of-order insertion problem: "abcde 1: h1 2: 3: h2h3".
https://gerrit.libreoffice.org/c/core/+/190142
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/e6eeace8879dd68760bc5e09664196e12d8fc9d5 tdf#168096: reset selection each time GetUnoText is called It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mike Kaganski committed a patch related to this issue. It has been pushed to "libreoffice-25-8": https://git.libreoffice.org/core/commit/cd8f79fc01173ce66e84bef7be6bc04912e59fb0 tdf#168096: reset selection each time GetUnoText is called It will be available in 25.8.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.