diff options
author | Jim Raykowski <raykowj@gmail.com> | 2018-11-23 23:03:25 -0900 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2018-12-06 02:30:01 +0100 |
commit | c0e4ac9a90920d2a9af94f36e2b943b7403b1391 (patch) | |
tree | cdeb93c432a4dc445cf8af13e412a3a806046a0c /cui | |
parent | b7f1b4c02c61dbe846ca190b246061b11c59e1df (diff) |
Add the color name or hex representation to the recent color bar
...after choosing a color using the color tab page
Change-Id: I8f39ed2055e8974356c9ad0894fc908db754b5a4
Reviewed-on: https://gerrit.libreoffice.org/63929
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/tpcolor.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index c7b79ed69bc2..1cebd3b7527c 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -243,8 +243,14 @@ DeactivateRC SvxColorTabPage::DeactivatePage( SfxItemSet* _pSet ) bool SvxColorTabPage::FillItemSet( SfxItemSet* rSet ) { - maPaletteManager.AddRecentColor( aCurrentColor, OUString() ); - rSet->Put( XFillColorItem( OUString(), aCurrentColor ) ); + Color aColor = m_xValSetColorList->GetItemColor( m_xValSetColorList->GetSelectedItemId() ); + OUString sColorName; + if ( aCurrentColor == aColor ) + sColorName = m_xValSetColorList->GetItemText( m_xValSetColorList->GetSelectedItemId() ); + else + sColorName = "#" + aCurrentColor.AsRGBHexString().toAsciiUpperCase(); + maPaletteManager.AddRecentColor( aCurrentColor, sColorName ); + rSet->Put( XFillColorItem( sColorName, aCurrentColor ) ); rSet->Put( XFillStyleItem( drawing::FillStyle_SOLID ) ); return true; } |