diff options
-rw-r--r-- | sd/source/ui/view/drtxtob1.cxx | 29 | ||||
-rw-r--r-- | svx/sdi/svx.sdi | 2 |
2 files changed, 29 insertions, 2 deletions
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 4bdb32ecc627..d16a70e748ab 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -63,9 +63,34 @@ #include <futempl.hxx> #include <DrawDocShell.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 { /** @@ -735,7 +760,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 f3d5bd97af72..775dfa98309a 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -1506,7 +1506,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, |