vcl/inc/jsdialog/enabled.hxx | 2 ++ vcl/jsdialog/enabled.cxx | 14 ++++++++++++++ vcl/source/window/builder.cxx | 4 ++++ 3 files changed, 20 insertions(+)
New commits: commit 126fb266713cf6cdf4a5bfa49f927516ce8d5d15 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Mar 4 08:38:13 2025 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Tue Mar 4 14:58:39 2025 +0100 jsdialogs: warn if not used in lok - it will be easier to spot missing ui file - add ignore list to not spam Change-Id: I2aabadfd0fa04732e7a7346dbb082d4ca5f01a98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182453 Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/vcl/inc/jsdialog/enabled.hxx b/vcl/inc/jsdialog/enabled.hxx index 5c85f310f155..fc61a9dba8fc 100644 --- a/vcl/inc/jsdialog/enabled.hxx +++ b/vcl/inc/jsdialog/enabled.hxx @@ -13,6 +13,8 @@ namespace jsdialog { +/// used to not warn about it +bool isIgnored(std::u16string_view rUIFile); bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile); bool isBuilderEnabledForPopup(std::u16string_view rUIFile); bool isBuilderEnabledForMenu(std::u16string_view rUIFile); diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index 77907cd18c03..943da80ab987 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -13,6 +13,20 @@ namespace jsdialog { +bool isIgnored(std::u16string_view rUIFile) +{ + if (rUIFile == u"sfx/ui/deck.ui" + || rUIFile == u"svt/ui/scrollbars.ui" + || rUIFile == u"svx/ui/selectionmenu.ui" + || rUIFile == u"svx/ui/stylemenu.ui" + || rUIFile == u"svt/ui/tabbuttons.ui" + || rUIFile == u"svx/ui/toolbarpopover.ui" + || rUIFile == u"svx/ui/toolbarpopover.ui") + return true; + + return false; +} + bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile) { // mobile only dialogs diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 43e954da025d..fa00ef662044 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -195,6 +195,8 @@ std::unique_ptr<weld::Builder> Application::CreateBuilder(weld::Widget* pParent, return JSInstanceBuilder::CreateMenuBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile); else if (jsdialog::isBuilderEnabled(rUIFile, bMobile)) return JSInstanceBuilder::CreateDialogBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile); + else if (!jsdialog::isIgnored(rUIFile)) + SAL_WARN("vcl", "UI file not enabled for JSDialogs: " << rUIFile); } return ImplGetSVData()->mpDefInst->CreateBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile); @@ -213,6 +215,8 @@ std::unique_ptr<weld::Builder> Application::CreateInterimBuilder(vcl::Window* pP else if (jsdialog::isBuilderEnabledForAddressInput(rUIFile)) return JSInstanceBuilder::CreateAddressInputBuilder( pParent, AllSettings::GetUIRootDir(), rUIFile, nLOKWindowId); + else if (!jsdialog::isIgnored(rUIFile)) + SAL_WARN("vcl", "UI file not enabled for JSDialogs: " << rUIFile); } return ImplGetSVData()->mpDefInst->CreateInterimBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, bAllowCycleFocusOut, nLOKWindowId);