Apache OpenOffice (AOO) Bugzilla – Issue 35553
sentence cursor reverses in empty par
Last modified: 2013-02-24 21:07:01 UTC
REGRESSION jumping the cursor to the beginning of a sentence jumps to the end instead if the cursor is in a sentence which follows an emppty paragraph (two carriage returns). Correspondingly, depeting to the beginning of such a sentence deletes instead from the cursor to the end. Placing anything inside the empty paragraph, even a space, is a workaround.
Created attachment 18572 [details] Document with macro to check the behaviour
The attached document is a text document, which contains the following text: --------------------- First sentence begin and end --------------------- when I now place the cursor somewhere in the second sentence and run the macro viewCursor = ThisComponent.currentController.getViewCursor xCursor = thiscomponent.text.createTextCursorByRange(viewCursor.start) xCursor.gotoStartOfSentence(false) xCursor.goRight(5,true) msgbox xCursor.String the word "begin" is returned as expected ... I used a m_57 ... am I missing something ?
That's strange. I can definitely reproduce it in m56. Running this macro: Sub bugtest dim viewcursor dim xcursor viewCursor = ThisComponent.currentController.getViewCursor xCursor = thiscomponent.text.createTextCursorByRange(viewCursor.start) 'xCursor.gotoPreviousSentence(false) xCursor.gotoPreviousSentence(TRUE) ' xCursor.goRight(5,true) msgbox xCursor.getString end sub with the cursor in the middle of "test" in a document that says "This is a test and so is this." gives me a message of "st" and not "is a" could you check that in m57, since you've got it.
SW->TL: ok the problem isn't "gotoStartOfSentence" which works fine, but "gotoPreviousSentence" ... the macro provided by andrewb shows indeed the described behaviour
Set to target OOoLater due to lack of resources.