include/sfx2/lokunocmdlist.hxx | 1 + sc/sdi/scalc.sdi | 2 +- sc/source/ui/view/tableshell.cxx | 6 ++++++ sfx2/source/control/unoctitm.cxx | 27 ++++++++++++++++++++++++++- 4 files changed, 34 insertions(+), 2 deletions(-)
New commits: commit 2facda8beb7fcc6e19d807eb8447c467774b2351 Author: Szymon Kłos <[email protected]> AuthorDate: Fri Feb 20 14:38:39 2026 +0000 Commit: Tomaž Vajngerl <[email protected]> CommitDate: Thu Feb 26 15:41:10 2026 +0100 lok: publish more detailed state of .uno:DatabaseSettings - it will be easier to provide customized UI - no need to use vcl widget for updates Change-Id: I672eaca74d4ff9f7dca6402f3951ac2617f8f642 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200326 Reviewed-by: Tomaž Vajngerl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Balazs Varga <[email protected]> diff --git a/include/sfx2/lokunocmdlist.hxx b/include/sfx2/lokunocmdlist.hxx index 34fd3f52985f..bcbd1065a990 100644 --- a/include/sfx2/lokunocmdlist.hxx +++ b/include/sfx2/lokunocmdlist.hxx @@ -34,6 +34,7 @@ enum class PayloadType StringOrStrSeqPayload, StrSeqPayload, TableSizePayload, + TableStylePayload, }; struct KitUnoCommand diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index 2f5a72dbe73d..3e755b1ea2ad 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -6476,7 +6476,7 @@ SfxBoolItem CellProtection SID_SCATTR_CELLPROTECTION ] ScDatabaseSettingItem DatabaseSettings SID_DATABASE_SETTINGS - +(ScDatabaseSettingItem DatabaseSettings SID_DATABASE_SETTINGS) [ AutoUpdate = FALSE, FastCall = TRUE, diff --git a/sc/source/ui/view/tableshell.cxx b/sc/source/ui/view/tableshell.cxx index 19d3152ecfc8..9dbc55f4f75d 100644 --- a/sc/source/ui/view/tableshell.cxx +++ b/sc/source/ui/view/tableshell.cxx @@ -69,6 +69,12 @@ void ScTableShell::ExecuteDatabaseSettings(SfxRequest& rReq) { case SID_DATABASE_SETTINGS: { + if (!pSet) + { + SAL_WARN("sc", "No arguments provided for ExecuteDatabaseSettings"); + break; + } + const SfxPoolItem* pItem; SfxItemState eItemState = pSet->GetItemState(SCITEM_DATABASE_SETTING, true, &pItem); if (eItemState == SfxItemState::SET diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index e93ac62a18a4..b81e8d1cf3e5 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1149,6 +1149,29 @@ OString TableSizePayload(sal_uInt16, SfxViewFrame*, const css::frame::FeatureSta return aBuffer.makeStringAndClear(); } +OString TableStylePayload(sal_uInt16, SfxViewFrame*, const css::frame::FeatureStateEvent& aEvent, + const SfxPoolItem*) +{ + tools::JsonWriter aTree; + aTree.put("commandName", aEvent.FeatureURL.Complete); + aTree.put("enabled", !!aEvent.IsEnabled); // use boolean + + css::uno::Sequence<css::beans::PropertyValue> aSeq; + if (aEvent.IsEnabled && (aEvent.State >>= aSeq)) + { + auto aState = aTree.startNode("state"); + for (const auto& rProp : aSeq) + { + OString sName = rProp.Name.toUtf8(); + if (bool bVal; rProp.Value >>= bVal) + aTree.put(sName, bVal); + else if (OUString sVal; rProp.Value >>= sVal) + aTree.put(sName, sVal); + } + } + return aTree.finishAndGetAsOString(); +} + constexpr auto enumToPayload = frozen::make_unordered_map<PayloadType, PayloadGetter_t>({ { PayloadType::None, nullptr }, { PayloadType::IsActivePayload, IsActivePayload }, @@ -1171,6 +1194,7 @@ constexpr auto enumToPayload = frozen::make_unordered_map<PayloadType, PayloadGe { PayloadType::StringOrStrSeqPayload, StringOrStrSeqPayload }, { PayloadType::StrSeqPayload, StrSeqPayload }, { PayloadType::TableSizePayload, TableSizePayload }, + { PayloadType::TableStylePayload, TableStylePayload }, }); } @@ -1353,7 +1377,6 @@ const std::map<std::u16string_view, KitUnoCommand>& GetKitUnoCommandList() { u"EditHeaderAndFooter", { PayloadType::EnabledPayload, true } }, { u"InsertCalcTable", { PayloadType::EnabledPayload, true } }, { u"RemoveCalcTable", { PayloadType::EnabledPayload, true } }, - { u"DatabaseSettings", { PayloadType::EnabledPayload, true } }, { u"InsertSparkline", { PayloadType::EnabledPayload, true } }, { u"DeleteSparkline", { PayloadType::EnabledPayload, true } }, { u"DeleteSparklineGroup", { PayloadType::EnabledPayload, true } }, @@ -1453,6 +1476,8 @@ const std::map<std::u16string_view, KitUnoCommand>& GetKitUnoCommandList() { u"TableColumWidth", { PayloadType::TableSizePayload, false } }, { u"TableRowHeight", { PayloadType::TableSizePayload, false } }, + { u"DatabaseSettings", { PayloadType::TableStylePayload, true } }, + { u"BorderInner", { PayloadType::None, true } }, { u"BorderOuter", { PayloadType::None, true } }, { u"ChangeTheme", { PayloadType::None, true } },
