diff options
-rw-r--r-- | sc/source/ui/drawfunc/drtxtob.cxx | 15 | ||||
-rw-r--r-- | sc/source/ui/view/editsh.cxx | 13 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 6138b29120e4..8eba19057411 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -23,6 +23,7 @@ #include <i18nutil/transliteration.hxx> #include <editeng/adjustitem.hxx> #include <svx/clipfmtitem.hxx> +#include <editeng/colritem.hxx> #include <editeng/contouritem.hxx> #include <editeng/crossedoutitem.hxx> #include <editeng/eeitem.hxx> @@ -48,6 +49,7 @@ #include <editeng/wghtitem.hxx> #include <editeng/writingmodeitem.hxx> #include <sfx2/dispatch.hxx> +#include <sfx2/namedcolor.hxx> #include <sfx2/objface.hxx> #include <sfx2/objsh.hxx> #include <sfx2/request.hxx> @@ -918,6 +920,19 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) ); } break; + case SID_ATTR_CHAR_COLOR: + case SID_ATTR_CHAR_BACK_COLOR: + { + const sal_uInt16 nEEWhich = GetPool().GetWhichIDFromSlotID(nSlot); + const std::optional<NamedColor>& oColor + = mrViewData.GetDocShell()->GetRecentColor(nSlot); + if (oColor.has_value()) + { + const model::ComplexColor& rCol = (*oColor).getComplexColor(); + aNewAttr.Put(SvxColorItem(rCol.getFinalColor(), rCol, nEEWhich)); + } + break; + } } } diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 4f89028d4c16..e5396188f418 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -48,6 +48,7 @@ #include <sfx2/dispatch.hxx> #include <sfx2/docfile.hxx> #include <sfx2/docfilt.hxx> +#include <sfx2/namedcolor.hxx> #include <sfx2/msg.hxx> #include <sfx2/objface.hxx> #include <sfx2/objsh.hxx> @@ -1028,12 +1029,24 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq) break; case SID_ATTR_CHAR_COLOR: + case SID_ATTR_CHAR_BACK_COLOR: { if (pArgs) { aSet.Put( pArgs->Get( pArgs->GetPool()->GetWhichIDFromSlotID( nSlot ) ) ); rBindings.Invalidate( nSlot ); } + else + { + const sal_uInt16 nEEWhich = GetPool().GetWhichIDFromSlotID(nSlot); + const std::optional<NamedColor>& oColor + = rViewData.GetDocShell()->GetRecentColor(nSlot); + if (oColor.has_value()) + { + const model::ComplexColor& rCol = (*oColor).getComplexColor(); + aSet.Put(SvxColorItem(rCol.getFinalColor(), rCol, nEEWhich)); + } + } } break; |