sc/source/ui/view/editsh.cxx |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 0393cde7bb4a0ebc921aecd6f3a9d3c5839bcb17
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Wed Nov 6 16:46:11 2019 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Wed Nov 6 17:21:28 2019 +0100

    jsdialogs: .uno:Color with string argument in Calc
    
    Change-Id: I93ac635fc16a74cfc7a956be6d6529b4d692101b
    Reviewed-on: https://gerrit.libreoffice.org/82153
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index f3c7fa8164af..2eb92e18ce4e 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -56,6 +56,7 @@
 #include <sot/formats.hxx>
 #include <vcl/transfer.hxx>
 #include <svl/stritem.hxx>
+#include <editeng/colritem.hxx>
 
 #include <editsh.hxx>
 #include <global.hxx>
@@ -911,7 +912,24 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
             {
                 if (pArgs)
                 {
-                    aSet.Put( pArgs->Get( pArgs->GetPool()->GetWhich( nSlot ) 
) );
+                    Color aColor;
+                    OUString sColor;
+                    const SfxPoolItem* pColorStringItem = nullptr;
+
+                    if ( pArgs && SfxItemState::SET == pArgs->GetItemState( 
SID_ATTR_COLOR_STR, false, &pColorStringItem ) )
+                    {
+                        sColor = static_cast<const SfxStringItem*>( 
pColorStringItem )->GetValue();
+                        if ( sColor == "transparent" )
+                            aColor = COL_TRANSPARENT;
+                        else
+                            aColor = Color( sColor.toInt32( 16 ) );
+
+                        aSet.Put( SvxColorItem( aColor, EE_CHAR_COLOR ) );
+                    }
+                    else
+                    {
+                        aSet.Put( pArgs->Get( pArgs->GetPool()->GetWhich( 
nSlot ) ) );
+                    }
                     rBindings.Invalidate( nSlot );
                 }
             }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to