Issue 75416

Summary: Crash occurs when doing "Repeat Search" in Navigation.
Product: Writer Reporter: jian.li
Component: codeAssignee: stefan.baltzer
Status: CLOSED FIXED QA Contact: issues@sw <issues>
Severity: Trivial    
Priority: P2 CC: chengxiuzhi, eliyuan, issues, jian.li, liujiaxiang, Mathias_Bauer, os_ooo, pagalmes.lists, peter.junge
Version: OOo 2.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: PATCH Latest Confirmation in: ---
Developer Difficulty: ---
Issue Depends on:    
Issue Blocks: 72764    
Attachments:
Description Flags
the patch file
none
the version II patch file reviewed by os
none
the version III is better. none

Description jian.li 2007-03-15 09:29:49 UTC
Crash occurs when doing "Repeat Search" in Navigation.
The bug can be described as follows:
1.Create a new word-processor document;
2.CTRL+F to call "Find & Replace" dialog, input "d" in the "Search for" field,
and click the "Find" button, then "Search key not found" dialog will pop up,
click the "OK" button and close the "Find & Replace" dialog;
3.Press F5 to startup the "Navigator" dialog, and then click the "Navigation" 
button to startup the "Navigation" dialog (make sure do not drag 
the "Navigation" dialog);
4.In the "Navigation" toolbox, select "Repeat Search", then "Navigation" will 
disappear;
5.Startup "Navigation" again, click "Continue search forward" on the right 
side, and then "Search key not found" will pop up;
6.click the "OK" button, then "Navigation" will disappear, click "OK" button 
again, crash.
Comment 1 michael.ruess 2007-03-15 09:38:18 UTC
Reassigned to SBA.
Comment 2 jian.li 2007-03-15 10:19:29 UTC
I have repaired this bug,please have a look at the patch file.
Comment 3 jian.li 2007-03-15 10:20:03 UTC
Created attachment 43718 [details]
the patch file
Comment 4 Mathias_Bauer 2007-03-20 09:39:32 UTC
As this is a patch it should be marked as such, otherwise we might overlook it. 
Oliver, please have a look at this patch.
Comment 5 Oliver Specht 2007-03-20 12:52:30 UTC
The provided patch has the drawback that the navigation toolbox is always teared
off. 
The reason for the crash is the fact that the execution of repeated search is
done synchronously. The message box initiates the destruction of the navigation
toolbox while the MouseButtonUp event is still in processing. 

To fix this I propose to move the execution of the search from
SwView::MoveNavigation to an asynchronously called static link.

See IMPL_STATIC_LINK( SwGlobalTree, ShowFrameHdl,...) in
sw/source/ui/utlui/glbltree.cxx as example of asynchronous execution.
Comment 6 Mathias_Bauer 2007-04-10 11:42:04 UTC
lijian, are you still working on this issue?
Comment 7 jian.li 2007-04-16 07:56:57 UTC
Hi mathias,
Sorry to having not seen your questions.
For this bug, I've not found better solutions.
And I'm busy with other important things recently.
So, hope someone can give me some help.
Comment 8 Mathias_Bauer 2007-05-14 09:19:23 UTC
lijian, OS suggested a solution that looks fine. Please read his last comment
and in case you didn't understand something ask him directly. Thanks.
Comment 9 jian.li 2007-05-15 03:11:03 UTC
mba: Thank you for your friendly advice.
I'll keep working on this issue.
Comment 10 jian.li 2007-05-21 10:07:45 UTC
lijian->os:
> The provided patch has the drawback that the navigation toolbox is always 
> teared off.
What do you mean by this ? Would you please explain it more clearly ?
For this bug, I can not find what initiates the destruction of of the 
navigation toolbox? 

I need your help.Look forward to your reply.
Comment 11 Oliver Specht 2007-05-22 15:12:58 UTC
When you click on the navigator button, keep it pressed and move to the button
of the navigation PopupWindow and release the mouse then the related action is
executed and the PopupWindow is closed afterwards. If you click the button and
release it directly then the PopupWindow is teared off - it stays open as
separate toolbox window. With you fix it will always be teared off. This is not
desirable.

The bug is that the MessageBox prevents the handler (MouseButtonUp(), calling
::SelectHdl) from returning immediately. It returns after the closing of the 
MessageBox finishes the search call. The PopupWindow has been closed by vcl at
the moment you click the OKButton. This closing is initiated by the vcl lib.This
is probably done to get the PopupWindow off the stack. pj knows this better than
/me.

p.s. If you want to reach someone via issue tracker you have to make sure that
this someone is either submitter or owner of the issue or cc'ed.

cc-ing /me to this issue.

To get rid of this we need to call at least the search asynchronously. 
Comment 12 Mathias_Bauer 2007-06-17 13:17:11 UTC
lijian, can you proceed with the existing informatio or do you need some
additional clarifications?
Comment 13 jian.li 2007-06-19 04:53:14 UTC
lijian->mba:I'm working on this issue now!
I'll try to find the way to resolve it.
Comment 14 liyuan 2007-06-19 12:20:20 UTC
-> mba && os && lijian
I have fixed the issue according to OS's suggestion:
To fix this I propose to move the execution of the search from
SwView::MoveNavigation to an asynchronously called static link.
I will send the 75416.patch to you to review it. :-)
Comment 15 liyuan 2007-06-19 12:20:31 UTC
-> mba && os && lijian
I have fixed the issue according to OS's suggestion:
To fix this I propose to move the execution of the search from
SwView::MoveNavigation to an asynchronously called static link.
I will send the 75416.patch to you to review it. :-)
Comment 16 liyuan 2007-06-21 06:21:52 UTC
Created attachment 46127 [details]
the version II patch file reviewed by os
Comment 17 liyuan 2007-06-21 06:24:33 UTC
reassign it to os to integrate this patch. :)
Comment 18 Oliver Specht 2007-06-21 10:48:35 UTC
Patch slightly changed and integrated into cws os98 in 
sw/source/ui/inc/view.hxx
sw/source/ui/utlui/navipi.cxx
sw/source/ui/uiview/view2.cxx
sw/source/ui/uiview/viewmdi.cxx
Comment 19 liyuan 2007-06-22 02:36:28 UTC
Created attachment 46161 [details]
the version III is better.
Comment 20 Oliver Specht 2007-06-29 10:03:52 UTC
Reassigned for verification
Comment 21 michael.ruess 2007-07-04 15:17:25 UTC
SBA, please verify this in CWS os98.
Comment 22 stefan.baltzer 2007-07-11 13:57:03 UTC
SBA: Verified in CWS os98.
Comment 23 stefan.baltzer 2007-08-31 14:53:51 UTC
SBA: OK in OOg680m3. Closed.