summaryrefslogtreecommitdiff
path: root/include/svx/srchdlg.hxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-10-28 23:28:10 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-10-29 07:56:55 +0100
commitac51f1dfb3c63f1d0a3e2577ba5a56c25bc0b94b (patch)
treeacb157c8469e31b916a78d90e51c58c23b787141 /include/svx/srchdlg.hxx
parent98f4f6442c234df1fc98832c2716348085fdfd83 (diff)
Avoid SvxSearchController::StateChanged during SvxSearchDialog sub-dialog
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: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/svx/srchdlg.hxx')
-rw-r--r--include/svx/srchdlg.hxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx
index 440a824c8a55..4b82db88fe7c 100644
--- a/include/svx/srchdlg.hxx
+++ b/include/svx/srchdlg.hxx
@@ -38,11 +38,11 @@ class SvxSearchItem;
class SfxStyleSheetBasePool;
class SvxJSearchOptionsPage;
class SvxSearchController;
+class VclAbstractDialog;
struct SearchDlg_Impl;
enum class ModifyFlags;
enum class TransliterationFlags;
-
struct SearchAttrItem
{
sal_uInt16 nSlot;
@@ -230,6 +230,8 @@ private:
mutable TransliterationFlags
nTransliterationFlags;
+ bool m_executingSubDialog = false;
+
DECL_LINK( ModifyHdl_Impl, Edit&, void );
DECL_LINK( FlagHdl_Impl, Button*, void );
DECL_LINK( CommandHdl_Impl, Button*, void );
@@ -263,6 +265,8 @@ private:
void ApplyTransliterationFlags_Impl( TransliterationFlags nSettings );
bool IsOtherOptionsExpanded();
+
+ short executeSubDialog(VclAbstractDialog * dialog);
};
#endif