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

Caolán McNamara caolanm at redhat.com
Thu Sep 28 19:20:52 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 6ddd8fcf5c92936de2a3f9d824b06a9f7dc5a86a
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/42899
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/svx/PaletteManager.hxx b/include/svx/PaletteManager.hxx
index f67f77ce4c3d..3cd11df51b22 100644
--- a/include/svx/PaletteManager.hxx
+++ b/include/svx/PaletteManager.hxx
@@ -73,7 +73,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 c42f8563de54..bb5fd87bdf73 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -303,13 +303,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 605568a88a28..08333b13c2cf 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1502,7 +1502,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