[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - basic/source

Michael Stahl mstahl at redhat.com
Wed Mar 9 09:59:23 UTC 2016


 basic/source/uno/scriptcont.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit a93f26304e21e257aaf6914e0f8607c80fb912af
Author: Michael Stahl <mstahl at redhat.com>
Date:   Sat Mar 5 00:42:05 2016 +0100

    basic: tdf#87530 if a new password is set, must set mbLoadedSource flag
    
    ... so that the library is stored (and encrypted), and not copied
    unencrypted from source storage.
    
    Change-Id: I9546087ec6f07007aa1ec377d2e959f2bae99a38
    (cherry picked from commit 6a351c5cf91d0f667168d834ba2eb5c04121c7d5)
    Reviewed-on: https://gerrit.libreoffice.org/23041
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index 84ee6f6..a8fb044 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -94,6 +94,11 @@ void SfxScriptLibraryContainer::setLibraryPassword( const OUString& rLibraryName
             pImplLib->mbDoc50Password = true;
             pImplLib->mbPasswordProtected = true;
             pImplLib->maPassword = rPassword;
+            SfxScriptLibrary *const pSL(dynamic_cast<SfxScriptLibrary *>(pImplLib));
+            if (pSL && pSL->mbLoaded)
+            {
+                pSL->mbLoadedSource = true; // must store source code now!
+            }
         }
     }
     catch(const NoSuchElementException& ) {}
@@ -486,6 +491,11 @@ void SAL_CALL SfxScriptLibraryContainer::changeLibraryPassword( const OUString&
         pImplLib->mbPasswordProtected = true;
         pImplLib->mbPasswordVerified = true;
         pImplLib->maPassword = NewPassword;
+        SfxScriptLibrary *const pSL(dynamic_cast<SfxScriptLibrary *>(pImplLib));
+        if (pSL && pSL->mbLoaded)
+        {
+            pSL->mbLoadedSource = true; // must store source code now!
+        }
 
         maModifiable.setModified( true );
         pImplLib->implSetModified( true );


More information about the Libreoffice-commits mailing list