diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-09-28 11:19:57 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-10-03 17:17:26 +0200 |
commit | c2ebe20adedf74632927e2a2efb7652837ef3dfd (patch) | |
tree | f0e549885aa202de9a2c616e8e0dafeb71dbf7e6 | |
parent | 9a28c3693a9aa9de507cc0cdd78ffe597c807de5 (diff) |
Resolves: tdf#112680 start color picker with currently selected color
Change-Id: I939a0b88646b4654337505e985cceff883f09343
Reviewed-on: https://gerrit.libreoffice.org/42922
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-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 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() |