diff options
Diffstat (limited to 'sd')
-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 |