Issue 27031

Summary: move-by-sentence-backwards broken
Product: Writer Reporter: ingenstans
Component: codeAssignee: AOO issues mailing list <issues>
Status: ACCEPTED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues
Version: 680m34   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description ingenstans 2004-03-28 13:12:27 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.
Comment 1 aparan 2004-03-29 05:12:24 UTC
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.  

Comment 2 michael.ruess 2004-03-30 08:47:23 UTC
MRU->ES: looks like a key-configuration problem.
Comment 3 ingenstans 2004-04-10 09:47:21 UTC
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.
Comment 4 eric.savary 2004-04-15 12:15:28 UTC
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.
Comment 5 eric.savary 2004-04-15 12:16:49 UTC
reassigned to FME
Comment 6 frank.meies 2004-04-16 09:40:54 UTC
FME->KHONG: Could you please have a look?
Comment 7 frank.meies 2004-04-16 11:51:00 UTC
FME->TL: I think this might be related to your changes in
SwCursor::GoSentence(). Note: please check special case nPos = USHRT_MAX.
Comment 8 thomas.lange 2004-04-20 12:09:55 UTC
.
Comment 9 thomas.lange 2004-06-17 08:46:43 UTC
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!
Comment 10 karl.hong 2004-06-17 21:29:30 UTC
fixed in cws i18n13.
Comment 11 ingenstans 2004-06-18 09:39:00 UTC
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" :-)
Comment 12 karl.hong 2004-06-21 18:37:35 UTC
Karl: The cws is ready for QA, it may take couple of weeks to get integrated.
Comment 13 karl.hong 2004-06-21 18:38:40 UTC
assign to QA.
Comment 14 stefan.baltzer 2004-07-22 14:56:14 UTC
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.
Comment 15 karl.hong 2004-07-22 19:17:11 UTC
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.
Comment 16 karl.hong 2004-07-22 19:25:36 UTC
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.
Comment 17 stefan.baltzer 2004-07-23 12:48:23 UTC
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. 
Comment 18 ingenstans 2004-08-09 15:19:47 UTC
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.
Comment 19 ingenstans 2004-08-09 20:21:04 UTC
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 
Comment 20 ingenstans 2004-09-20 17:29:59 UTC
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
Comment 21 thomas.lange 2004-09-21 08:27:57 UTC
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.
Comment 22 ingenstans 2004-09-21 09:04:19 UTC
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.
Comment 23 ingenstans 2004-10-14 16:20:32 UTC
*** Issue 33594 has been marked as a duplicate of this issue. ***
Comment 24 thomas.lange 2004-11-15 09:14:45 UTC
.
Comment 25 andreas.martens 2004-12-03 10:56:35 UTC
Set to target OOoLater due to lack of resources.
Comment 26 ingenstans 2004-12-03 12:29:31 UTC
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?
Comment 27 thomas.lange 2004-12-03 12:39:42 UTC
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.
Comment 28 eric.savary 2005-08-23 11:57:25 UTC
*** Issue 53623 has been marked as a duplicate of this issue. ***
Comment 29 ingenstans 2005-08-23 13:48:09 UTC
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.
Comment 30 eric.savary 2005-11-25 09:36:53 UTC
*** Issue 58361 has been marked as a duplicate of this issue. ***
Comment 31 Martin Hollmichel 2006-02-16 10:56:50 UTC
remove "crashes" from issue description, since there is no crash anymore.