sc/source/ui/view/formatsh.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
New commits: commit 1e045b03f67f85c2ab49d7c69a88b9953f8e27f0 Author: Heiko Tietze <[email protected]> AuthorDate: Mon Jan 5 12:17:32 2026 +0100 Commit: Heiko Tietze <[email protected]> CommitDate: Wed Jan 7 08:54:57 2026 +0100 Resolves tdf#169812 - Apply last used color for uno:Color Instead of opening the font dialog a shortcut applies now the current color from the color picker Change-Id: Ief2cd085bdec792a050450123bbb019e75c4efd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196556 Reviewed-by: Heiko Tietze <[email protected]> Tested-by: Jenkins (cherry picked from commit 751c78a2ea3cbc34223977b1c51661b51a564e5f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196606 diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 6c6c70814bff..d9f4f3bac525 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -941,6 +941,23 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) break; } case SID_ATTR_CHAR_COLOR: + { + Color aColor(COL_TRANSPARENT); + if (auto pObjectShell = pTabViewShell->GetObjectShell()) + { + const std::optional<NamedColor> oColor + = pObjectShell->GetRecentColor(SID_ATTR_CHAR_COLOR); + if (oColor.has_value()) + aColor = (*oColor).getComplexColor().getFinalColor(); + } + + SvxColorItem aColorItem( + pTabViewShell->GetSelectionPattern()->GetItem(ATTR_FONT_COLOR)); + aColorItem.setColor(aColor); + pTabViewShell->ApplyAttr(aColorItem, false); + } + break; + case SID_ATTR_CHAR_FONT: case SID_ATTR_CHAR_FONTHEIGHT: pTabViewShell->ExecuteCellFormatDlg(rReq, u"font"_ustr); // when ToolBar is vertical
