From 4866a15e3acc0783574f8e4802c85ddb44c06671 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Mon, 11 Jan 2016 04:30:43 +0100 Subject: uitest: send a document event when modal dialog is executed The event is sent shortly before the Dialog will go into Application::Yield. Therefore you know that you can rely on the dialog being visible shortly after the event has been sent. Change-Id: Ifa911adae60ac877161ec43f27cb57d611a60059 --- vcl/CppunitTest_vcl_lifecycle.mk | 1 + vcl/source/window/dialog.cxx | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/vcl/CppunitTest_vcl_lifecycle.mk b/vcl/CppunitTest_vcl_lifecycle.mk index cf874faea160..8b500eb3ab55 100644 --- a/vcl/CppunitTest_vcl_lifecycle.mk +++ b/vcl/CppunitTest_vcl_lifecycle.mk @@ -45,6 +45,7 @@ $(eval $(call gb_CppunitTest_use_components,vcl_lifecycle,\ ucb/source/core/ucb1 \ ucb/source/ucp/file/ucpfile1 \ framework/util/fwk \ + sfx2/util/sfx \ )) $(eval $(call gb_CppunitTest_use_configuration,vcl_lifecycle)) diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 0946b0d7fe79..79c0aa3f43aa 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -877,6 +878,14 @@ short Dialog::Execute() VclPtr xWindow = this; + + + css::uno::Reference< css::uno::XComponentContext > xContext( + comphelper::getProcessComponentContext() ); + css::uno::Reference xEventBroadcaster(css::frame::theGlobalEventBroadcaster::get(xContext), css::uno::UNO_QUERY_THROW); + css::document::DocumentEvent aObject; + aObject.EventName = "DialogExecute"; + xEventBroadcaster->documentEventOccured(aObject); // Yield util EndDialog is called or dialog gets destroyed // (the latter should not happen, but better safe than sorry while ( !xWindow->IsDisposed() && mbInExecute ) -- cgit