diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-05-27 19:31:01 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-05-27 20:26:52 +0200 |
commit | 34eea317c5929d640aa43477c737d26d6b700bdb (patch) | |
tree | 7c91f1d48d95c2cfad6e0a35700db267b72c54f3 /framework | |
parent | 855a56fea4561135a63cb729d7a625a950b210e7 (diff) |
tdf#149170 framework,sfx2: don't add ReadOnly=false
There is a non-obvious difference in error handling when opening the
file read/write for type-detection fails in
utl::MediaDescriptor::impl_openStreamWithURL() - if ReadOnly=false is
given, it will abort the file loading, whereas without any ReadOnly it
will fall-back to a read-only opening of the file for type detection.
At this point a StillReadWriteInteraction is used, so the user is never
notified of the failure.
(regression from commit 404c51f3664ffd4f7e2c1c8bb8a12ac70954fec2)
Change-Id: I8c06fe23cc0bc0767df83f680a1a59e3700bbbbb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135045
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uielement/recentfilesmenucontroller.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index 2fbad67becd9..dc4001a1f645 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -264,14 +264,17 @@ void RecentFilesMenuController::executeEntry( sal_Int32 nIndex ) Sequence< PropertyValue > aArgsList{ comphelper::makePropertyValue("Referer", OUString( "private:user" )), - comphelper::makePropertyValue("ReadOnly", m_aRecentFilesItems[nIndex].second), - // documents in the picklist will never be opened as templates comphelper::makePropertyValue("AsTemplate", false), // Type detection needs to know which app we are opening it from. comphelper::makePropertyValue("DocumentService", m_aModuleName) }; + if (m_aRecentFilesItems[nIndex].second) // tdf#149170 only add if true + { + aArgsList.realloc(aArgsList.size()+1); + aArgsList.getArray()[aArgsList.size()-1] = comphelper::makePropertyValue("ReadOnly", true); + } dispatchCommand(m_aRecentFilesItems[nIndex].first, aArgsList, "_default"); } |