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

New commits:
commit c1131547367d90b3fabb7a333187426a1b82c83b
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Tue Oct 29 11:39:57 2019 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Thu Oct 31 21:45:32 2019 +0100

    jsdialogs: set .uno:BackgroundColor in Calc
    
    Change-Id: Ic887a8a0f6dc0509ec848c0f4e405633c1900fcb
    Reviewed-on: https://gerrit.libreoffice.org/81661
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index ba3896ecab2e..ea5faddad12d 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1968,13 +1968,28 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
             // ATTR_BACKGROUND (=SID_ATTR_BRUSH) has to be set to two IDs:
             case SID_BACKGROUND_COLOR:
                 {
-                    const SvxColorItem&  rNewColorItem = pNewAttrs->Get( 
SID_BACKGROUND_COLOR );
+                    const SfxPoolItem* pColorStringItem = nullptr;
+                    Color aColor;
+
+                    if ( SfxItemState::SET == pNewAttrs->GetItemState( 
SID_ATTR_COLOR_STR, false, &pColorStringItem ) )
+                    {
+                        OUString sColor = static_cast<const 
SfxStringItem*>(pColorStringItem)->GetValue();
+                        if ( sColor == "transparent" )
+                            aColor = Color( COL_TRANSPARENT );
+                        else
+                            aColor = Color( sColor.toInt32( 16 ) );
+                    }
+                    else
+                    {
+                        const SvxColorItem&  rNewColorItem = pNewAttrs->Get( 
SID_BACKGROUND_COLOR );
+                        aColor = rNewColorItem.GetValue();
+                    }
 
                     SvxBrushItem        aBrushItem(
                                             
pTabViewShell->GetSelectionPattern()->
                                                 GetItem( ATTR_BACKGROUND ) );
 
-                    aBrushItem.SetColor( rNewColorItem.GetValue() );
+                    aBrushItem.SetColor( aColor );
 
                     pTabViewShell->ApplyAttr( aBrushItem, false );
                 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to