svx/source/dialog/ThemeDialog.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit b0a33352536e251598c6cc5ac1f69bfd043e6ba2
Author:     Gülşah Köse <gulsah.k...@collabora.com>
AuthorDate: Mon Jul 17 11:27:08 2023 +0300
Commit:     Gülşah Köse <gulsah.k...@collabora.com>
CommitDate: Wed Aug 9 14:42:44 2023 +0200

    Prevent to open multiple Theme Color Edit dialog
    
    Signed-off-by: Gülşah Köse <gulsah.k...@collabora.com>
    Change-Id: Ibf4db096b44ce941140a12d003b89b636f5e7224
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154514
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    (cherry picked from commit e73b2bc4e6fdaba3098fa2c701342e1df112514c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155401
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/svx/source/dialog/ThemeDialog.cxx 
b/svx/source/dialog/ThemeDialog.cxx
index 29d12f25c779..ab743b0df4bd 100644
--- a/svx/source/dialog/ThemeDialog.cxx
+++ b/svx/source/dialog/ThemeDialog.cxx
@@ -89,7 +89,10 @@ void ThemeDialog::runThemeColorEditDialog()
     std::shared_ptr<DialogController> xKeepAlive(shared_from_this());
     weld::DialogController::runAsync(pDialog, [this, xKeepAlive, 
pDialog](sal_uInt32 nResult) {
         if (nResult != RET_OK)
+        {
+            mxAdd->set_sensitive(true);
             return;
+        }
         auto aColorSet = pDialog->getColorSet();
         if (!aColorSet.getName().isEmpty())
         {
@@ -103,6 +106,7 @@ void ThemeDialog::runThemeColorEditDialog()
             mpCurrentColorSet
                 = 
std::make_shared<model::ColorSet>(maColorSets[maColorSets.size() - 1]);
         }
+        mxAdd->set_sensitive(true);
     });
 }
 
@@ -111,6 +115,7 @@ IMPL_LINK(ThemeDialog, ButtonClicked, weld::Button&, 
rButton, void)
     if (mpCurrentColorSet && mxAdd.get() == &rButton)
     {
         runThemeColorEditDialog();
+        mxAdd->set_sensitive(false);
     }
 }
 

Reply via email to