From 598348c797854450d03c9064b45d4b4e525ebd15 Mon Sep 17 00:00:00 2001 From: Henry Castro Date: Wed, 3 Mar 2021 18:17:31 -0400 Subject: lok: strip directory and suffix from filenames The Macro Warning dialog should only show the filename Change-Id: I04f1d3a1b945d65276187ca0a284e41bd08ed298 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111941 Tested-by: Jenkins CollaboraOffice Tested-by: Michael Meeks Reviewed-by: Michael Meeks Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113687 Tested-by: Jenkins --- uui/source/secmacrowarnings.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'uui') diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx index 90d76d75e6ce..932c4723ab21 100644 --- a/uui/source/secmacrowarnings.cxx +++ b/uui/source/secmacrowarnings.cxx @@ -19,12 +19,18 @@ #include #include +#include +#include #include #include +#include #include #include #include #include +#include +#include +#include using namespace ::com::sun::star::security; @@ -87,7 +93,13 @@ IMPL_STATIC_LINK_NOARG(MacroWarning, InstallLOKNotifierHdl, void*, vcl::ILibreOf void MacroWarning::SetDocumentURL( const OUString& rDocURL ) { OUString aAbbreviatedPath; - osl_abbreviateSystemPath(rDocURL.pData, &aAbbreviatedPath.pData, 50, nullptr); + if (comphelper::LibreOfficeKit::isActive()) + { + osl::FileBase::getFileURLFromSystemPath(rDocURL, aAbbreviatedPath); + aAbbreviatedPath = INetURLObject(aAbbreviatedPath).GetLastName(); + } + else + osl_abbreviateSystemPath(rDocURL.pData, &aAbbreviatedPath.pData, 50, nullptr); m_xDialog->set_primary_text(aAbbreviatedPath); } -- cgit