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

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 21 06:51:52 UTC 2021


 vcl/inc/jsdialog/jsdialogbuilder.hxx |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

New commits:
commit 0acac258be8c07dbea5579561ead2c6e093fd441
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Jun 11 19:59:07 2021 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Jul 21 08:51:18 2021 +0200

    jsdialog: don't send unnecessary show/hide messages
    
    Change-Id: Ie37503b5964606a2b3e5b305c949f570616dc1cc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117070
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119243
    Tested-by: Jenkins

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 32781712cc0f..cb2a95d9d368 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -305,18 +305,26 @@ public:
 
     virtual void show() override
     {
+        bool bWasVisible = BaseInstanceClass::get_visible();
         BaseInstanceClass::show();
-        std::unique_ptr<ActionDataMap> pMap = std::make_unique<ActionDataMap>();
-        (*pMap)[ACTION_TYPE] = "show";
-        sendAction(std::move(pMap));
+        if (!bWasVisible)
+        {
+            std::unique_ptr<ActionDataMap> pMap = std::make_unique<ActionDataMap>();
+            (*pMap)[ACTION_TYPE] = "show";
+            sendAction(std::move(pMap));
+        }
     }
 
     virtual void hide() override
     {
+        bool bWasVisible = BaseInstanceClass::get_visible();
         BaseInstanceClass::hide();
-        std::unique_ptr<ActionDataMap> pMap = std::make_unique<ActionDataMap>();
-        (*pMap)[ACTION_TYPE] = "hide";
-        sendAction(std::move(pMap));
+        if (bWasVisible)
+        {
+            std::unique_ptr<ActionDataMap> pMap = std::make_unique<ActionDataMap>();
+            (*pMap)[ACTION_TYPE] = "hide";
+            sendAction(std::move(pMap));
+        }
     }
 
     using BaseInstanceClass::set_sensitive;


More information about the Libreoffice-commits mailing list