[Libreoffice-commits] core.git: vcl/inc

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Mon Jan 4 08:00:40 UTC 2021


 vcl/inc/jsdialog/jsdialogbuilder.hxx |   32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

New commits:
commit aeade793fd56fee9540af059fc7f0efb8605cf22
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Dec 30 09:57:00 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Jan 4 08:59:57 2021 +0100

    jsdialog: support for freeze/thaw
    
    Change-Id: Ia3ca2c3c06a95e295e400780540c176cd9606ee7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108498
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 0a02e64cf890..8be7950b5bc2 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -69,10 +69,12 @@ public:
     {
     }
 
-    void notifyDialogState(bool bForce = false);
+    virtual ~JSDialogSender() = default;
+
+    virtual void notifyDialogState(bool bForce = false);
     void sendClose();
     void dumpStatus();
-    void sendUpdate(VclPtr<vcl::Window> pWindow);
+    virtual void sendUpdate(VclPtr<vcl::Window> pWindow);
 };
 
 class JSDropTarget final
@@ -181,6 +183,7 @@ class JSWidget : public BaseInstanceClass, public JSDialogSender
 {
 protected:
     rtl::Reference<JSDropTarget> m_xDropTarget;
+    bool m_bIsFreezed;
 
 public:
     JSWidget(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aContentWindow,
@@ -188,6 +191,7 @@ public:
              std::string sTypeOfJSON)
         : BaseInstanceClass(pObject, pBuilder, bTakeOwnership)
         , JSDialogSender(aNotifierWindow, aContentWindow, sTypeOfJSON)
+        , m_bIsFreezed(false)
     {
     }
 
@@ -217,6 +221,30 @@ public:
 
         return m_xDropTarget.get();
     }
+
+    virtual void freeze() override
+    {
+        BaseInstanceClass::freeze();
+        m_bIsFreezed = true;
+    }
+
+    virtual void thaw() override
+    {
+        BaseInstanceClass::thaw();
+        m_bIsFreezed = false;
+    }
+
+    virtual void sendUpdate(VclPtr<vcl::Window> pWindow) override
+    {
+        if (!m_bIsFreezed)
+            JSDialogSender::sendUpdate(pWindow);
+    }
+
+    virtual void notifyDialogState(bool bForce = false) override
+    {
+        if (!m_bIsFreezed || bForce)
+            JSDialogSender::notifyDialogState(bForce);
+    }
 };
 
 class JSDialog : public JSWidget<SalInstanceDialog, ::Dialog>


More information about the Libreoffice-commits mailing list