diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-09-28 11:19:57 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-09-28 21:20:30 +0200 |
commit | 6ddd8fcf5c92936de2a3f9d824b06a9f7dc5a86a (patch) | |
tree | c036278dc46c4e0af70a793616865c7528b28a56 | |
parent | 9e0be8a76e13ed3d71e792c1a30e5628b7e1056e (diff) |
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@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/svx/PaletteManager.hxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/PaletteManager.cxx | 6 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 2 |
3 files changed, 5 insertions, 5 deletions
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() |