summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-01-22 10:59:06 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-01-22 11:40:23 +0100
commitd768757872ad25219fa291acd623ab98924acaaa (patch)
tree2b1b143deabf991ce8bb330883153883ba710595
parente4ba4e56eff11bf914819b19f427e30d6acd1ac0 (diff)
tdf#129829 sfx2: fix handling of password to open vs modify
Regression from commit e0f20211a8048a87b078aa4cf0f28c0c847487ad (sw reqif-xhtml import: add a new AllowedRTFOLEMimeTypes parameter, 2019-12-16), the problem was that in case the (input) stream for an opened document is kept alive, then we don't try to re-create it, which means providing a different password behaves the same as providing the same (wrong) password. It seems CheckPasswd_Impl() in sfx2 only calls comphelper::DocPasswordHelper::requestAndVerifyDocPassword() in case we don't have a decrypted stream already. Fix the problem by deleting those streams from the remembered input parameters, the interesting ones have custom key names anyway. [ No testcase, the problem is Windows-only and it's not clear to me why the behavior is platform-specific. ] Change-Id: I2fc1f0567244897caa18548161fe426ac7d0dfd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87182 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
-rw-r--r--sfx2/source/doc/docfile.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index e7a6d8fbb5bd..06302d39f280 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -3220,7 +3220,7 @@ SfxMedium::SfxMedium( const uno::Sequence<beans::PropertyValue>& aArgs ) :
SfxAllItemSet *pParams = new SfxAllItemSet( SfxGetpApp()->GetPool() );
pImpl->m_pSet.reset( pParams );
TransformParameters( SID_OPENDOC, aArgs, *pParams );
- pImpl->m_aArgs = aArgs;
+ SetArgs(aArgs);
OUString aFilterProvider, aFilterName;
{
@@ -3284,7 +3284,10 @@ SfxMedium::SfxMedium( const uno::Sequence<beans::PropertyValue>& aArgs ) :
void SfxMedium::SetArgs(const uno::Sequence<beans::PropertyValue>& rArgs)
{
- pImpl->m_aArgs = rArgs;
+ comphelper::SequenceAsHashMap aArgsMap(rArgs);
+ aArgsMap.erase("Stream");
+ aArgsMap.erase("InputStream");
+ pImpl->m_aArgs = aArgsMap.getAsConstPropertyValueList();
}
uno::Sequence<beans::PropertyValue> SfxMedium::GetArgs() const { return pImpl->m_aArgs; }