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

Szymon Kłos (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 29 13:54:27 UTC 2019


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

New commits:
commit 5f5995097344772c59a9690d8e06eb7b39af3c99
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Oct 29 11:39:57 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Oct 29 14:53:25 2019 +0100

    jsdialogs: set .uno:BackgroundColor in Calc
    
    Change-Id: Ic887a8a0f6dc0509ec848c0f4e405633c1900fcb
    Reviewed-on: https://gerrit.libreoffice.org/81660
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 79576bede62a..f92273b7caf1 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 = 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 );
                 }


More information about the Libreoffice-commits mailing list