summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/formatsh.cxx
diff options
context:
space:
mode:
authorMert Tumer <mert.tumer@collabora.com>2020-01-13 13:17:09 +0300
committerAndras Timar <andras.timar@collabora.com>2020-02-11 22:29:26 +0100
commit62e077c3e58b965f0587995667d45a0a26f3672e (patch)
tree331d4c0a88d4211410f2fe52c77e35c008257311 /sc/source/ui/view/formatsh.cxx
parentecfc94359d701d03b59812c30f5a77556891e0d4 (diff)
Fix FontColor does not change selected cells on calc
Change-Id: Iae2f72bff4fd6986fc8cc07ba09996b1af4eb140 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86670 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit 23e8e4521366aaf5831a3c1feaffdc41658ce7e7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88398 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sc/source/ui/view/formatsh.cxx')
-rw-r--r--sc/source/ui/view/formatsh.cxx26
1 files changed, 24 insertions, 2 deletions
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 379761bfcaf0..3ed5a2a48208 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1784,10 +1784,32 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
break;
case SID_ATTR_CHAR_COLOR:
case SID_SCATTR_PROTECTION :
- pTabViewShell->ApplyAttr( pNewAttrs->Get( pNewAttrs->GetPool()->GetWhich( nSlot) ), false);
+ {
+ const SfxPoolItem* pColorStringItem = nullptr;
+ if ( SfxItemState::SET == pNewAttrs->GetItemState( SID_ATTR_COLOR_STR, false, &pColorStringItem ) )
+ {
+ Color aColor;
+ OUString sColor = static_cast<const SfxStringItem*>(pColorStringItem)->GetValue();
+ if ( sColor == "transparent" )
+ aColor = COL_TRANSPARENT;
+ else
+ aColor = Color( sColor.toInt32( 16 ) );
+
+ SvxColorItem aColorItem(pTabViewShell->GetSelectionPattern()->
+ GetItem( ATTR_FONT_COLOR ) );
+ aColorItem.SetValue(aColor);
+ pTabViewShell->ApplyAttr(aColorItem, false);
+ }
+ else
+ {
+ pTabViewShell->ApplyAttr( pNewAttrs->Get( pNewAttrs->GetPool()->GetWhich( nSlot) ), false);
+ }
+
rBindings.Invalidate( nSlot );
rBindings.Update( nSlot );
- break;
+ }
+
+ break;
case SID_ATTR_CHAR_FONT:
case SID_ATTR_CHAR_FONTHEIGHT: