diff options
Diffstat (limited to 'dbaccess/source/core')
-rw-r--r-- | dbaccess/source/core/dataaccess/ModelImpl.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index d5c3b9b3e086..21e45033ea4f 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 m_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(), m_sTmpFileUrl); + osl::File::RC rc = osl::File::copy(sLocation, m_sTmpFileUrl); if (rc != osl::FileBase::E_None) throw uno::RuntimeException("Could not create temp file"); } |