sc/source/ui/view/formatsh.cxx | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-)
New commits: commit 62e077c3e58b965f0587995667d45a0a26f3672e Author: Mert Tumer <mert.tu...@collabora.com> AuthorDate: Mon Jan 13 13:17:09 2020 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Tue Feb 11 22:29:26 2020 +0100 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 <jenkinscollaboraoff...@gmail.com> Reviewed-by: Michael Meeks <michael.me...@collabora.com> (cherry picked from commit 23e8e4521366aaf5831a3c1feaffdc41658ce7e7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88398 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.ti...@collabora.com> 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: _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits