[Libreoffice-commits] core.git: svx/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Jan 16 17:36:03 UTC 2020


 svx/source/tbxctrls/tbcontrl.cxx |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

New commits:
commit a508f2ee91cb6c11c5f1b195270d37c6a3a5d141
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jan 16 15:07:36 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jan 16 18:35:23 2020 +0100

    fix a crash in welded color toolbar menu
    
    Change-Id: I7d11dfddc627e96710a6a16136292abefacc3ab4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86931
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index e190200810e7..951fc284280e 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2074,11 +2074,11 @@ IMPL_LINK(ColorWindow, AutoColorClickHdl, weld::Button&, rButton, void)
     mxRecentColorSet->SetNoSelection();
     mpDefaultButton = &rButton;
 
-    maMenuButton.set_inactive();
-
     maSelectedLink.Call(aNamedColor);
 
     maColorSelectFunction(maCommand, aNamedColor);
+
+    maMenuButton.set_inactive();
 }
 
 IMPL_LINK_NOARG(SvxColorWindow, OpenPickerClickHdl, Button*, void)
@@ -2103,8 +2103,15 @@ IMPL_LINK_NOARG(SvxColorWindow, OpenPickerClickHdl, Button*, void)
 
 IMPL_LINK_NOARG(ColorWindow, OpenPickerClickHdl, weld::Button&, void)
 {
+    // copy before set_inactive
+    auto nColor = GetSelectEntryColor().first;
+    auto pParentWindow = mpParentWindow;
+    OUString sCommand = maCommand;
+    std::shared_ptr<PaletteManager> xPaletteManager(mxPaletteManager);
+
     maMenuButton.set_inactive();
-    mxPaletteManager->PopupColorPicker(mpParentWindow, maCommand, GetSelectEntryColor().first);
+
+    xPaletteManager->PopupColorPicker(pParentWindow, sCommand, nColor);
 }
 
 void SvxColorWindow::SetNoSelection()


More information about the Libreoffice-commits mailing list