Apache OpenOffice (AOO) Bugzilla – Issue 27031
move-by-sentence-backwards broken
Last modified: 2013-08-07 14:38:26 UTC
REGRESSION: CRASHES: I have move-to-previous-sentence bound to a key combinaiton (ctrl-shift-uparrow, if it matters). if the cursor is beyond the end of the paragraph, and I use this key combination, either the whole program crashes, or the cursor leaps to the beginning of the previous paragraph, not sentence. If the cursor is within the paragrah, it works as it should. Moving forward by sentences works as it should. The crashing does not always happen, and may only come if the paragraph is the first one. But any crash is a P1, as I understand it, and I have had this three times. Steps to repeat: Bind some key combination to [to previous sentence] open a new document. INsert a paragraph dummy text from autotext (dt, F3). The cursor will now be at the end of the paragraph. Attempt to move backwards by sentence. Boom.
I would like to add that the problem persists in 680m32 also, but does not lead to a crash. 1 Inside a normal paragraph Ctrl + up / down arrow keys doesn't work. Ctrl + shift + up/down are also broken. 2 Inside a table Ctrl + up/down are broken. Ctrl + Shift + up/down will take you to the start or end of the document. Selection is the expected behaviour normally.
MRU->ES: looks like a key-configuration problem.
I don't think it's a key configuration problem. It looks more like the way the command is being interpreted after it is bound. in m_34, the crashes have gone away, but the movement skips a sentence if you start with a cursor within a paragraph -- ie, it moves backwards _two_ sentences at a time (though still moving by one sentence at a time when moving forwards). But if the cursor is at the end of a paragraph then it moves right back to the beginning of the entire paragraph in one leap.
No crash -> P3 since 680 (1.1.1 is ok), the command "to previous sentence" jumps to the top of the previous paragraph when the cursor is in an other paragraph or jumps 2 sentences backwards.
reassigned to FME
FME->KHONG: Could you please have a look?
FME->TL: I think this might be related to your changes in SwCursor::GoSentence(). Note: please check special case nPos = USHRT_MAX.
.
TL->Khong: I discussed with OS and he said the function "beginOfSentence" (ans the like) should be allowed to take the position after the last character as valid argument. I.e. if the text would be "Is this? He about." a call like beginOfSentence( ..., 18 ) should be allowed and the result should be 9. Please take over. Thanks!
fixed in cws i18n13.
any idea when this cws will make it into a build? I really can't test properly while this is broken, since I very often delete-sentence-backwards and when I do that, I _really_ don't mean "delete-two-sentences-backwards" :-)
Karl: The cws is ready for QA, it may take couple of weeks to get integrated.
assign to QA.
SBA->Karl: In CWS i18n13, the given scenario always moves up TWO sentences. Moving to the next sentence works as expected both in CWS and master. So intotal, I see no changes. We must sort out if you intend to fix this in CWS i18n13 or in CWS i18n14. Since I don't see negative side effects in i18n13, a fix in i18n14 looks feasible to me (in case I have no other severe findings in 18n13 :-). Reassigned to Karl until further clarification.
Karl->TL: I have made change in beginOfSentence() to fix the problem of cursor on end of the paragraph. But for the problem of jumping two sentences, you still have to do something in your code.
Karl->SBA: Here is the script to verify my fix in i18n13 Sub Main brk = createUnoService("com.sun.star.i18n.BreakIterator") dim aLocale as new com.sun.star.lang.Locale aLocale.Language="en" s="Is this? He about." p=18 print brk.beginOfSentence(s, p, aLocale) End Sub it should print 9, instead of -1.
SBA->TL: As seen, Karls fix works. Now you can proceed after CWS i18n is integrated in master. I remove this one from CWS i18n13 issue list.
Here's an odd thing. I have been testing a workaround in 680_m47. Here, if "goto PreviousSentence" is bound to a key, the bug is still there. But if it is called from a macro, only half the bug survives: binding this to a key combination: Sub fixmovefor680 ' this works around the broken backward sentence movement. dim oDoc,oText,oVCursor,mySelection oDoc = thiscomponent oText = oDoc.getText() oVCursor = oDoc.getCurrentController().getViewCursor() mySelection = oText.createTextCursorByRange ( oVCursor.getstart() ) mySelection.gotoPreviousSentence(FALSE) 'mySelection.gotoNextSentence(FALSE) oVCursor.gotoRange(mySelection,FALSE) end sub I find that the cursor moves backwards only one sentence at a time, as it should --- except when it is at the end of a paragraph. then it jumps back to the beginning of the whole par; if it is at the end of the first paragraph, it does not move at all.
On the other hand, trying this macro out in Linux , from the end of a file (after entering the "dt" autotext) produced an instantaneous wipeout crash. Ooo just vanished from the screen entirely, without saving work, leaving a dialogue, or anything else. This in Suse 9.1
Any news on the progress of this one? I see that everythig else in l18n13 has been integrated into m54. But moving backwards by sentence still broken
Sorry, not yet. After finally implementing most of the new features for 2.0 and fixing the bugs targeted for 1.1.4 im now working on my priority 2 tasks.
Thanks for responding. I know you're busy there, and appreciate the work you all do. I can't help getting would up about this, though, because it catches me several times an hour if I try to use the milestone builds. I don't know how other people write, but for me, the experience of getting half-way through a sentence and then realising it's wrong is a very common one. Being able to press shift-ctrl-delete at that point was what first sold me on OOo. Getting the sentence before wiped out as well as the one I don't like is very frustrating.
*** Issue 33594 has been marked as a duplicate of this issue. ***
Set to target OOoLater due to lack of resources.
This is a clear regression on some very useful functionality. Moving around by sentence worked fine in all 1.x builds. I think it's a mistake not to fix it. Still, I don't have the reources weither :-) I do have a macro which works around the broken-ness in all cases but where #35553 is implicated (when two cariage returns precede a paragraph). Should I post it here as a help. Would it be any help to offer it as a contribution to the distributed macro libraries?
Hi, I don't know about the macro libraries and who is in charge of them. But at least posting your workaround in the api-dev board would be nice.
*** Issue 53623 has been marked as a duplicate of this issue. ***
FWIW, I have a macro which fixes this, which I will happily mail to any user who has been caught by it. Not ideal, and not infallible, but at least it lets me move back (and delete backwards) by sentence.
*** Issue 58361 has been marked as a duplicate of this issue. ***
remove "crashes" from issue description, since there is no crash anymore.