[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-1' - dbaccess/source

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 8 21:52:50 UTC 2020


 dbaccess/source/core/dataaccess/databasedocument.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 984a240975b87eff10ccda394de9e7ea0078ed30
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Tue Apr 7 09:05:05 2020 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Wed Apr 8 23:52:20 2020 +0200

    Related tdf#97694 Fix macro preservation on Windows
    
    Change-Id: Ief183c75e0c3ce6c42868b7c60c5f66f9684d743
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91795
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    (cherry picked from commit 792c730f3cda4f5c312921a62ecae3d322ad9b72)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91920
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index cc571a0a6457..f76104e93aa9 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -1093,18 +1093,21 @@ void ODatabaseDocument::impl_storeAs_throw( const OUString& _rURL, const ::comph
         }
 
         // store to current storage
-        Reference< XStorage > xCurrentStorage( m_pImpl->getOrCreateRootStorage(), UNO_QUERY_THROW );
+        Reference< XStorage > xCurrentStorage( m_pImpl->getOrCreateRootStorage(), UNO_SET_THROW );
+        OUString aODFVersion(comphelper::OStorageHelper::GetODFVersionFromStorage(xCurrentStorage));
         Sequence< PropertyValue > aMediaDescriptor( lcl_appendFileNameToDescriptor( _rArguments, _rURL ) );
         impl_storeToStorage_throw( xCurrentStorage, aMediaDescriptor, _rGuard );
 
         // Preserve script signature if the script has not changed
         if (bTryToPreserveScriptSignature)
         {
+            // Need to close this storage, otherwise we can't open it for signing below
+            // (Windows needs exclusive file access)
+            uno::Reference < lang::XComponent > xComp = xCurrentStorage;
+            xComp->dispose();
             uno::Reference<security::XDocumentDigitalSignatures> xDDSigns;
             try
             {
-                OUString aODFVersion(
-                    comphelper::OStorageHelper::GetODFVersionFromStorage(xCurrentStorage));
                 xDDSigns = security::DocumentDigitalSignatures::createWithVersion(
                     comphelper::getProcessComponentContext(), aODFVersion);
 


More information about the Libreoffice-commits mailing list