[Libreoffice-commits] core.git: cui/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 6 01:30:26 UTC 2018


 cui/source/tabpages/tpcolor.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit c0e4ac9a90920d2a9af94f36e2b943b7403b1391
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Fri Nov 23 23:03:25 2018 -0900
Commit:     Jim Raykowski <raykowj at gmail.com>
CommitDate: Thu Dec 6 02:30:01 2018 +0100

    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 at gmail.com>

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;
 }


More information about the Libreoffice-commits mailing list