sc/sdi/tabvwsh.sdi | 1 + sc/source/ui/view/tabvwsh3.cxx | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+)
New commits: commit 0b9cf7da89b8a218a42fd14ff097299563251b7d Author: Banobe Pascal <[email protected]> AuthorDate: Tue Feb 3 17:48:12 2026 +0300 Commit: Szymon Kłos <[email protected]> CommitDate: Thu Feb 12 04:47:55 2026 +0100 sc: Enable UNO command 'Add Theme' command in Calc Signed-off-by: Banobe Pascal <[email protected]> Change-Id: Ifc7a0f857d5558aab4b4f72045092486edaf9b88 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198611 Reviewed-by: Szymon Kłos <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi index cbf2ea66e59b..234f4953ce13 100644 --- a/sc/sdi/tabvwsh.sdi +++ b/sc/sdi/tabvwsh.sdi @@ -194,6 +194,7 @@ interface TableEditView SID_PRINTPREVIEW [ ExecMethod = Execute; StateMethod = GetState; ] SID_THEME_DIALOG [ ExecMethod = Execute; StateMethod = GetState; ] SID_APPLY_THEME [ ExecMethod = Execute; StateMethod = GetState; ] + SID_ADD_THEME [ ExecMethod = Execute; StateMethod = GetState; ] SID_NAVIGATOR_SELECT_COMMENT [ ExecMethod = ExecNavigatorWin; ] diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index 61e6af646e3e..d1682ec6ddaf 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -66,6 +66,8 @@ #include <svx/dialog/ThemeDialog.hxx> #include <ThemeColorChanger.hxx> +#include <svx/dialog/ThemeColorEditDialog.hxx> +#include <svx/ColorSets.hxx> #include <dialogs/SelectSheetViewDialog.hxx> namespace @@ -1603,6 +1605,29 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) rReq.Done(); } break; + case SID_ADD_THEME: + { + // Create empty color set as starting point for new theme + auto pCurrentColorSet = std::make_shared<model::ColorSet>(OUString()); + + // Open ThemeColorEditDialog to create/edit the new color set + auto pSubDialog = std::make_shared<svx::ThemeColorEditDialog>(GetFrameWeld(), *pCurrentColorSet); + + weld::DialogController::runAsync(pSubDialog, [pSubDialog](sal_uInt32 nResult) { + if (nResult != RET_OK) + return; + + auto aColorSet = pSubDialog->getColorSet(); + if (!aColorSet.getName().isEmpty()) + { + // Add the new color set to the global collection with auto-rename if needed + svx::ColorSets::get().insert(aColorSet, svx::ColorSets::IdenticalNameAction::AutoRename); + } + }); + + rReq.Ignore(); + } + break; case SID_THEME_DIALOG: {
