sd/source/ui/view/drtxtob1.cxx |   29 ++++++++++++++++++++++++++++-
 svx/sdi/svx.sdi                |    2 +-
 2 files changed, 29 insertions(+), 2 deletions(-)

New commits:
commit d0691fd2f57c1ed2927b3c3e78d0ce59558eb3a7
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Mon Nov 4 17:17:58 2019 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Tue Nov 5 11:57:50 2019 +0100

    jsdialogs: .uno:Color with string argument
    
    Change-Id: Ifdc95ff8c6a71340de3ed66cf58bc937e3730810
    Reviewed-on: https://gerrit.libreoffice.org/82038
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    (cherry picked from commit 780d83771af89e6b27b3618d9c033c3fb29ba803)
    Reviewed-on: https://gerrit.libreoffice.org/82058
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index eb00b2d08ae6..5d3e109e688c 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -72,9 +72,34 @@
 #include <DrawDocShell.hxx>
 #include <Outliner.hxx>
 #include <futext.hxx>
+#include <svl/stritem.hxx>
+#include <editeng/colritem.hxx>
 
 #include <memory>
 
+namespace
+{
+    void lcl_convertStringArguments(std::unique_ptr<SfxItemSet>& pArgs)
+    {
+        Color aColor;
+        OUString sColor;
+        const SfxPoolItem* pColorStringItem = nullptr;
+
+        if (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));
+
+            SvxColorItem aColorItem(aColor, EE_CHAR_COLOR);
+            pArgs->Put(aColorItem);
+        }
+    }
+}
+
 namespace sd {
 
 /**
@@ -689,7 +714,9 @@ void TextObjectBar::Execute( SfxRequest &rReq )
                 pArgs = rReq.GetArgs();
             }
 
-            mpView->SetAttributes(*pArgs);
+            std::unique_ptr<SfxItemSet> pNewArgs = pArgs->Clone();
+            lcl_convertStringArguments(pNewArgs);
+            mpView->SetAttributes(*pNewArgs);
 
             // invalidate entire shell because of performance and
             // extension reasons
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 09c127c2340f..74e30f53dcfa 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -1489,7 +1489,7 @@ SfxVoidItem ClearOutline SID_OUTLINE_DELETEALL
 
 
 SvxColorItem Color SID_ATTR_CHAR_COLOR
-
+(SfxStringItem Color SID_ATTR_COLOR_STR, SvxColorItem Color 
SID_ATTR_CHAR_COLOR)
 [
     AutoUpdate = TRUE,
     FastCall = FALSE,
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to