summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-01-11 04:30:43 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-18 17:01:32 +0200
commit4866a15e3acc0783574f8e4802c85ddb44c06671 (patch)
tree12957de4e32cbad8bc9696808ac19979e5e10f8a
parentd7a840568c1bc721efef4de09bc8be162575c627 (diff)
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
-rw-r--r--vcl/CppunitTest_vcl_lifecycle.mk1
-rw-r--r--vcl/source/window/dialog.cxx9
2 files changed, 10 insertions, 0 deletions
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 <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/util/thePathSettings.hpp>
+#include <com/sun/star/frame/theGlobalEventBroadcaster.hpp>
#include <comphelper/processfactory.hxx>
#include <osl/file.hxx>
@@ -877,6 +878,14 @@ short Dialog::Execute()
VclPtr<vcl::Window> xWindow = this;
+
+
+ css::uno::Reference< css::uno::XComponentContext > xContext(
+ comphelper::getProcessComponentContext() );
+ css::uno::Reference<css::frame::XGlobalEventBroadcaster> 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 )