diff options
author | Henry Castro <hcastro@collabora.com> | 2021-03-03 18:17:31 -0400 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2021-04-06 23:13:12 +0200 |
commit | 598348c797854450d03c9064b45d4b4e525ebd15 (patch) | |
tree | 3938d766c179e46f6cd685af92e9a7fce2e8dfff /uui | |
parent | 317af2e31bacb3fb5e9d705d966479d04e02e2a0 (diff) |
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 <jenkinscollaboraoffice@gmail.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113687
Tested-by: Jenkins
Diffstat (limited to 'uui')
-rw-r--r-- | uui/source/secmacrowarnings.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
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 <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> #include <com/sun/star/security/DocumentDigitalSignatures.hpp> +#include <comphelper/documentconstants.hxx> +#include <comphelper/lok.hxx> #include <comphelper/processfactory.hxx> #include <vcl/svapp.hxx> +#include <osl/file.hxx> #include <osl/file.h> #include <rtl/ustrbuf.hxx> #include <tools/debug.hxx> #include <unotools/securityoptions.hxx> +#include <tools/urlobj.hxx> +#include <unotools/resmgr.hxx> +#include <com/sun/star/security/NoPasswordException.hpp> 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); } |