[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sc/source
Szymon Kłos (via logerrit)
logerrit at kemper.freedesktop.org
Thu Oct 31 20:46:10 UTC 2019
sc/source/ui/view/formatsh.cxx | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
New commits:
commit c1131547367d90b3fabb7a333187426a1b82c83b
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: 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 <jenkinscollaboraoffice at gmail.com>
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 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 );
}
More information about the Libreoffice-commits
mailing list