To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=72394





------- Additional comments from [EMAIL PROTECTED] Thu Nov 22 10:11:56 +0000 
2007 -------
fme->lijian: Some more comments:

1. I just noticed that your while loop does not work if there are more than one
hidden paragraphs at the end. You should work with pFrm inside the new while
loop instead of pNd. 

2. Let's have a look at bGoNxt. A couple of lines below, bGoNxt is also used.
The meaning of bGoNxt in this context is that if the node postion of the cursor
has been corrected by going forward, the content member of the position is set
to the beginning of the new paragraph. If the cursor has been corrected by going
backward, the content member of the position is set to the end of the new
paragraph. So what should happen if we add our new code? Let's have a look at
this example:

Paragraph1
Paragraph2
hidden paragraph3
hidden paragraph4
Paragraph5

Let's assume that the cursor is moved from paragraph2 to paragraph3. In this
case bGoNxt=true. So we try to find a suitable paragraph after paragraph3 to set
the cursor to. The while loop sets pFrm to paragraph4 and finds that it is not
suitable. So the while loop advances to paragraph5 and breaks. The following
code sets the content member to the cursor to position 0 because the cursor
position was corrected to a position after the original position.

So here's an other example:

Paragraph1
Paragraph2
hidden paragraph3
hidden paragraph4

Let's assume that the cursor is moved from paragraph1 to paragraph3. In this
case bGoNxt=true. Since paragraph3 is hidden, we try to find a suitable
paragraph after paragraph3 to set the cursor to. The while loop sets pFrm to
paragraph4 and finds that it is not suitable. But paragraph4 is the last
paragraph, so the while loop breaks. Here we have to add our new code. We see
that pFrm == 0. We start over with pFrm = pNd->GetFrm(). Now we want to search
backward. We need have a while loop that does the same like the first while
loop, the only difference is that it has to search backward if the first loop
searched forward and vice versa. So our new code sets pFrm to paragraph3 and
searched backward. Because paragraph2 is fine, the new while loop breaks. What
do we have to do with the nContent member to the cursor? Since the cursor
position has been corrected by going backward, we have to set nContent to
pCnd->GetLen(). So we see that it is correct to set bGoNxt = !bGoNxt in case the
first while loop did not succeed.


---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to