diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2019-11-04 17:17:58 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2019-11-05 11:57:50 +0100 |
commit | d0691fd2f57c1ed2927b3c3e78d0ce59558eb3a7 (patch) | |
tree | f7a7af862ff80b224f481b0c7fc1d4f6c1dacc59 /sd/source | |
parent | 0aaf8888d218df888310d7eeb4a47994e85d1746 (diff) |
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.klos@collabora.com>
(cherry picked from commit 780d83771af89e6b27b3618d9c033c3fb29ba803)
Reviewed-on: https://gerrit.libreoffice.org/82058
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/view/drtxtob1.cxx | 29 |
1 files changed, 28 insertions, 1 deletions
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 |