diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-03-05 00:42:05 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-03-10 19:42:01 +0100 |
commit | 701fa346817193d04f468f7c7657f0e4e1ccb942 (patch) | |
tree | c80b126789e95041dfd9c32e8a1f15d04bc713d3 | |
parent | 42eaaa3ee5d14433488ac9b75204c68e47c4393e (diff) |
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/23043
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 2317420ecee0bf2f01f1555fdaaa56dc9fd6a9c8)
-rw-r--r-- | basic/source/uno/scriptcont.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index bbf1fa6b2117..8805c38b982e 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& ) {} @@ -515,6 +520,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 ); |