[Libreoffice-commits] core.git: include/vcl vcl/source

Markus Mohrhard markus.mohrhard at googlemail.com
Sun Feb 18 21:14:19 UTC 2018


 include/vcl/dialog.hxx       |    2 ++
 vcl/source/window/dialog.cxx |   23 ++++++++++++-----------
 2 files changed, 14 insertions(+), 11 deletions(-)

New commits:
commit dc324bbffad071bc5a115b2faae1ac97ad216711
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Feb 18 19:09:07 2018 +0100

    uitest: fix small race condition when launching modeless dialogs
    
    Change-Id: I44f7af1b44badce6ed09eeca0bb19760b5f22aa9
    Reviewed-on: https://gerrit.libreoffice.org/49942
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 979c62c199dc..e2ad43bcbf48 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -176,6 +176,8 @@ class VCL_DLLPUBLIC ModelessDialog : public Dialog
 
 public:
     explicit        ModelessDialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription, Dialog::InitFlag eFlag = Dialog::InitFlag::Default );
+
+    void            Activate() override;
 };
 
 class VCL_DLLPUBLIC ModalDialog : public Dialog
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 0219f2a806d2..cdad91241c35 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -731,17 +731,6 @@ void Dialog::StateChanged( StateChangedType nType )
         ImplInitSettings();
         Invalidate();
     }
-
-    if (!mbModalMode && nType == StateChangedType::Visible)
-    {
-        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 = "ModelessDialogVisible";
-        xEventBroadcaster->documentEventOccured(aObject);
-        UITestLogger::getInstance().log("Modeless Dialog Visible");
-    }
 }
 
 void Dialog::DataChanged( const DataChangedEvent& rDCEvt )
@@ -1302,4 +1291,16 @@ ModalDialog::ModalDialog( vcl::Window* pParent, const OUString& rID, const OUStr
 {
 }
 
+void ModelessDialog::Activate()
+{
+    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 = "ModelessDialogVisible";
+    xEventBroadcaster->documentEventOccured(aObject);
+    UITestLogger::getInstance().log("Modeless Dialog Visible");
+    Dialog::Activate();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list