diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-07 13:40:52 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-07 13:44:04 +0100 |
commit | 9bb6863fcf0784c70a95510b488f0162fe6deb37 (patch) | |
tree | 91f96bbd992668c6c2ce8920ae8dfe378b705043 /vcl | |
parent | 967ea727c7f2c954ee8ac33a888718d8dac11837 (diff) |
afl-eventtesting: it has learned to open dialogs, so...
close all open dialogs on quitting to avoid triggering
the hang timeout and get things moving faster
Change-Id: I7469a32549f20d6b0971932e3334cb322f57b1ff
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/svapp.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index c797d00b870d..d4b197b0d8ac 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -36,6 +36,7 @@ #include <unotools/configmgr.hxx> #include <unotools/syslocaleoptions.hxx> +#include "vcl/dialog.hxx" #include "vcl/settings.hxx" #include "vcl/keycod.hxx" #include "vcl/event.hxx" @@ -347,6 +348,17 @@ namespace ImplWindowFrameProc(xWin.get(), NULL, SALEVENT_KEYUP, &aKeyEvent); return true; } + + void CloseDialogsAndQuit() + { + vcl::Window* pAppWindow = Application::GetFirstTopLevelWindow(); + while (pAppWindow) + { + Dialog::EndAllDialogs(pAppWindow); + pAppWindow = Application::GetNextTopLevelWindow(pAppWindow); + } + Application::Quit(); + } } IMPL_LINK_NOARG_TYPED(ImplSVAppData, VclEventTestingHdl, Idle *, void) @@ -357,7 +369,7 @@ IMPL_LINK_NOARG_TYPED(ImplSVAppData, VclEventTestingHdl, Idle *, void) delete mpEventTestInput; delete mpEventTestingIdle; SAL_INFO("vcl.eventtesting", "Event Limit reached, exiting" << mnEventTestLimit); - Application::Quit(); + CloseDialogsAndQuit(); } else { @@ -369,7 +381,7 @@ IMPL_LINK_NOARG_TYPED(ImplSVAppData, VclEventTestingHdl, Idle *, void) delete mpEventTestInput; delete mpEventTestingIdle; SAL_INFO("vcl.eventtesting", "Event Input exhausted, exiting" << mnEventTestLimit); - Application::Quit(); + CloseDialogsAndQuit(); return; } Scheduler::ProcessTaskScheduling(true); |