[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - include/svx svx/source

Caolán McNamara caolanm at redhat.com
Tue Oct 3 15:17:51 UTC 2017


 include/svx/PaletteManager.hxx         |    2 +-
 svx/source/tbxctrls/PaletteManager.cxx |    6 +++---
 svx/source/tbxctrls/tbcontrl.cxx       |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit c2ebe20adedf74632927e2a2efb7652837ef3dfd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 28 11:19:57 2017 +0100

    Resolves: tdf#112680 start color picker with currently selected color
    
    Change-Id: I939a0b88646b4654337505e985cceff883f09343
    Reviewed-on: https://gerrit.libreoffice.org/42922
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/include/svx/PaletteManager.hxx b/include/svx/PaletteManager.hxx
index 2347f0f65ef5..be2a325e055a 100644
--- a/include/svx/PaletteManager.hxx
+++ b/include/svx/PaletteManager.hxx
@@ -76,7 +76,7 @@ public:
     void        AddRecentColor(const Color& rRecentColor, const OUString& rColorName, bool bFront = true);
 
     void        SetBtnUpdater(svx::ToolboxButtonColorUpdater* pBtnUpdater);
-    void        PopupColorPicker(const OUString& aCommand);
+    void        PopupColorPicker(const OUString& aCommand, const Color& rInitialColor);
 
     void        SetColorSelectFunction(const std::function<void(const OUString&, const NamedColor&)>& aColorSelectFunction);
 
diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx
index 4aaadfb22eda..2e181a10ed53 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -298,13 +298,13 @@ void PaletteManager::SetColorSelectFunction(const std::function<void(const OUStr
     maColorSelectFunction = aColorSelectFunction;
 }
 
-void PaletteManager::PopupColorPicker(const OUString& aCommand)
+void PaletteManager::PopupColorPicker(const OUString& aCommand, const Color& rInitialColor)
 {
     // The calling object goes away during aColorDlg.Execute(), so we must copy this
     OUString aCommandCopy = aCommand;
     SvColorDialog aColorDlg( nullptr );
-    aColorDlg.SetColor ( mLastColor );
-    aColorDlg.SetMode( svtools::ColorPickerMode_MODIFY );
+    aColorDlg.SetColor(rInitialColor);
+    aColorDlg.SetMode(svtools::ColorPickerMode_MODIFY);
     if( aColorDlg.Execute() == RET_OK )
     {
         if (mpBtnUpdater)
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index ea33ee769209..85ab2abfede7 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1513,7 +1513,7 @@ IMPL_LINK_NOARG(SvxColorWindow, OpenPickerClickHdl, Button*, void)
 
     if ( IsInPopupMode() )
         EndPopupMode();
-    mrPaletteManager.PopupColorPicker(maCommand);
+    mrPaletteManager.PopupColorPicker(maCommand, GetSelectEntryColor().first);
 }
 
 void SvxColorWindow::StartSelection()


More information about the Libreoffice-commits mailing list