summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-01-02 07:41:46 +0000
committerMike Kaganski <mike.kaganski@collabora.com>2023-01-02 12:23:35 +0000
commit86373552318c4858b8a050d08c57dcb35cdb2193 (patch)
tree211c83f0150eae4f7fdb000032e8e840e01760bc /sfx2
parent773baa53608c4fd36de469c92b39f54672889f88 (diff)
Only call getDocumentLocation once
Change-Id: I0d611e5170b392a6f2b78fda51e48cd1a3287fa7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144909 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docmacromode.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index c2ec2fd8e417..ae70c6a8c056 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -206,12 +206,13 @@ namespace sfx2
if ( nMacroExecutionMode == MacroExecMode::ALWAYS_EXECUTE_NO_WARN )
return true;
+ const OUString sURL(m_xData->m_rDocumentAccess.getDocumentLocation());
try
{
// get document location from medium name and check whether it is a trusted one
// the service is created without document version, since it is not of interest here
Reference< XDocumentDigitalSignatures > xSignatures(DocumentDigitalSignatures::createDefault(::comphelper::getProcessComponentContext()));
- INetURLObject aURLReferer( m_xData->m_rDocumentAccess.getDocumentLocation() );
+ INetURLObject aURLReferer(sURL);
OUString aLocation;
if ( aURLReferer.removeSegment() )
@@ -293,7 +294,6 @@ namespace sfx2
#if defined(_WIN32)
// Windows specific: try to decide macros loading depending on Windows Security Zones
// (is the file local, or it was downloaded from internet, etc?)
- OUString sURL(m_xData->m_rDocumentAccess.getDocumentLocation());
OUString sFilePath;
osl::FileBase::getSystemPathFromFileURL(sURL, sFilePath);
sal::systools::COMReference<IZoneIdentifier> pZoneId;
@@ -348,7 +348,7 @@ namespace sfx2
if ( eAutoConfirm == eNoAutoConfirm )
{
- OUString sReferrer( m_xData->m_rDocumentAccess.getDocumentLocation() );
+ OUString sReferrer(sURL);
OUString aSystemFileURL;
if ( osl::FileBase::getSystemPathFromFileURL( sReferrer, aSystemFileURL ) == osl::FileBase::E_None )