From ff9899db6ec920ddbb911ca01dd71126ac994979 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Tue, 23 Jun 2026 15:59:52 +0200 Subject: [PATCH] Move string for macro security denied from basctl to sfx2 That way it can be used by other modules in later patches. Change-Id: I5ea8ab0d835276e68de761d7e9b8924753388e6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207213 Tested-by: Jenkins Reviewed-by: Neil Roberts --- basctl/inc/strings.hrc | 1 - basctl/source/basicide/baside2.cxx | 4 +++- basctl/source/basicide/macrodlg.cxx | 6 ++++-- include/sfx2/strings.hrc | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/basctl/inc/strings.hrc b/basctl/inc/strings.hrc index 1b98cd4ebfb3..577845e753a7 100644 --- a/basctl/inc/strings.hrc +++ b/basctl/inc/strings.hrc @@ -37,7 +37,6 @@ #define RID_STR_SBXNAMEALLREADYUSED NC_("RID_STR_SBXNAMEALLREADYUSED", "Name already exists") #define RID_STR_SIGNED NC_("RID_STR_SIGNED", "(Signed)") #define RID_STR_SBXNAMEALLREADYUSED2 NC_("RID_STR_SBXNAMEALLREADYUSED2", "Object with same name already exists") -#define RID_STR_CANNOTRUNMACRO NC_("RID_STR_CANNOTRUNMACRO", "For security reasons, you cannot run this macro.\n\nFor more information, check the security settings.") #define RID_STR_SEARCHNOTFOUND NC_("RID_STR_SEARCHNOTFOUND", "Search key not found") #define RID_STR_SEARCHFROMSTART NC_("RID_STR_SEARCHFROMSTART", "Search to last module complete. Continue at first module?") #define RID_STR_SEARCHREPLACES NC_("RID_STR_SEARCHREPLACES", "Search key replaced XX times") diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 2ec94ceca82b..d4b1d070bc67 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -51,6 +51,8 @@ #include #include #include +#include +#include #include #include #include @@ -324,7 +326,7 @@ void ModulWindow::BasicExecute() { std::unique_ptr xBox( Application::CreateMessageDialog(GetFrameWeld(), VclMessageType::Warning, - VclButtonsType::Ok, IDEResId(RID_STR_CANNOTRUNMACRO))); + VclButtonsType::Ok, SfxResId(STR_CANNOTRUNMACRO))); xBox->run(); return; } diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index 1648d51dc0e9..29edf3883dba 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -40,7 +40,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -466,7 +468,7 @@ IMPL_LINK_NOARG(MacroChooser, MacroDoubleClickHdl, const weld::TreeIter&, bool) { std::unique_ptr xError( Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Warning, - VclButtonsType::Ok, IDEResId(RID_STR_CANNOTRUNMACRO))); + VclButtonsType::Ok, SfxResId(STR_CANNOTRUNMACRO))); xError->run(); return true; } @@ -599,7 +601,7 @@ IMPL_LINK(MacroChooser, ButtonHdl, weld::Button&, rButton, void) if ( aDocument.isDocument() && !aDocument.allowMacros() ) { std::unique_ptr xError(Application::CreateMessageDialog(m_xDialog.get(), - VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_CANNOTRUNMACRO))); + VclMessageType::Warning, VclButtonsType::Ok, SfxResId(STR_CANNOTRUNMACRO))); xError->run(); return; } diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc index 8db2dcf4130b..5e39f1147611 100644 --- a/include/sfx2/strings.hrc +++ b/include/sfx2/strings.hrc @@ -325,6 +325,7 @@ #define STR_MACROS_DISABLED_SIGNATURE_INVALID NC_("STR_MACROS_DISABLED_SIGNATURE_INVALID", "Macros are signed, but at least one signature has problems.") #define STR_MACROS_DISABLED_CONTENT_UNSIGNED NC_("STR_MACROS_DISABLED_CONTENT_UNSIGNED", "Macros are signed, but the document (containing document events) is not signed.") #define STR_MACROS NC_("STR_MACROS", "Show Macros") +#define STR_CANNOTRUNMACRO NC_("STR_CANNOTRUNMACRO", "For security reasons, you cannot run this macro.\n\nFor more information, check the security settings.") #define STR_SECURITY_OPTIONS NC_("STR_MACROS", "Show Security Options") #define STR_EVENTS NC_("STR_EVENTS", "Show Events") #define STR_VCLGEN_TITLE NC_("STR_VCLGEN_TITLE", "Fallback UI controls in use")