Apache OpenOffice (AOO) Bugzilla – Issue 66141
gotoEndofWord, isEndofWord misbehavior with footnote anchor
Last modified: 2017-05-20 09:32:01 UTC
In a Write document, if a word is followed by a footnote anchor, the method gotoEndofWord() returns FALSE. Related to this, if the cursor is placed at the end of that word, the method isEndofWord() also returns FALSE. To reproduce this, create a Write document with some words. At the end of one word, insert a footnote. Then place your cursor within that word. Use the following macro: Sub Main oDoc = thiscomponent oVCursor = oDoc.getCurrentController().getViewCursor() oText = oVCursor.getText() mySelection = oText.createTextCursorByRange (oVCursor.getstart()) msgbox "isEndOfWord= " + mySelection.isEndofword() msgbox "gotoEndofWord= " + mySelection.gotoEndOfWord(TRUE) End Sub Upon execution, the second message shows that gotoEndOfWord returns FALSE (using gotoEndOfWord(FALSE) does the same). If now you put the cursor at the end of that word, just before the footnote anchor, executing the macro shows both methods return FALSE. (Putting the cursor after the footnote anchor also gives isEndofWord=FALSE) The same tests executed on words not followed by footnote anchors give the expected appropriate behavior. (If the footnote is within a word -- who would do that!? -- the method is working; in fact, it works if a period, letter or number is inserted after the footnote. But doesn't work if a comma or semi-colon is after the footnote. I had these details in the hope it could help pinpoint the problem.) There was a similar issue here by andrewb, but which involved smart quotes: http://www.openoffice.org/issues/show_bug.cgi?id=12036 It was closed in March 2004.
[Unfortunately can't edit my previous post. Of course, use following in the sub: Dim oDoc as Object, oText as Object, oVCursor As Object, mySelection As Object ]
JSC -> TL: can you please check this, it's writer API
change owner
Six months later, is this still unconfirmed? I'm the only one?
.
No more issues accepted for OOo 2.4 unless there are serious problems.