You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2012/08/02 08:55:17 UTC

[Bug 120441] [Freeze]With data range picker shrink in first document, AOO frozen if switch focus back from another SC doc

https://issues.apache.org/ooo/show_bug.cgi?id=120441

pengyunquan <yu...@cn.ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #78817|                            |review?
              Flags|                            |

--- Comment #1 from pengyunquan <yu...@cn.ibm.com> ---
Created attachment 78817
  --> https://issues.apache.org/ooo/attachment.cgi?id=78817&action=edit
Fix patch for Bug 120441

Root case : On creation of the 2nd Spreadsheet document, a
ScSimpleRefDlgWrapper object will be constructed. In its constructor, there are
several lines of code cause this problem:
    if(bAutoReOpen && pViewShell)
        pWindow = pViewShell->CreateRefDialog( p, this, pInfo, pParentP,
WID_SIMPLE_REF);

    if (!pWindow)
    {
        SC_MOD()->SetRefDialog( nId, sal_False );
    }
 The 2nd document does not have a reference picker dialog, so
"SC_MOD()->SetRefDialog( nId, sal_False );" is executed, which clears
ScModule's reference status.  This is an incorrect action, because the 1st
document still has a reference dialog open, and ScModule should keep reference
status while there are one document is in reference picking status.  On the 2nd
document's creation, only its own reference status should be cleared, so we
should call "pViewFrm->SetChildWindow( nId, sal_False );" instead of
"SC_MOD()->SetRefDialog( nId, sal_False );". 
    Let's see other child dialog wrappers' constructor. In
"ScAcceptChgDlgWrapper::ScAcceptChgDlgWrapper(...)", it is
"pViewShell->GetViewFrame()->SetChildWindow( nId, sal_False );" not
"SC_MOD()->SetRefDialog( nId, sal_False );". As a result, it does not cause
this problem.
    Why "SC_MOD()->SetRefDialog( nId, sal_False );" cause frozen problem?
Because once ScModule's reference picking status is cleared, when mouse is
clicked on one cell in the 1st document, the ScModule does not think this is a
reference picking action, and the ScModule thinks it is a normal mouse click on
cell which will cause ScCellShell be activated and ScChartShell will be
deactivated. As a result, reference picker dialog will be destroyed, and its
parent dialog( Chart Range dialog ) will be set as foreground dialog. The
original parent dialog of the Chart Range dialog is the CharWindow, but now the
ChartWindow is destroyed when ScChartShell is deactivated, the ChartRange
dialog will be reparented to ScGridWindow. in VCL, reparent a frame window will
destroy the system window handle( HWND ), and recreated a new HWND. But the
window position is not inherited from the original HWND, so when show the new
window, system API "GetWindowRect" get rectangle as "Rectangle(0,0,0,0)". As a
result, we can not see the new foreground ChartRange dialog, but it is a modal
dialog whick locks the document, and the ScGridWindow can not respond to the
user events. The document looks like frozen. By the way, we can not close the
invisible foreground dialog (Chart Range dialog ) by pressing "Esc" key,
because when this dialog is reparented to ScGridWindow VCL calls "ShowWindow(
.., SW_NOACTVATE)", which means the foreground dialog does not get focus. It is
a invisible modal dialog without focus, which locks the docuemt and can not be
closed via "Esc" key.

-- 
You are receiving this mail because:
You are the assignee for the bug.