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