summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-05-07 12:03:48 +0200
committerVasily Melenchuk <vasily.melenchuk@cib.de>2020-12-07 13:00:23 +0300
commitb2d79a2922a5eceb93180095cea966c38b0091a8 (patch)
treedb40ce4d81b03826173c4d08991a635a1beac96b /dbaccess
parent0ba4f7f0ad04f36f5e7e6e18a38f2a97165db813 (diff)
tdf#97694 Add test for macro signature preservation in Base
Change-Id: I35fb8d499eed66f9a5e208a4778a1f0f12637079 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93630 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/ModelImpl.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 4ffbb0396e42..9681254b8262 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -856,14 +856,17 @@ bool ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors( const Reference<
aTempFile.EnableKillingFile();
OUString sTmpFileUrl = aTempFile.GetURL();
SignatureState aSignatureState = getScriptingSignatureState();
- if (aSignatureState == SignatureState::OK
- || aSignatureState == SignatureState::NOTVALIDATED
- || aSignatureState == SignatureState::INVALID)
+ OUString sLocation = getDocFileLocation();
+ bool bIsEmbedded = sLocation.startsWith("vnd.sun.star.pkg:") && sLocation.endsWith("/EmbeddedDatabase");
+ if (!bIsEmbedded && !sLocation.isEmpty()
+ && (aSignatureState == SignatureState::OK || aSignatureState == SignatureState::NOTVALIDATED
+ || aSignatureState == SignatureState::INVALID
+ || aSignatureState == SignatureState::UNKNOWN))
{
bTryToPreserveScriptSignature = true;
// We need to first save the file (which removes the macro signature), then add the macro signature again.
// For that, we need a temporary copy of the original file.
- osl::File::RC rc = osl::File::copy(getDocFileLocation(), sTmpFileUrl);
+ osl::File::RC rc = osl::File::copy(sLocation, sTmpFileUrl);
if (rc != osl::FileBase::E_None)
throw uno::RuntimeException("Could not create temp file");
}