• Stephan Bergmann's avatar
    Avoid SvxSearchController::StateChanged during SvxSearchDialog sub-dialog · ac51f1df
    Stephan Bergmann yazdı
    UITest_findReplace occasionally fails (esp. in slowly-executing builds like the
    ASan+UBSan one, e.g., <https://ci.libreoffice.org/job/lo_ubsan/1084/>) because
    the "Find" edit is re-filled with old content while the "Format..." sub-dialog
    is executing:  The SfxBindings::NextJob timer fires from the main thread's
    Application::Yield, calls SvxSearchController::StateChanged ->
    SvxSearchDialog::SetItem_Impl -> SvxSearchDialog::Init_Impl, which goes into the
    
    >       else if (!aSearchStrings.empty())
    >       {
    >           bool bAttributes =
    >               ( ( pSearchList && pSearchList->Count() ) ||
    >                 ( pReplaceList && pReplaceList->Count() ) );
    >
    >           if ( bSetSearch && !bAttributes )
    >               m_pSearchLB->SetText(aSearchStrings[0]);
    
    code re-filling the "Find" edit (despite it having been cleared
    programatically), because bAttributes is false because the "Format..." sub-
    dialog has not yet completed, so pSearchList has not yet been filled (as is done
    by the handle_format_dlg code in test_find_writer in
    sw/qa/uitest/findReplace/findReplace.py).  (This issue can be triggered rather
    reliably by adding a sleep
    
    > @@ -94,6 +94,7 @@ class findReplace(UITestCase):
    >              xSizeFont.executeAction("BACKSPACE", tuple())
    >              xSizeFont.executeAction("TYPE", mkPropertyValues({"TEXT":"16"}))    #set font size 16
    >              xOkBtn = dialog.getChild("ok")
    > +            time.sleep(1)
    >              self.ui_test.close_dialog_through_button(xOkBtn)
    >
    >          self.ui_test.execute_blocking_action(format.executeAction, args=('CLICK', ()),
    
    to sw/qa/uitest/findReplace/findReplace.py.)
    
    So suppress executing SvxSearchController::StateChanged ->
    SvxSearchDialog::SetItem_Impl while an SvxSearchDialog sub-dialog is in
    progress.  The open TODO question is whether those state changes should be saved
    and executed once the sub-dialog has been executed, or whether it is OK to just
    throw them away (as happens now).
    
    Change-Id: I20fb8c8d88c3d3fe8b604718bb289a7421471aa7
    Reviewed-on: https://gerrit.libreoffice.org/62489
    Tested-by: Jenkins
    Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
    ac51f1df
srchdlg.hxx 9.37 KB