diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-12-09 17:12:47 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-12-12 16:00:04 +0000 |
commit | 6691816fe86ef7d193fee3632c2d56debfff3fa9 (patch) | |
tree | 749eae1a7e4f25ee1c22cf8367bbcdd6118a3da4 /include | |
parent | 4ea9061d54ee6d2c1ce2460162a1ea5f32de1ae7 (diff) |
tdf#152266 add an infobar with indicators for macro-like content in doc
Show "macros" and "events" for now if we know that are present so
they can be investigated by the user. There are other things which
could potentially be added in the future.
Change-Id: I981ee7a8e22791cd15405894f30fee659ba0b7ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143897
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/app.hxx | 5 | ||||
-rw-r--r-- | include/sfx2/strings.hrc | 5 | ||||
-rw-r--r-- | include/sfx2/viewfrm.hxx | 3 |
3 files changed, 11 insertions, 2 deletions
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx index 6eff39bae926..73198c056aec 100644 --- a/include/sfx2/app.hxx +++ b/include/sfx2/app.hxx @@ -30,6 +30,7 @@ #include <sfx2/shell.hxx> +namespace com::sun::star::frame { class XFrame; } namespace com::sun::star::script { class XLibraryContainer; } namespace weld { class Window; } @@ -138,7 +139,9 @@ public: // Basic/Scripting static bool IsXScriptURL( const OUString& rScriptURL ); static OUString ChooseScript(weld::Window *pParent); - static void MacroOrganizer(weld::Window* pParent, sal_Int16 nTabId); + // if xDocFrame is present, then select that document in the macro organizer by default, otherwise it is typically "Application Macros" + // that is preselected + static void MacroOrganizer(weld::Window* pParent, const css::uno::Reference<css::frame::XFrame>& xDocFrame, sal_Int16 nTabId); static ErrCode CallBasic( const OUString&, BasicManager*, SbxArray *pArgs, SbxValue *pRet ); static ErrCode CallAppBasic( const OUString& i_macroName ) { return CallBasic( i_macroName, SfxApplication::GetBasicManager(), nullptr, nullptr ); } diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc index be107f52f049..b7e2c1bd1d65 100644 --- a/include/sfx2/strings.hrc +++ b/include/sfx2/strings.hrc @@ -145,7 +145,7 @@ #define STR_QUERY_UPDATE_LINKS NC_("STR_QUERY_UPDATE_LINKS", "The document %{filename} contains one or more links to external data.\n\nWould you like to change the document, and update all links\nto get the most recent data?") #define STR_DDE_ERROR NC_("STR_DDE_ERROR", "DDE link to %1 for %2 area %3 are not available.") #define STR_SECURITY_WARNING_NO_HYPERLINKS NC_("STR_SECURITY_WARNING_NO_HYPERLINKS", "For security reasons, the hyperlink cannot be executed.\nThe stated address will not be opened.") -#define RID_SECURITY_WARNING_TITLE NC_("RID_SECURITY_WARNING_TITLE", "Security Warning") +#define RID_SECURITY_WARNING_TITLE NC_("RID_SECURITY_WARNING_TITLE", "Security Warning") #define RID_SVXSTR_XMLSEC_QUERY_LOSINGSIGNATURE NC_("RID_SVXSTR_XMLSEC_QUERY_LOSINGSIGNATURE", "Saving will remove all existing signatures.\nDo you want to continue saving the document?") #define RID_SVXSTR_XMLSEC_QUERY_SAVEBEFORESIGN NC_("RID_SVXSTR_XMLSEC_QUERY_SAVEBEFORESIGN", "The document has to be saved before it can be signed.\nDo you want to save the document?") #define STR_QUERY_CANCELCHECKOUT NC_("STR_QUERY_CANCELCHECKOUT", "This will discard all changes on the server since check-out.\nDo you want to proceed?") @@ -292,6 +292,9 @@ #define STR_HYPHENATION_BUTTON NC_("STR_HYPHENATION_BUTTON", "Learn more") #define STR_REFRESH_MASTER_PASSWORD NC_("STR_REFRESH_MASTER_PASSWORD", "The master password is stored in an outdated format, you should refresh it") #define STR_REFRESH_PASSWORD NC_("STR_REFRESH_PASSWORD", "Refresh Password") +#define STR_CONTAINS_MACROS NC_("STR_CONTAINS_MACROS", "The document contains macros.") +#define STR_MACROS NC_("STR_MACROS", "Macros") +#define STR_EVENTS NC_("STR_EVENTS", "Events") // Translators: default Impress template names #define STR_TEMPLATE_NAME1 NC_("STR_TEMPLATE_NAME1", "Grey Elegant") diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx index a7bb8bd7844c..d8b15faa1762 100644 --- a/include/sfx2/viewfrm.hxx +++ b/include/sfx2/viewfrm.hxx @@ -64,6 +64,8 @@ class SFX2_DLLPUBLIC SfxViewFrame final : public SfxShell, public SfxListener DECL_DLLPRIVATE_LINK(GetInvolvedHandler, weld::Button&, void); DECL_DLLPRIVATE_LINK(DonationHandler, weld::Button&, void); DECL_DLLPRIVATE_LINK(WhatsNewHandler, weld::Button&, void); + DECL_DLLPRIVATE_LINK(MacroButtonHandler, weld::Button&, void); + DECL_DLLPRIVATE_LINK(EventButtonHandler, weld::Button&, void); DECL_DLLPRIVATE_LINK(SwitchReadOnlyHandler, weld::Button&, void); DECL_DLLPRIVATE_LINK(SignDocumentHandler, weld::Button&, void); DECL_DLLPRIVATE_LINK(HiddenTrackChangesHandler, weld::Button&, void); @@ -83,6 +85,7 @@ private: /// SfxInterface initializer. static void InitInterface_Impl(); + void AppendContainsMacrosInfobar(); public: static void SetViewFrame( SfxViewFrame* ); |