Kaydet (Commit) 4866a15e authored tarafından Markus Mohrhard's avatar Markus Mohrhard

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
üst d7a84056
......@@ -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))
......
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment