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

Mert Tumer (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 11 21:30:02 UTC 2020


 sc/source/ui/view/formatsh.cxx |   26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

New commits:
commit 62e077c3e58b965f0587995667d45a0a26f3672e
Author:     Mert Tumer <mert.tumer at collabora.com>
AuthorDate: Mon Jan 13 13:17:09 2020 +0300
Commit:     Andras Timar <andras.timar at 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 <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at 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 at 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:


More information about the Libreoffice-commits mailing list